Auto Scaling lifecycle hooks enable you to perform custom actions as Auto Scaling launches or terminates instances. For example, you could install or configure software on newly launched instances, or download log files from an instance before it terminates.
After you add lifecycle hooks to your Auto Scaling group, they work as follows:
- Auto Scaling responds to scale out events by launching instances and scale in events by terminating instances.
- Auto Scaling puts the instance into a wait state (Pending:Wait or Terminating:Wait). The instance remains in this state until either you tell Auto Scaling to continue or the timeout period ends. http://docs.aws.amazon.com/autoscaling/latest/userguide/lifecycle-hooks.html