Pass the message from event bus to ECS task using Event Rule

0

I am trying with the Input parameter in the CFT. But its saying its not a

Resource handler returned message: "JSON syntax error in input for target

This is my event Pattern which is able to trigger the ECS task when I send someting starting with "trig". Samething I want to print in the file.

{ "detail": { "messageAttributes": { "operation": { "stringValue": [{ "prefix": "trig" }] } } } }

I am using input parameter

"Input": "$.detail.messageAttributes.operation.stringValue"

It would be great if you could help me with this

2 Answers
1

Take a look at your template and validate the syntax. Here is a article that walks through several examples. In your case, take a look under Confirm that Conditions is specified as a string in CFT Template Validation

AWS
AWS-SD
answered 6 months ago
0

You are passing a collection of map types. However, that is not a valid type for cloud formation parameter values. String value is going to need to be comma separated list of strings, if I understand what you are trying to do.

See here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html

answered 6 months ago
  • My doubt was how to pass the message using event rule, when source is SQS and target is an ECS task. In event rule, there are three fields Input, InputPath, InputTransformer but I am not sure how to use any of these I didn't find any example in documentation. According to defintion I implemented Input parameter in CFT "Input": "$.detail.messageAttributes.operation.stringValue" to get this particular value from the event received in event bus.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions