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 ...

Get AWS Administration Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.