I need to have a different auto-scaling policy for weekdays vs weekend.
So far I figured out how to set up the same policy for every day. The cmd call and the CRON string look like that:
as-put-scheduled-update-group-action TNUPWN --auto-scaling-group TNASG --region us-west-2 --recurrence "30 18 * * *" --desired-capacity 1
But when I try to set a CRON string for week days only e.g.
30 7 ? * MON-FRI *
or
0 30 7 ? * MON-FRI *
I am getting the error
as-put-scheduled-update-group-action: Malformed input-Given recurrence string:30 1 ? * MON-FRI * is
invalid
Usage:
as-put-scheduled-update-group-action
ScheduledActionName --auto-scaling-group value [--desired-capacity
value ] [--end-time value ] [--max-size value ] [--min-size value ]
[--recurrence value ] [--start-time value ] [--time value ]
[General Options]
Any ideas? Is it even possible with AWS?
I think the problem is with your cron string. Try using digits (instead of day abbreviations).
Also, you could implement it this way:
Setup scheduled group action for every Friday at midnight to increase capacity.
--recurrence 0 0 * * 5 *
Setup scheduled group action for every Sunday at midnight to reduce capacity.
--recurrence 0 0 * * 7 *
This article has some sample commands with properly formatted cron strings:
http://www.newvem.com/how-to-configure-aws-cloud-auto-scaling-to-scale-based-on-a-schedule/
And here is a cron format reference:
http://www.nncron.ru/help/EN/working/cron-format.htm