hands-on lab

Working with Amazon EC2 Auto Scaling Groups and Network Load Balancer

Difficulty: Beginner
Duration: Up to 2 hours
Students: 23,779
Rating: 4.6/5
You can pause this lab for up to 1h
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

This lab introduces the basics of Auto Scaling in Amazon Web Services. The Amazon Web Services (AWS) Auto Scaling service automatically adds or removes compute resources allocated for your cloud application, in response to changes in demand. For applications configured to run on a cloud infrastructure, scaling is an important part of cost control and resource management.

Scaling is the ability to increase or decrease the compute capacity of your application either by changing the number of servers (horizontal scaling) or by changing the size of the servers (vertical scaling).

Auto Scaling helps you maintain application availability and allows you to scale your Amazon EC2 capacity up or down automatically according to the defined conditions. You can use Auto Scaling to help ensure that you are running your desired number of Amazon EC2 instances. Auto Scaling can also automatically increase the number of Amazon EC2 instances during demand spikes to maintain performance and decrease capacity during lulls to reduce costs. Auto Scaling is well suited to applications that have stable demand patterns, or that experience hourly, daily, or weekly variability in usage.

In this lab, you will create an Auto Scaling Group and place it behind a Network Load Balancing (NLB). Don't worry if you don't fully understand all the components yet. Each one will be discussed in greater detail as you create and configure them. At the end of this lab you will have an Auto Scaling Group with several web server instances behind a Network Load Balancer. 

Lab Objectives

Upon completion of this lab you will be able to:

  • Configure Auto Scaling to automatically launch EC2 instances using conditions described by CloudWatch alarms
  • Create and configure a Network Load Balancer
  • Utilize Auto Scaling and a Network Load Balancer to ensure the availability of compute resources
  • Build an elastic cluster by integrating Auto Scaling with an Elastic Load Balancer
  • Perform end-to-end testing of the system and understand how to diagnose issues

Lab Prerequisites

Although this is a beginner-level lab, you should be familiar with AWS basics including:

  • Using the AWS Management Console
  • EC2 (launching an instance, connecting to an instance via SSH)
  • Conceptual understanding of CloudWatch, and EC2 Security Groups (firewall rules)

Updates

October 11th, 2023 - Updated the instructions and screenshots to reflect the latest UI

September 20th, 2023 - Updated the instructions and screenshots to reflect the latest UI

June 5th, 2023 - Resolved AMI issue

January 6th, 2023 - Updated the instructions and screenshots to reflect the latest UI

May 16, 2022 - Updated the instructions and screenshots to reflect the latest UI

January 17th, 2022 - Updated the instructions and screenshots to reflect the latest UI

October 12th, 2021 - Updated screenshots to reflect the latest user-interface changes

September 9th, 2021 - Clarified an instruction when creating the target group

September 7th, 2021 - Added required TCP instructions for Target Groups display issue

June 16th, 2021 - Minor updates to load balancer creation instructions

June 3rd, 2021 - Updated the load balancer creation instructions to reflect the new console workflow

August 27th, 2020 - Updated screenshots to reflect the EC2 instances user interface

July 10th, 2020 - Updated all instructions and screenshots

June 24th, 2019 - Updated the instructions to mention the new UDP support for NLBs

April 26th, 2019 - Updated the commands used to install the stress binary

March 14th, 2019 - Modified the lab to use launch configuration rather than launch template to avoid misconfiguration issues

March 5th, 2019 - Updated the lab to use a Network Load Balancer and launch template and improved instruction clarity. A lab using a Classic Elastic Load Balancer, Launch Configurations, and Simple Notification Service is available here.

March 3rd, 2019 - Added a customized validation lab Step

March 1st, 2019 - Updated environment diagrams to the latest AWS icon library

January 10th, 2019 - Added a validation lab Step to check the work you perform in the lab

September 10, 2018 - Updated instructions and images to improve the lab experience

Environment before

Environment after

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Auto Scaling Overview
Creating a Launch Template
Creating a Network Load Balancer
Creating an Auto Scaling Group from a Launch Template
Testing the Auto Scaling Group from End-to-End