AWS Certified Solutions Architect Professional SAP-C02 Practice Question
Your company runs a batch-processing service on Amazon EC2 instances that are managed by an Auto Scaling group (ASG) spanning two Availability Zones. Each worker instance polls an Amazon SQS queue and may process a single job for up to 25 minutes. The operations team has several reliability requirements. First, when the average CPU utilization of the ASG rises above 70 percent for two consecutive 1-minute periods, new instances must start launching within 90 seconds to prevent the queue backlog from growing. Second, after an instance has begun processing a job, the ASG must allow up to 30 minutes for that instance to finish before it can be terminated by a scale-in event. Finally, the scaling configuration should require minimal ongoing manual tuning as traffic patterns change.
Which combination of actions will meet these requirements?
Enable detailed monitoring on the ASG. Create a target tracking scaling policy that maintains 70 percent average CPU utilization and sets Instance warm-up = 90 seconds. Add an EC2 Auto Scaling lifecycle hook on the autoscaling:EC2_INSTANCE_TERMINATING transition with a 1,800-second heartbeat timeout; have each instance call CompleteLifecycleAction when its current job finishes.
Create a step scaling policy that adds instances when CPU exceeds 70 percent. Set EstimatedInstanceWarmup = 90 seconds and configure the ASG's default cooldown to 1,800 seconds. Do not use lifecycle hooks.
Turn on instance scale-in protection for all new instances at launch. Use a scheduled AWS Lambda function to remove protection after 30 minutes. Configure a simple scaling policy that launches two instances when CPU exceeds 70 percent with the default 300-second cooldown.
Enable predictive scaling on the ASG to forecast capacity needs. Add a target tracking policy but disable scale-in for 30 minutes after every scale-out event. Rely on an alarm that tracks the SQS queue depth to trigger additional scale-out if necessary.
A target tracking scaling policy adapts automatically to workload changes, eliminating the need to constantly retune multiple alarm thresholds. By setting the policy's instance warm-up time to 90 seconds, the ASG can begin a scale-out activity almost immediately after the CloudWatch alarm is triggered, yet it ignores metrics from the still-initializing instances so that additional scale-out events are not suppressed.
Adding an EC2 Auto Scaling lifecycle hook on the autoscaling:EC2_INSTANCE_TERMINATING transition puts each instance into the Terminating:Wait state before it is actually shut down. The heartbeat timeout can be set to 1,800 seconds (30 minutes). During that window the instance's shutdown script-or an external controller-calls CompleteLifecycleAction when the current job is finished, ensuring that no in-flight work is lost. If the job completes sooner, the instance terminates early; if it does not finish, the hook simply times out after 30 minutes and the termination proceeds.
The other options do not fully satisfy the requirements:
Step scaling with a long default cooldown (or predictive or simple scaling) does not guarantee that each new instance gets 30 minutes to finish its work, and step or simple scaling requires more manual tuning of metric thresholds.
Relying solely on instance scale-in protection or scheduled Lambdas adds operational overhead and still leaves the risk of premature termination if protection is removed too early.
Predictive scaling plus disabled scale-in can keep excess capacity running and may not react within the required 90-second window.
Therefore, the combination of a target tracking policy with a 90-second instance warm-up and a termination lifecycle hook with a 30-minute heartbeat timeout best meets all objectives.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is an EC2 Auto Scaling lifecycle hook?
Open an interactive chat with Bash
How does a target tracking scaling policy work?
Open an interactive chat with Bash
What is the difference between cooldown and warm-up in Auto Scaling?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Design for New Solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access