Launching an Autoscaling Group in AWS

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Your team needs to test the durability of the web server they want to serve to traffic. They have tasked you to set up automation that will allow your servers to scale out based on traffic needs. Your objective is to complete this using direct AWS services to test to make sure the architecture will work.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Launch Template
  • In the navigation pane under EC2, choose Launch Template.
  • Select Create Launch Template.
  • Name your launch template acloud.
  • Under Application and OS Images (Amazon Machine Image), choose the Amazon Linux OS and then the Amazon Linux 2 ami.
  • Under Instance type, choose t2.micro.
  • Under Key Pair, click Create a key pair, name your key pair, and click Create key pair.
  • Under Network Settings, choose a subnet.
  • Click Create security group, name the group, and click on Add security group rule. For Source type, choose Anywhere
  • Click Create launch template.
Create an Autoscaling Group
  • On the navigation pane, under EC2, choose Auto Scaling Groups.
  • Click Create Auto Scaling group.
  • Name your group for the launch template acloud-asg.
  • Under Network, choose your VPC and AZ .
  • Under Configured Advanced Options, choose No Load Balancer and 60 seconds for Health check grace period. Under Monitoring, choose Enable group metrics collection within CloudWatch.
  • Under group size for Maximum capacity, choose 3.
  • Under Scaling policies, choose Target Tracking Policy, and set the CPU Utilization metric to 50.
  • Click Create Auto Scaling group.
Stress Your Auto Scaling Group
  • Select the instance and choose Connect.
  • Choose EC2 Instance Connect, and verify the user name. Choose Connect to open a terminal window.
  • Run sudo amazon-linux-extras install epel -y to install the epel-release package on your instance.
  • Use the command sudo yum install stress -y and then sudo stress --cpu 2 --timeout 500 to stress your instance.
  • After eight minutes, you should see your instance scale to the maximum capacity of three instances.

Additional Resources

Your team needs to test the durability of the web server they want to serve to traffic. They have tasked you to set up automation that will allow your servers to scale out based on traffic needs. Your objective is to complete this using direct AWS services to test to make sure the architecture will work.

To accomplish this, you will need to:

  • Create a launch template.
  • Create an Autoscaling group with a min of 1 and max of 3.
  • Stress and test the Auto Scaling group to ensure that the scaling policy works.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?