I have a YAML file used to create an EventBridge rule. The rule calls a step-function which takes a JSON string as input. When I pass the string in using a variable, AWS CloudFormation reports an error, which seems to indicate that the quotation marks were removed from the JSON.
How do pass the JSON string into the YAML so AWS gets the correct YAML?
JSON:
{"Guid1": "d8a47ae8-50c5-4d76-937f-124d353e125f"}
Relevant YAML:
Parameters:
StepFunctionInput:
Description: The JSON input to use when triggering the step function.
Type: String
ScheduledRule:
Type: AWS::Events::Rule
Properties:
RoleArn: !GetAtt Role.Arn
ScheduleExpression: !Sub cron(0/${StartupIntervalMinutes} * * * ? *)
State: ENABLED
Targets:
- Arn: !Ref StepFunctionArn
Id: StepFunctionV1
Input: !Ref StepFunctionInput
AWS Error:
JSON syntax error in input for target StepFunctionV1: [Source: (String)"{Guid1: d8a47ae8-50c5-4d76-937f-124d353e125f}"; line: 1, column: 3] (Service: AmazonCloudWatchEvents; Status Code: 400; Error Code: ValidationException; Request ID: 71520ea5-d959-495a-b89f-dbc812f78e59; Proxy: null)
Putting the JSON directly in the YAML (instead of passing it in through a variable) works:
Input: '{"Guid1": "d8a47ae8-50c5-4d76-937f-124d353e125f"}'