1

I'm using Auto Scaling groups which works pretty fine with some custom rules I've set, but I also noticed that I need to set the minimum values of servers to a certain, higher, amount every first Sunday of each month (we have an increase in requests at that period).

I saw the Scheduled actions in the "Automatic scaling" tab, but it does not appear to be possible to set longer than per week, even less setting something like "every first Sunday of each months".

Is this something possible in another way ? Maybe via some Cloudwatch settings with custom "cron" tasks? I'm not sure here.

halfer
  • 19,824
  • 17
  • 99
  • 186
Cyril N.
  • 38,875
  • 36
  • 142
  • 243

2 Answers2

3

You don't need to use an external service or a Lambda to do it. You can do it in the advance tab in AutoScaling option in AWS.

For your particular case, your crontab expression would be 0 14 ? * 1#1 * See the image below, it will be triggered every first Sunday of the month.

Edit: It only works in Event bridge cron expression.

Cron expression

Juan Fontes
  • 738
  • 3
  • 16
  • The `0 14 ? * 1#1 *` is not accepted on AWS Autoscaling. "Given recurrence string: 0 14 ? * 1#1 * is invalid". Do you know how to make it work ? – Cyril N. Oct 12 '21 at 08:50
  • uh, really? let me double check. – Juan Fontes Oct 12 '21 at 08:53
  • sorry, Cyril. I spent hours trying to solve this but I couldn't, the crontab in autoscaling is very limited, I got confused about event bridge and autoscaling, you can remove the +50, no worries. – Juan Fontes Oct 12 '21 at 12:22
2

You can create a different timer (e.g. for lambda called every morning/hour/whatever) and scale-up the scaling group from there if its the first sunday of the month.

gusto2
  • 11,210
  • 2
  • 17
  • 36