I have a SSM document which has its first step to call a Lambda function (getLaunchTemplateData) using "action 'aws:invokeLambdaFunction'".
The lambda function returns a set of data which is displayed on the "Output payload" on that steps results....
{
"Payload": {
"LaunchtemplateID": "lt-00972d7c12345678a"
},
"StatusCode": 200
}
I'd like to use that output data for a step further below in the document. How can this be achieved?
I have tried adding the "outputs" tag on the 1st step using..
outputs:
- Name: LaunchtemplateID
Selector: $.Payload.LaunchTemplateID
Type: String
Then using this as the payload for the next step which is another Lambda function...
Payload: '{ "LTID": "{{ getLaunchTemplateData.LaunchtemplateID }}" }'
but i receive this message...
{"FunctionError":"Unhandled","Payload":{"errorMessage": "An error occurred (InvalidLaunchTemplateId.Malformed) when calling the CreateLaunchTemplateVersion operation: The specified launch template ID '{{ getLaunchTemplateData.LaunchtemplateID }}' is malformed."
The Input parameters for the step that fails is not picking up the values..
"{"LTID":"{{ getLaunchTemplateData.LaunchtemplateID }}"}"
Great! My pleasure!