1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
Since the type of "EventPattern" is JSON, how about embedding the JSON as is and creating a template after testing the event rule?
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-events-rule.html#cfn-events-rule-eventpattern
Resources:
EventRule:
Type : "AWS::Events::Rule"
Properties:
EventPattern:
{
example_event...
}
Relevant content
- Accepted Answerasked 4 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Perhaps I was not clear in my problem statement; the event pattern is YAML not JSON. My AWS SAM template is YAML. I currently convert my YAML to JSON using a tool like https://onlineyamltools.com/convert-yaml-to-json and paste the JSON output into the EventBridge sandbox, but that is a kludge. My question is; Does a tool exist to test YAML event patterns?
The AWS CLI has a command called "aws events test-event-pattern", but this can only be used with JSON, so I don't think there is currently an official AWS method to check event patterns with YAML. So, I think you can save yourself the trouble of converting by embedding the JSON event pattern in the YAML template as I suggested.