Amazon EC2 Auto Scaling

STOP Please note: This workshop version is now deprecated, and an updated version has been moved to AWS Workshop Studio. This workshop remains here for reference to those who have used this workshop before for reference only. Link to updated workshop is here: Efficient and Resilient Workloads with Amazon EC2 Auto Scaling.

Amazon EC2 Auto Scaling helps you maintain application availability and allows you to dynamically scale your Amazon EC2 capacity up or down automatically according to conditions you define. You can use Amazon EC2 Auto Scaling for fleet management of EC2 instances to help maintain the health and availability of your fleet and ensure that you are running your desired number of Amazon EC2 instances. about Amazon EC2 Auto Scaling and the several ways to configure scaling policies for your application.

You have decided to leverage EC2 Auto Scaling to scale your application efficiently. To start, you create an EC2 Auto Scaling group without any Auto Scaling policies.

  1. In Cloud9 IDE terminal, check you’re at this directory ec2-spot-workshops/workshops/efficient-and-resilient-ec2-auto-scaling.
  2. You create an Auto Scaling group using asg.json configuration file, open the file to review the configuration.
    cat ./asg.json
    
  3. Create the auto scaling group using below command. This command does not return any output if it is successful.
    aws autoscaling create-auto-scaling-group --cli-input-json file://asg.json
    
  4. Then run this command to enable CloudWatch metrics collection for the Auto Scaling group, which will help you in monitoring the capacity in the group.
    aws autoscaling enable-metrics-collection \
     --auto-scaling-group-name ec2-workshop-asg \
     --granularity "1Minute"
    
  5. Browse to the Auto Scaling console and check out your newly created auto scaling group. At this step of the workshop, the auto scaling group will have no instances running, as the desired number of instances is set to 0.

Challenge

Do you know different ways to scale the capacity of your Auto Scaling group?

Go to Scale the size of your Auto Scaling group documentation page for more information.

Show answers