Skip to content
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

fix(scheduler): the value of the description property is not reflected to the resource. #31276

Merged
merged 2 commits into from
Sep 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-scheduler-alpha/lib/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ export class Schedule extends Resource implements ISchedule {
},
startDate: props.start?.toISOString(),
endDate: props.end?.toISOString(),
description: props.description,
});

this.scheduleName = this.getResourceNameAttribute(resource.ref);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,37 @@
}
}
}
},
"UseDescription170B07AB": {
"Type": "AWS::Scheduler::Schedule",
"Properties": {
"Description": "test description",
"FlexibleTimeWindow": {
"Mode": "OFF"
},
"ScheduleExpression": "rate(12 hours)",
"ScheduleExpressionTimezone": "Etc/UTC",
"State": "ENABLED",
"Target": {
"Arn": {
"Fn::GetAtt": [
"Function76856677",
"Arn"
]
},
"Input": "\"Input Text\"",
"RetryPolicy": {
"MaximumEventAgeInSeconds": 180,
"MaximumRetryAttempts": 3
},
"RoleArn": {
"Fn::GetAtt": [
"Role1ABCC5F0",
"Arn"
]
}
}
}
}
},
"Parameters": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions packages/@aws-cdk/aws-scheduler-alpha/test/integ.schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ new scheduler.Schedule(stack, 'ScheduleWithTimeFrame', {
end: new Date(`${currentYear + 2}-10-01T00:00:00.000Z`),
});

new scheduler.Schedule(stack, 'UseDescription', {
schedule: expression,
target: target,
description: 'test description',
});

new IntegTest(app, 'integtest-schedule', {
testCases: [stack],
});
Expand Down
14 changes: 14 additions & 0 deletions packages/@aws-cdk/aws-scheduler-alpha/test/schedule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,19 @@ describe('Schedule', () => {
});
}).toThrow('The provided duration must be between 1 minute and 1440 minutes, got 0');
});

test('schedule with description', () => {
// WHEN
new Schedule(stack, 'TestSchedule', {
schedule: expr,
target: new SomeLambdaTarget(func, role),
description: 'test description',
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Scheduler::Schedule', {
Description: 'test description',
});
});
});
});