Auto Scaling provides elasticity to your applications by providing variable numbers of resources (e.g. EC2 instances) when you need them, and then cooling down and releasing excess capacity when they are not needed.
Auto Scaling has three types of scaling:
- manual scaling – you manual go in and change the configuration – min & max EC2 instances etc.
- scheduled scaling – e.g. month end
- dynamic scaling – lets you dynamically control allocated resources with a scaling policy you define
Auto Scaling can be generated by AWS CloudWatch.
Auto Scaling Components Auto Scaling has several components that need to be configured to work properly:
- A launch configuration
- An Auto Scaling group
- Optional scaling policy
Auto Scaling defines a launch configuration to define how and when to create new instances. A launch configuration is composed of the configuration name, Amazon Machine Image (AMI), Amazon EC2 instance type, security group, and instance key pair.
The minimum information you must supply to create a launch configuration is: Launch configuration name, Amazon Machine Image (AMI), and instance type
An Auto Scaling group can have only one launch configuration at a time.
Manual Auto Scaling
Manually change your auto scaling launch configuration and or auto scaling group
Scheduled Auto Scaling
Just like it sounds – you create a schedule
Dynamic Auto Scaling
Dynamic Auto Scaling is performed by associating Amazon CloudWatch alarms and scaling policies with an Auto Scaling group.
Amazon CloudWatch sends alarms when a threshold is reached to scale in or out the number of Amazon EC2 instances currently receiving traffic behind a load balancer.
After the Amazon CloudWatch alarm sends a message to the Auto Scaling group, Auto Scaling executes the associated policy to scale your group. The policy is a set of instructions that tells Auto Scaling whether to scale out, launching new Amazon EC2 instances referenced in the associated launch configuration, or to scale in and terminate instances.
Auto Scaling Service Limits
Auto Scaling may cause you to reach limits of other services, such as the default number of Amazon EC2 instances you can currently launch within a region, which is 20.
Keep in mind there are service limits for all AWS Cloud services you. Call Amazon to increase limits.
aws autoscaling describe-account-limits
Use aws configure before using the command above to set your region
e.g. default region name: us-west-1