Posted On: Jul 21, 2016
Amazon EC2 Run Command now supports event-driven notifications. You can now monitor the status of your commands either at fleet or instance level, and receive real-time updates. These notifications are supported by Amazon EC2 Run Command or through AWS CloudWatch Events.
If you use the EC2 Console or CLI, you can specify a Simple Notification Service (SNS) topic when you run a command. For example, you can set up SNS to receive a text message if your command has timed out, or you can use AWS Lambda to trigger a function in case an execution fails. Within AWS CloudWatch Events, you can create a rule based on a Run Command notification event and assign a target (which could be a service such as AWS Lambda, Kinesis or SNS) to trigger specific actions. Notifications you can use include in progress, success, failure, time out and cancelled. Thus, you now have two easy ways to set up event-driven messaging to ensure that you can monitor the status of any administrative tasks you can run on your instance fleet.
You can find out if Amazon EC2 Run Command and AWS CloudWatch Events are available in your region here. To know more about Amazon EC2 Run Command, please read the documentation here.