deitch / aws-asg-roller

Manage rolling upgrades for AWS autoscaling groups
Apache License 2.0
57 stars 17 forks source link

Adds support to increase ASG max to accommodate desired count #36

Closed outofcoffee closed 4 years ago

outofcoffee commented 4 years ago

This adds support to increase ASG max to accommodate desired count.

Currently the README implies that the roller will:

Modify the min, max and desired parameters of an ASG

However, in the case where the desired is higher than the max, the roller will fail.

This PR adds an explicit log and fail case, as well as adding an new behaviour to raise the ASG max, if the ROLLER_CAN_INCREASE_MAX environment variable is set to true.

Coverage is improved to include tests for successful and failed changes to the max value, as well as an additional test for when updates are complete.

Logs

The new (verbose only) logs for changing the max look like this:

increasing ASG my_asg_name max size to 3 to accommodate desired count
...
increased ASG my_asg_name max size to 3 to accommodate desired count

If the option is disabled, then the following explicit error is logged:

unable to increase ASG my_asg_name desired size to 3 as greater than max size 2