The Payload parameter for Lambda must be valid JSON

0

I have a Maintenance Window which runs a Lambda as one of the Tasks. Within the Task i have specified the Payload as "{{RESOURCE_ID}}". This is so that the Lambda can execute against the instance list within a defined Resource Group. This Resource Group is defined within the Maintenance Window Targets page. This all works fine....

I'm now trying to build this using a cloudformation template with the Lambda task details within "AWS::SSM::MaintenanceWindowTask". The problem i'm having is that i've tried various formats of entering the Payload information under... "TaskInvocationParameters: "MaintenanceWindowLambdaParameters:"

... but i'm not able to successfully load the template. It keeps failing with "The Payload parameter for Lambda must be valid JSON" The AWS docs specify that the Payload data needs to be converetd to Base64. I've tried the following formats which have all failed with the same message....

Payload: !Base64 '{"instanceId": ["{{RESOURCE_ID}}"]}'

Payload: !Base64 {"instanceId": ["{{RESOURCE_ID}}"]}
Payload: !Base64 '{{RESOURCE_ID}}'
Payload: {"Fn::Base64" : "{{RESOURCE_ID}}"}
Payload: "{{RESOURCE_ID}}"
Payload: !Base64 '{"instanceId": "{{RESOURCE_ID}}"}'

Any ideas where i'm going wrong?

Kal
已提问 1 年前192 查看次数
1 回答
0

Have you tried passing the value from Cloudformation by using the Fn::Base64?

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-base64.html

AWS
vtjean
已回答 1 年前

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

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

回答问题的准则

相关内容