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
审核人员
已提问 4 年前409 查看次数
1 回答
0
已接受的回答

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
专家
已回答 4 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则