Lifecycle hooks allow you to control what happens when your Amazon EC2 instances are launched and terminated as you scale out and in.
For example, you might download and install software when an instance is launching, and archive instance log files in Amazon Simple Storage Service (S3) when an instance is terminating.
Scaling-out
- The Auto Scaling group responds to a scale-out event and begins launching an instance.
- The lifecycle hook puts the instance into a wait state (Pending:Wait) and then performs a custom action. The instance remains in a wait state either until you complete the lifecycle action using the complete-lifecycle-action
- The instance enters the InService state and the health check grace period starts.
References