i want to ask what the correct cron schedule is to run a job between 7am-8pm CST, every 2min.
This is what i have currently. I am assuming the ScheduleExpressionTimezone setting makes sure the time zone is adjusted correctly.
ScheduleEvent1:
Type: ScheduleV2
Properties:
Description: 7AM - 8PM CST - every 2 minutes everyday
Name: cron-test-every2min
ScheduleExpression: cron(0/2 7-19 * * ? *)
ScheduleExpressionTimezone: America/Chicago
but chatgpt suggests more elaborate expression as follows:
Resources:
MyScheduledFunction:
Type: "AWS::Serverless::Function"
Properties:
Handler: index.handler
Runtime: nodejs14.x
Events:
MyScheduledEventStandardTimeMorning:
Type: ScheduleV2
Properties:
ScheduleExpression: cron(0/2 13-23 * * ? *) # Runs every 2 minutes from 13:00 to 23:59 UTC (7 AM to 5:59 PM CT standard time)
MyScheduledEventStandardTimeEvening:
Type: ScheduleV2
Properties:
ScheduleExpression: cron(0/2 0-2 * * ? *) # Runs every 2 minutes from 00:00 to 02:00 UTC (6 PM to 8 PM CT standard time)
MyScheduledEventDaylightSavingTimeMorning:
Type: ScheduleV2
Properties:
ScheduleExpression: cron(0/2 12-23 * * ? *) # Runs every 2 minutes from 12:00 to 23:59 UTC (7 AM to 5:59 PM CT daylight saving time)
MyScheduledEventDaylightSavingTimeEvening:
Type: ScheduleV2
Properties:
ScheduleExpression: cron(0/2 0-1 * * ? *) # Runs every 2 minutes from 00:00 to 01:59 UTC (7 PM to 8 PM CT daylight saving time)
what is the right way to handle this? i am under the assumption ScheduleExpressionTimezone handles the timezone conversations.