- Lab
- A Cloud Guru
Launching an Autoscaling Group in AWS
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.
Path Info
Table of Contents
-
Challenge
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.
-
Challenge
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.
-
Challenge
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 theepel-release
package on your instance. - Use the command
sudo yum install stress -y
and thensudo 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.
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.