You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 22, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 22, 2026. It is now read-only.
The use can specify the timezone of the schedule expression in Scheduled Job #4604
Great! How does it work now? Do you point me to some documentation to implement it myself and send a pull request, or is it so trivial that you prefer to fix it yourself?
How does it work now? Do you point me to some documentation to implement it myself and send a pull request, or is it so trivial that you prefer to fix it yourself?
Typically, if it's going to be implemented by the AWS Copilot team we'll need to prioritize the feature request first. We update the GitHub issues saying that the team is now picking up the feature request so that users are aware of the progress.
Unfortunately, I can't make a commitment today for a timeline for the feature. However, if you'd like to send a pull-request we'd be happy to review it!
If you'd like to contribute the feature, I believe the following changes need to happen:
I'd also like to see this implemented. However, just translating the expressions, before passing it to the template engine is insufficient for reoccurring jobs. The advantage of being able to select timezone is daylight savings handling.
If someone were able to rewrite the template to use AWS::Scheduler::Schedule, instead of the, currently used, AWS::Events::Rule, we'd be able to have native timezone support.
I ended up using the following YAML patch overrides to support my use case. May follow up with a PR to do the work described in my comment above, if there is interest. If anyone knows, if there is a way to add support for grabbing the time zone value from the manifest yaml, please let me know.
######################################################################################################################################################### Time zone Support ########################################################################################################################################################### Replaces AWS::Events::Rule with AWS::Scheduler::Schedule to take advtange of EventBridge Scheduler's #### time zone support. See TR-209 ################################################################################################################### Update RuleRole to allow Scheduler
- op: replacepath: /Resources/RuleRole/Properties/AssumeRolePolicyDocument/Statement/0/Principal/Servicevalue: scheduler.amazonaws.com# Use EventBridge Scheduler instead of CloudWatch Events
- op: replacepath: /Resources/Rule/Typevalue: 'AWS::Scheduler::Schedule'
- op: addpath: /Resources/Rule/Properties/FlexibleTimeWindowvalue:
# Must have quotesMode: "OFF"
- op: addpath: /Resources/Rule/Properties/ScheduleExpressionTimezone# Set your timezone here as an IANA time zonevalue: "America/Chicago"
- op: removepath: /Resources/Rule/Properties/Targets
- op: addpath: /Resources/Rule/Properties/Targetvalue:
Arn: !Ref StateMachineRoleArn: !GetAtt RuleRole.Arn######################################################################################################################################################### End time zone Support #########################################################################################################################################################
Reacted by ceturc
Reacted by Wanxian Yang, Adithya Kolla, 三ツ木賢一 and Alexandre Quercia
The YAML patch is good except that CloudFormation reject resource type modification.
In next days, I will submit a pull request with
Full code coverage, from unit to integration
EventBridge Schedule that replace CloudWatch Event Rule.
UTC as default time zone
Allowing expression like 'at(2022-11-20T13:00:00)'
Resource Rule renamed to Schedule
Resource RuleRole renamed to ScheduleRole
Configurable on manifest.yml but not during job init
Reference to the documentation
# job manifest.yml# Trigger for your task.on:
# The scheduled trigger for your job. You can specify a Unix cron schedule or keyword (@weekly) or a rate (@every 1h30m)# AWS Schedule Expressions are also accepted: https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.htmlschedule: "rate(5 minutes)"# The timezone in which the scheduling expression is evaluated.# You can specify a time location like (America/New_York) or like (CET)# More details: https://docs.aws.amazon.com/scheduler/latest/UserGuide/schedule-types.html#time-zonestimezone: "UTC"
Thanks @alquerci! I'm looking forward to your PR. The work around for the issue you're running into is to delete/destroy the job then recreate it with the patch. The patch doesn't work on a job that's already been deployed, but once it's been deployed with the patch, it works as normal
Activity
efekarakus commentedon Mar 8, 2023
Hi @RaffaeleSgarro !
Your feature request makes sense to me, if anything Copilot could translate the schedule expression from one timezone to another.
The manifest could be something like:
RaffaeleSgarro commentedon Mar 9, 2023
Great! How does it work now? Do you point me to some documentation to implement it myself and send a pull request, or is it so trivial that you prefer to fix it yourself?
efekarakus commentedon Mar 9, 2023
Typically, if it's going to be implemented by the AWS Copilot team we'll need to prioritize the feature request first. We update the GitHub issues saying that the team is now picking up the feature request so that users are aware of the progress.
Unfortunately, I can't make a commitment today for a timeline for the feature. However, if you'd like to send a pull-request we'd be happy to review it!
If you'd like to contribute the feature, I believe the following changes need to happen:
Adding the
timezonefield to the manifest file:copilot-cli/internal/pkg/manifest/job.go
Lines 45 to 47 in 499bb1c
Adding validation for the new field to ensure that the string entered is a valid timezone:
copilot-cli/internal/pkg/manifest/validate.go
Lines 1550 to 1557 in 499bb1c
Convert the cron job expression from one timezone to the next here:
copilot-cli/internal/pkg/deploy/cloudformation/stack/scheduled_job.go
Line 245 in 499bb1c
(although I think the last step isn't trivial)
jas32096 commentedon Oct 11, 2023
I'd also like to see this implemented. However, just translating the expressions, before passing it to the template engine is insufficient for reoccurring jobs. The advantage of being able to select timezone is daylight savings handling.
If someone were able to rewrite the template to use AWS::Scheduler::Schedule, instead of the, currently used, AWS::Events::Rule, we'd be able to have native timezone support.
The existing template is here:
copilot-cli/internal/pkg/template/templates/workloads/partials/cf/eventrule.yml
Lines 1 to 37 in 4b8eccb
jas32096 commentedon Jan 30, 2024
I ended up using the following YAML patch overrides to support my use case. May follow up with a PR to do the work described in my comment above, if there is interest. If anyone knows, if there is a way to add support for grabbing the time zone value from the manifest yaml, please let me know.
happysiro commentedon Mar 28, 2024
Hello!!!
I am interested in this, I am trying to see if I can solve this by employing EventBridge Scheduler.
alquerci commentedon Feb 16, 2025
Hello there
I am interested in this too.
The YAML patch is good except that CloudFormation reject resource type modification.
In next days, I will submit a pull request with
Rulerenamed toScheduleRuleRolerenamed toScheduleRolemanifest.ymlbut not duringjob initcc @efekarakus
jas32096 commentedon Feb 17, 2025
Thanks @alquerci! I'm looking forward to your PR. The work around for the issue you're running into is to delete/destroy the job then recreate it with the patch. The patch doesn't work on a job that's already been deployed, but once it's been deployed with the patch, it works as normal
alquerci commentedon Feb 17, 2025
The pull request #6011