-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(scheduler-alpha): Schedule description is not set #31269
(scheduler-alpha): Schedule description is not set #31269
Comments
Reproducible using code below: import * as cdk from 'aws-cdk-lib';
import * as sfn from 'aws-cdk-lib/aws-stepfunctions';
import * as lambda from 'aws-cdk-lib/aws-lambda';
import * as stepfunction from 'aws-cdk-lib/aws-stepfunctions';
import * as stepfunctiontasks from 'aws-cdk-lib/aws-stepfunctions-tasks';
import * as scheduler from '@aws-cdk/aws-scheduler-alpha';
import * as schedulertargets from '@aws-cdk/aws-scheduler-targets-alpha';
export class CdktestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const helloFunction = new lambda.Function(this, 'MyLambdaFunction', {
code: lambda.Code.fromInline(`
exports.handler = (event, context, callback) => {
callback(null, "Hello World!");
};
`),
runtime: lambda.Runtime.NODEJS_18_X,
handler: "index.handler",
timeout: cdk.Duration.seconds(3)
});
const stateMachine = new stepfunction.StateMachine(this, 'MyStateMachine', {
definition: new stepfunctiontasks.LambdaInvoke(this, "MyLambdaTask", {
lambdaFunction: helloFunction
}).next(new sfn.Succeed(this, "GreetedWorld"))
});
new scheduler.Schedule(this, "SomeSchedule", {
description: `Some description`,
schedule: scheduler.ScheduleExpression.rate(cdk.Duration.days(7)),
target: new schedulertargets.StepFunctionsStartExecution(stateMachine, {}),
});
}
} Running ...
SomeSchedule2B2B2075:
Type: AWS::Scheduler::Schedule
Properties:
FlexibleTimeWindow:
Mode: "OFF"
ScheduleExpression: rate(7 days)
ScheduleExpressionTimezone: Etc/UTC
State: ENABLED
Target:
Arn:
Ref: MyStateMachine6C968CA5
RetryPolicy:
MaximumEventAgeInSeconds: 86400
MaximumRetryAttempts: 185
RoleArn:
Fn::GetAtt:
- SchedulerRoleForTarget1441a743A31888
- Arn
Metadata:
aws:cdk:path: CdktestStack/SomeSchedule/Resource
...
Looks like |
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
…d to the resource. (aws#31276) ### Issue # (if applicable) Closes aws#31269 . ### Reason for this change The `description` property is not used in the `Schedule` class. As a result, the value of the `description` property is not reflected to the resource. ### Description of changes Modify to set the value of props to the `description` property. ### Description of how you validated changes Add a unit test and an integ test. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…d to the resource. (aws#31276) ### Issue # (if applicable) Closes aws#31269 . ### Reason for this change The `description` property is not used in the `Schedule` class. As a result, the value of the `description` property is not reflected to the resource. ### Description of changes Modify to set the value of props to the `description` property. ### Description of how you validated changes Add a unit test and an integ test. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
If you specify a description on a schedule its not set in the created Scheduled Rule.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
I would have expected that the description of a schedule will be set.
Current Behavior
The schedule is created without description
Reproduction Steps
Possible Solution
Set field
description
of CfnSchedule in Schedule here:aws-cdk/packages/@aws-cdk/aws-scheduler-alpha/lib/schedule.ts
Lines 328 to 329 in 34dcc5a
Additional Information/Context
No response
CDK CLI Version
2.150.0
Framework Version
No response
Node.js Version
20.17.0
OS
windows 11
Language
TypeScript
Language Version
5.5.4
Other information
No response
The text was updated successfully, but these errors were encountered: