Using customized JSON event patterns - Common use cases - AWS User Notifications

Using customized JSON event patterns - Common use cases

You can further filter event rules by customizing event patterns. This topic includes JSON samples for commonly used event patterns and additional information on the EventBridge console's rule builder.

JSON samples for common use cases

CloudWatch alarm that specifies that alarmName must exist

{ "detail": { "alarmName": [ { "exists": true } ] } }

Amazon EC2 instance state changed to "terminated", "stopping", "stopped", or "shutting-down."

{ "detail": { "state": ["terminated", "stopping", "stopped", "shutting-down"] } }

Using the EventBridge console's rule builder

For more help building rules, you can use the EventBridge console's rule builder when creating Event Patterns. Use the Event Pattern Builder and the in-place tester to try out your patterns.

Note

You can test rules in the Pattern Builder without creating them.

While testing, remove the source and detail type fields from the event pattern you create.