Events: cannot specify timezone for Schedule cron
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the feature
In the console, when creating a Rule with an Event schedule, I have the option to use UTC or 'Local time zone'.
I can't seem to find a way of specifying this in CDK. It would be helpful if this is possible.
Here's my current implementation - if there's something I can add to this, that would be great.
```
const rule = new Rule(this.parent, `${this.stackName}-Rule-${ruleName}`, {
ruleName: `${this.stackName}-${ruleName}`,
schedule: Schedule.cron({
minute: "0",
hour: "8,20",
}),
});
```
### Use Case
For timezones such as Europe/London, currently if I want the schedule to be consistent all year around I need to manually update this field in the console after creating the Rule via CDK.
### Proposed Solution
An additional field, `timeZone` or similar.
const rule = new Rule(this.parent, `${this.stackName}-Rule-${ruleName}`, {
ruleName: `${this.stackName}-${ruleName}`,
schedule: Schedule.cron({
minute: "0",
hour: "8,20",
timeZone: "Europe/London"
}),
});
### Other Information
_No response_
### Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
### CDK version used
2.32.0
### Environment details (OS name and version, etc.)
MacOS Monterey 12.4
Contributor guide
Research direction
Start at the TypeScript definitions and entry points for Rule and Schedule.cron, then trace how the schedule is represented for the console's UTC or local-time-zone setting. Add support for the requested Europe/London-style timezone option and verify that the generated rule reflects it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100