Courses / AWS
90. Auto Scaling lifecycle hooks
Using Auto Scaling lifecycle hooks to run automation during instance launch and termination.
AWS / Infrastructure as Code
Auto Scaling lifecycle hooks
A way to pause EC2 instances during launch or termination so you can run custom automation before they become healthy or are destroyed.
"I need my instance to finish its bootstrapping or upload logs before AWS marks it ready or terminates it."
Lifecycle hooks let an Auto Scaling Group suspend instance lifecycle transitions (launch or terminate) and notify a target (SNS, SQS, or EventBridge) so you can run scripts or cleanup work, then complete the transition.
"I need my instance to finish its bootstrapping or upload logs before AWS marks it ready or terminates it."
Lifecycle hooks let an Auto Scaling Group suspend instance lifecycle transitions (launch or terminate) and notify a target (SNS, SQS, or EventBridge) so you can run scripts or cleanup work, then complete the transition.