
Answer-first summary for fast verification
Answer: Create an EC2 Auto Scaling group. Select the existing ALB as the load balancer and the existing target group as the target group. Set a target tracking scaling policy that is based on the ASGAverageCPUUtilization metric. Set the minimum instances to 2, the desired capacity to 3, the maximum instances to 6, and the target value to 50%. Add the EC2 instances to the Auto Scaling group.
## Explanation **Option B is the correct answer** because it provides a comprehensive, automated solution that meets all requirements: ### Why Option B is correct: 1. **Automated scaling**: The target tracking scaling policy based on ASGAverageCPUUtilization metric will automatically scale the Auto Scaling group up or down based on CPU utilization. 2. **Cost optimization**: By setting a target value of 50% CPU utilization, the solution ensures instances are efficiently utilized without being over-provisioned. The minimum of 2 instances ensures baseline capacity during low usage periods. 3. **Handles surges**: The maximum of 6 instances allows scaling up to handle CPU surges up to 65%. 4. **Proper integration**: Uses the existing ALB and target group, maintaining the current load balancing setup. 5. **Automatic management**: No manual intervention required - scaling happens automatically based on metrics. ### Why other options are incorrect: **Option A**: - Only scales down (terminates instances) but doesn't scale up to handle surges - Uses Lambda for scaling which is less efficient than Auto Scaling policies - Doesn't optimize cost effectively as it only reduces capacity but doesn't increase it when needed **Option C**: - Creates an Auto Scaling group but lacks scaling policies - Without scaling policies, instances won't scale automatically based on CPU utilization - Manual intervention would still be required to handle surges **Option D**: - Requires manual intervention (logging in to adjust instance count) - Not automated, which violates the requirement to "automate the scalability" - Email-based notifications are too slow for handling rapid surges - Doesn't provide real-time scaling response ### Key AWS Concepts: - **EC2 Auto Scaling**: Automatically adjusts the number of EC2 instances based on demand - **Target Tracking Scaling Policies**: Maintains a specific metric at a target value (e.g., 50% CPU utilization) - **ASGAverageCPUUtilization**: The average CPU utilization across all instances in the Auto Scaling group - **Application Load Balancer (ALB)**: Distributes traffic to healthy instances in the target group This solution ensures the application has enough CPU resources during surges while optimizing costs by scaling down during low utilization periods.
Ultimate access to all questions.
No comments yet.
Author: LeetQuiz Editorial Team
A company deploys an application on five Amazon EC2 instances. An Application Load Balancer (ALB) distributes traffic to the instances by using a target group. The average CPU usage on each of the instances is below 10% most of the time, with occasional surges to 65%. A solutions architect needs to implement a solution to automate the scalability of the application. The solution must optimize the cost of the architecture and must ensure that the application has enough CPU resources when surges occur. Which solution will meet these requirements?
A
Create an Amazon CloudWatch alarm that enters the ALARM state when the CPUUtilization metric is less than 20%. Create an AWS Lambda function that the CloudWatch alarm invokes to terminate one of the EC2 instances in the ALB target group.
B
Create an EC2 Auto Scaling group. Select the existing ALB as the load balancer and the existing target group as the target group. Set a target tracking scaling policy that is based on the ASGAverageCPUUtilization metric. Set the minimum instances to 2, the desired capacity to 3, the maximum instances to 6, and the target value to 50%. Add the EC2 instances to the Auto Scaling group.
C
Create an EC2 Auto Scaling group. Select the existing ALB as the load balancer and the existing target group as the target group. Set the minimum instances to 2, the desired capacity to 3, and the maximum instances to 6. Add the EC2 instances to the Auto Scaling group.
D
Create two Amazon CloudWatch alarms. Configure the first CloudWatch alarm to enter the ALARM state when the average CPUUtilization metric is below 20%. Configure the second CloudWatch alarm to enter the ALARM state when the average CPUUtilization metric is above 50%. Configure the alarms to publish to an Amazon Simple Notification Service (Amazon SNS) topic to send an email message. After receiving the message, log in to decrease or increase the number of EC2 instances that are running.