An Auto Scaling group of On-Demand EC2 instances processes messages from an SQS queue. Each message can take up to 12 hours to finish processing. The Auto Scaling group scales based on the queue length. How should the SysOps administrator prevent in-flight message processing from being interrupted by instance termination?
Choose an answer
Tap an option to check your answer.
Correct answer: At the start of processing, call the EC2 Auto Scaling API from the worker script to enable instance scale-in protection for that instance; after processing finishes, call the API again to disable scale-in protection..
Why this is the answer
The correct solution is to enable instance scale-in protection when a message starts processing and disable it when processing finishes. This prevents the Auto Scaling group from terminating an instance while it's actively processing a long-running message, ensuring the task completes without interruption. Scale-in protection specifically prevents an instance from being terminated during a scale-in event. Changing the termination policy to OldestInstance or OldestLaunchConfiguration does not prevent the termination of an instance that is actively processing a message; it only changes which instance is terminated first. Suspending Launch and Terminate scaling processes for a specific instance is not a valid or practical approach for individual instances within an Auto Scaling group; these processes apply to the group as a whole.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed