Posted On: Feb 24, 2016

Auto Scaling now emits an event using Amazon CloudWatch Events when an Amazon Elastic Compute Cloud (EC2) instance is ready to execute a launch or termination lifecycle hook.

Lifecycle hooks allow you to perform customized actions on your Amazon EC2 instances during scale out (instance launch) or scale in (instance termination). 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. Now, in addition to publishing lifecycle hook notifications via Amazon Simple Queue Service (SQS) and Amazon Simple Notification Service (SNS), Auto Scaling publishes events to Amazon CloudWatch Events. Using CloudWatch Events, you can easily associate lifecycle hook events with automated responses, such as invoking an AWS Lambda function. This simplifies the process considerably, because you no longer have to manage compute resources or write code to poll an Amazon SQS queue or subscribe to an Amazon SNS topic.

There is no charge for using Auto Scaling, nor Amazon CloudWatch Events; you pay only for the underlying instances provisioned and the AWS Lambda functions invoked. To get started, call PutLifecycleHook using our API. To learn more about this feature, visit the Auto Scaling documentation.