The Auto Scaling lifecycle
When you put an EC2 instance into an ASG, it follows a particular path that a normal EC2 instance you initiate via the command line or the AWS Management Console does not follow. The instance starts by being launched by the ASG. If this is part of a scale-out event, then the instance has an opportunity to have special commands be performed on it via a lifecycle hook. Lifecycle hooks allow you to add custom actions when either launching or terminating instances that are part of an ASG. Once the instance becomes healthy, it is then InService and is part of the ASG. If that instance fails the set number of health checks, the instance can then go to a Terminating state. Moving to a Terminating state can also happen if there is not enough traffic or metric data to support having the number of instances currently running, in which case there could be a scale-in event. Once again, just as with a scale-out event, this scale-in event allows us to use a lifecycle hook...