Lesson 43

Monitoring and Auto Scaling

Amazon CloudWatch and EC2 Auto Scaling — observing resources and automating capacity

1. Amazon CloudWatch

Amazon CloudWatch is a monitoring and observability service that monitors your AWS resources and the applications that run on AWS in real time.

CloudWatch Capabilities

  • Collect and track metrics — Standard metrics from AWS services, plus custom metrics from your own applications.
  • Alarms — Monitor any CloudWatch metric and automatically send a notification to an Amazon SNS topic, or perform an EC2 Auto Scaling or EC2 action.
  • Events — Define rules that match changes in your AWS environment and route them to targets for processing, such as Lambda functions, Kinesis streams, ECS tasks, and Step Functions.

CloudWatch Alarm Components

ComponentDescription
NamespaceContains the metric, for example AWS/EC2
MetricThe variable to measure, for example CPU Utilization
StatisticAverage, sum, minimum, maximum, sample count, or percentile
PeriodThe evaluation period for the alarm
ConditionsThreshold comparison: Greater, Greater or Equal, Lower or Equal, or Lower
ActionsSend notification to SNS, or perform EC2 Auto Scaling or EC2 action
Alarm Types: You can create alarms based on a static threshold, anomaly detection, or a metric math expression.

2. Amazon EC2 Auto Scaling

Amazon EC2 Auto Scaling helps you maintain application availability by automatically adding or removing EC2 instances according to conditions you define.

Auto Scaling Group

An Auto Scaling group is a collection of EC2 instances that are treated as a logical grouping for automatic scaling and management. You configure three key values:

  • Minimum size — The lowest number of instances the group will maintain.
  • Desired capacity — The number of instances the group should have.
  • Maximum size — The highest number of instances the group will allow.

If you specify scaling policies, EC2 Auto Scaling can launch or terminate instances as demand increases or decreases, staying within the minimum and maximum bounds.

Launch Configuration

A launch configuration is an instance configuration template that defines what you are scaling. It includes:

  • Amazon Machine Image (AMI) ID
  • Instance type
  • IAM role
  • Security groups
  • Amazon EBS volumes

Scaling Options

OptionHow It WorksBest For
Maintain current levelsPeriodically health-checks running instances. Replaces unhealthy instances automatically.Always. This is the baseline behavior.
Manual scalingYou manually change the minimum, maximum, or desired capacity.One-off changes or testing.
Scheduled scalingScaling actions run automatically based on date and time.Predictable workloads, such as weekly traffic patterns.
Dynamic scalingScaling policies respond to changing demand in real time, triggered by CloudWatch alarms.Unpredictable or variable workloads.
Predictive scalingUses machine learning on your EC2 usage data to predict traffic and scale proactively.Workloads with daily or weekly patterns. Requires at least one day of historical data.
Scale Out vs. Scale In: Launching instances is called scaling out. Terminating instances is called scaling in.

How Dynamic Scaling Works

A typical dynamic scaling configuration uses CloudWatch, EC2 Auto Scaling, and Elastic Load Balancing together:

  1. CloudWatch monitors a metric such as average CPU utilization across your EC2 fleet.
  2. When the metric breaches a threshold for a specified duration, a CloudWatch alarm triggers.
  3. The alarm runs an EC2 Auto Scaling policy that launches or terminates instances.
  4. EC2 Auto Scaling registers new instances with the load balancer.
  5. The load balancer performs health checks and begins distributing traffic to the new instances.
  6. The load balancer feeds performance metrics back to CloudWatch, completing the loop.

3. AWS Auto Scaling

AWS Auto Scaling is a separate service from Amazon EC2 Auto Scaling. It monitors your applications and automatically adjusts capacity to maintain steady, predictable performance at the lowest possible cost.

AWS Auto Scaling can build scaling plans for:

  • Amazon EC2 instances and Spot Fleets
  • Amazon ECS tasks
  • Amazon DynamoDB tables and indexes
  • Amazon Aurora Replicas
EC2 Auto Scaling vs. AWS Auto Scaling: EC2 Auto Scaling scales EC2 instances. AWS Auto Scaling is a broader service that can scale multiple resource types, including ECS, DynamoDB, and Aurora.

Monitoring and Auto Scaling Quiz

Select one answer per question. You will receive immediate feedback.

1. A company runs a web application on EC2 instances and expects traffic to spike every Monday morning. They want to add instances automatically at 6:00 AM every Monday. Which scaling option should they use?
2. An Auto Scaling group has a minimum size of 2, a desired capacity of 4, and a maximum size of 8. A scaling policy triggers and needs to add 6 instances. How many instances will the group have?
3. Which AWS service publishes metrics for your load balancers and targets, and can trigger alarms that initiate EC2 Auto Scaling actions?
4. What is the term for terminating EC2 instances in an Auto Scaling group when demand decreases?
5. A company wants to scale their Amazon DynamoDB tables and Amazon Aurora Replicas automatically from a single scaling plan. Which service should they use?
6. A company needs to track when the average CPU utilization across 100 EC2 instances exceeds 80% for 5 minutes, and then automatically add more instances. Which CloudWatch alarm component defines the "80% for 5 minutes" part?
Progress: 0/6 correct (0%). Answer all questions to see the final recommendation.
Primary Source: AWS Academy Module 10: Automatic Scaling and Monitoring — Amazon CloudWatch and EC2 Auto Scaling.
Last updated: June, 2026© 2026 Shahriar Ahmed ShovonCredits