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.