When to use AutoScalingScheduledAction when using UpdatePolicy for ASG using CloudFormation template?

Stack Overflow Asked by mac187 on December 13, 2020

can anyone please explain me this a little bit? I will be very happy for some example? Maybe a dummy example hehe. I want to really understand when and why to use this with a good example 🙂

Thank you 🙂

2 Answers

The AutoScalingScheduledAction is used when you are updating your AWS::AutoScaling::AutoScalingGroup in CloudFormation.

Generally, when you have scheduled policies on you ASG, number of instances will go up and down based on the schedule in the policy. When you update your stack with ASG, CloudFormation will use the group size that is defined in the template. This is of course problematic, because your scheduled policy could be in effect and your ASG may be greater or smaller that what is in the template. Thus, the update will force the ASG to go back to its original size, which may be not desired.

AWS CloudFormation always sets the group size property values of your Auto Scaling group to the values that are defined in the AWS::AutoScaling::AutoScalingGroup resource of your template, even if a scheduled action is in effect.

To rectify the issue, you can use IgnoreUnmodifiedGroupSizeProperties with value of true. This ensures that when your ASG gets updated, the ASG size is not going to be changed and the ASG size based on the scheduled policy will be preserved.

Correct answer by Marcin on December 13, 2020

A scheduled action is used if you want specific capacities during certain times of the day, week or month. By using this you can define the minimum and maximum capacities based on either a cron expression (which will trigger recurrences) or specifying a start date time which would provide this action at a specific date time.

An example might be a test environment for your application, you only want it to run during your core business hours but evenings and weekends you want it to be either lower server capacity or maybe even zero. This would use an expression.

Another example might be planned maintenance, during this time you want to reduce your server pool size as there will be no traffic hitting your applications. You would specify a specific date.

Remember that you would need a policy for each action, so if it needs to change and then revert back to its previous state it will be 2 seperate actions.

This should only be used for fixed patterns, if it is to be based on predictive traffic you would look at predictive scaling.

Answered by Chris Williams on December 13, 2020

Add your own answers!

Related Questions

How Can I Not Double Count Rows And Objects In My Query?

3  Asked on November 22, 2021 by ziegler199


Login with active directory

0  Asked on November 20, 2021 by artisan


External CSS not linking for all elements

1  Asked on November 20, 2021 by stratos-la


Why is ‘u{1D11E}’.charAt(0) not equal to ‘u{1D11E}’?

2  Asked on November 20, 2021 by json-prime


E: Unable to locate package python3-boto3

2  Asked on November 20, 2021 by rosi-darmawati


x and o in tic tac toe keeps alternating

0  Asked on November 20, 2021 by channee-mathmath


Remove using a button

2  Asked on November 20, 2021 by gastn


remove 0 and add ‘ ‘ in every number in pandas

1  Asked on November 20, 2021 by spt-hsb


nav-tabs doesn’t change on click

0  Asked on November 20, 2021 by beureu


Stick element on bottom on page scroll

3  Asked on November 20, 2021


Exchange each 100 in a dataframe for another value

1  Asked on November 20, 2021 by tarik-benrabah


GraphQL & Using a nested subscribe function

1  Asked on November 20, 2021 by u-rogel


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir