How it works...

This example defines an auto scaling group and the dependent resources. These include the following:

  • A launch configuration to use when launching new instances
  • Two scaling policies, one to scale the number of instances up, and an inverse policy to scale back down
  • An alarm to alert when the CPU crosses a certain threshold, for a certain number of minutes

The auto scaling group and launch-configuration resource objects in this example use mostly default values. You will need to specify your own SecurityGroups and a KeyName parameter in the LaunchConfiguration resource configuration if you want to be able to connect to the instances (for example, via SSH).

AWS will automatically take care of spreading your instances evenly over the subnets you have configured, so make sure they are in different AZs! When scaling down, the oldest instances will be removed before the newer ones.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset