How can I create alarms or notifications for when an Amazon EMR cluster or step changes state?
Last updated: 2020-11-12
I want to get a notification when my Amazon EMR cluster or step changes state. How can I accomplish this with Amazon CloudWatch?
CloudWatch doesn't have metrics for monitoring Amazon EMR step or cluster state changes, but you can use Amazon CloudWatch Events to accomplish this task.
When you create a CloudWatch Events event, you choose a target, such as an Amazon Simple Notification Service (Amazon SNS) topic. The target triggers when a specified event occurs, such as when a cluster state changes. For more information about the Amazon EMR events that you can use to create a CloudWatch Events event, see Monitor CloudWatch Events.
To create a CloudWatch Events rule that sends an SNS message when an Amazon EMR cluster or step changes state:
- Create an SNS topic. This topic is the target for the CloudWatch Events rule.
- Follow the steps for Creating a CloudWatch Events rule that triggers on an event.
For Service Name, choose EMR.
For Event Type, choose State Change.
For Targets, select SNS topic, and then choose the topic that you created in step 1.
Note: You can choose more than one target per rule. For example, you can perform an AWS Lambda function, send an SNS notification, and send a message to an Amazon Simple Queue Service (Amazon SQS) queue at the same time, in the same rule.
If the CloudWatch Events rule doesn't behave as expected, see Troubleshooting CloudWatch Events.