Is there a way to test AWS SAM EventBridgeRule rules in template.yaml files?

0

Is there a way to test AWS SAM EventBridgeRule rules in template.yaml files? The tool at URL https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-pattern-sandbox.html only works for JSON. Is there an equivalent tool for YAML?

Jeff
gefragt vor einem Monat87 Aufrufe
1 Antwort
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...
        }

profile picture
EXPERTE
beantwortet vor einem Monat
  • 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.

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen