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

CS50 Credit Card Validation

1  Asked on November 18, 2021


Regex Multiple Parenthases

1  Asked on November 18, 2021 by matthewproskils


can anyone explain me the background process of this code

1  Asked on November 18, 2021 by funtastic-world


How is “from” in python can copies

2  Asked on November 18, 2021 by joox


Python Iterating through List of List

3  Asked on November 18, 2021 by jaydaman


Pytest environment fixtures not seen by imported class

1  Asked on November 18, 2021 by pmdaly


Load RabbitMQ config at startup

1  Asked on November 18, 2021 by david-vasandani


OnChanged State of Checkbox in Flutter

1  Asked on November 18, 2021 by ruchita-bhaskar


json encode and decode is not working in PHP

4  Asked on November 18, 2021 by nallammal-t


Ask a Question

Get help from others!

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