When an Auto Scaling group terminates an instance, in-flight uploads must finish and a cleanup script must run before the instance dies. Which feature holds the instance in a wait state for this?
A.Termination protection
EC2 termination protection prevents termination entirely — the ASG needs it to happen.
B.Auto Scaling lifecycle hooks
Correct. Lifecycle hooks are designed for pre-termination custom actions.
C.ELB connection draining
Draining handles LB connections, not arbitrary cleanup work like file uploads.
D.Scale-in protection on the ASG
Scale-in protection blocks termination — it doesn't run a graceful-shutdown sequence.
Why this answer
Lifecycle hooks pause an instance in Terminating:Wait, running your custom action (upload drain, SSM command, Lambda) until a timeout or completion signal — then termination proceeds. Connection draining only waits for existing load-balanced requests.
Correct answer: B · Last reviewed 2026-11-01
Official AWS references
Practice this interactively
Answer without seeing the solution first in the High Availability practice session.
Practice High Availability