Scaling EC2 Using SQS

45 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this scenario, you’re a solutions architect at an e-commerce firm. The company runs flash sales from time to time, and when there’s a spike in orders, the fulfillment backend can struggle to meet demand. One way to solve the problem is to overprovision EC2 instances in the fulfillment system to provide headroom to process all the orders. However, this can be very costly, since you’ll have unused capacity when the traffic subsides. What if there’s a better way? Well, there is, and this is the problem you’ll solve here. In this lab, you will learn to create Auto Scaling rules for EC2 based on the number of messages in an SQS queue.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create CloudWatch Alarms

Create scale-out and scale-in alarms using the SQS ApproximateNumberOfMessagesVisible metric.

Create Simple Scaling Policies

Create scale-out and scale-in policies using the two CloudWatch alarms.

Observe the Auto Scaling Group’s Behavior in CloudWatch

Use CloudWatch metrics to observe the behavior of the SQS ApproximateNumberOfMessagesVisible metric over time.

Additional Resources

Log in to the AWS Management Console using the credentials provided, and make sure you are in the N. Virginia (us-east-1) region throughout the lab.

Note: It can take a few minutes before AWS populates the metrics in CloudWatch.

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?