Skip to content

Commit

Permalink
fix: description propery is not used
Browse files Browse the repository at this point in the history
  • Loading branch information
mazyu36 committed Aug 31, 2024
1 parent 9c16949 commit aa73fdf
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 8 deletions.
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',
});
});
});
});

0 comments on commit aa73fdf

Please sign in to comment.