IoT Events custom payload error

0

I'm trying to use IoT Events custom payload with Lambda action. When I pass a JSON list format data from input and use it in the Lambda Action with JSON payload the following error occurs:

We couldn't evaluate your expression for the action. Make sure that the variable names, input names, and paths to the data refer to the existing variables and input values. Note that the maximum allowable size of the payload is 1KB.

input json

{
	"thingname": "test device",
	"status": [
          {
              "device1": "normal"
          },
          {
              "device2": "error"
          }
        ]
}

custom payload for Lambda

"{\"thingname\": \"${$input.inputname.thingname}\", \"device_status\": ${$input.inputname.status}}"

Does the custom payload not support JSON data? Or am I missing something?

AWS
MODERATOR
asked 4 years ago407 views
1 Answer
0
Accepted Answer

Not having tested it but quick guess: $input.inputname.status is a list. Might be a list is not considered to be a datum.

Try the following:

{
    "thingname": "test device",
    "status": "somestatus"
}
AWS
EXPERT
answered 4 years ago

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