在使用SSM Automation Document时,通过Lambda进行操作收到负载输入的验证错误,请问一般是什么原因?

0

【以下的问题经过翻译处理】 ``` 我克隆了 AWS-UpdateWindowsAMI 文档,并添加了两个步骤来调用 Lambda 函数来更新参数存储中的最新 AMI ID 和创建 EC2 tag。当我运行到 aws:invokelambdafunction 时,会出现以下错误,其他内容是正常的。

Step fails when it is validating and resolving the step inputs. Failed to resolve input: createImage.ImageId to type String. createImage is not defined in Automation Document MainSteps.. Please refer to Automation Service Troubleshooting Guide for more diagnosis details. VerificationErrorMessage Failed to resolve input: createImage.ImageId to type String. createImage is not defined in Automation Document MainSteps.

我直接从 此文档 中复制了 Lambda 函数代码。这是文档中的 updatessmparam 代码。我只在代码中替换了 parameterName。 { "name": "CreateImage", "action": "aws:createImage", "maxAttempts": 3, "onFailure": "Abort", "inputs": { "InstanceId": "{{ LaunchInstance.InstanceIds }}", "ImageName": "{{ TargetAmiName }}", "NoReboot": true, "ImageDescription": "{{ TargetImageDescription }}" } }, { "name": "TerminateInstance", "action": "aws:changeInstanceState", "maxAttempts": 3, "onFailure": "Abort", "inputs": { "InstanceIds": [ "{{ LaunchInstance.InstanceIds }}" ], "DesiredState": "terminated" } }, { "name": "updateSsmParam", "action": "aws:invokeLambdaFunction", "timeoutSeconds": 1200, "maxAttempts": 1, "onFailure": "Continue", "inputs": { "FunctionName": "Automation-UpdateSsmParam", "Payload": "{"parameterName":"/ami/latest/us-east-1/win2k19sf-cb", "parameterValue":"{{createImage.ImageId}}"}" } },

profile picture
专家
已提问 5 个月前34 查看次数
1 回答
0

【以下的回答经过翻译处理】 应该是区分大小写,并且你的步骤名称是带有大写字母“C”的“CreateImage”。如果将 updateSsmParam 的 Payload 中的值更改为 CreateImage.ImageId 是否可以?

profile picture
专家
已回答 5 个月前

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

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

回答问题的准则