- Le plus récent
- Le plus de votes
- La plupart des commentaires
Dear Customer, Hope you are doing good!!
It seems like you're encountering an issue where the output variable name is being passed instead of its value when using a custom runbook in AWS Systems Manager (SSM).
When referencing the output variable in the subsequent steps of your custom runbook, use the correct syntax to access its value. In AWS Systems Manager Automation documents, you typically use the following syntax to access output variables: {{ OutputName.Payload.VariableName }}
.
Replace "OutputName" with the name of the output and "VariableName" with the name of the variable within that output.
In your case, the correct syntax to reference the second output variable would be: {{ AWSSupport_CopyEC2Instance.sameRegionLaunchInstanceWithoutKeyPair.InstanceIds.Payload }}
.
I am providing you a sample code for your reference
description: "Custom Runbook"
schemaVersion: "0.3"
parameters:
name: "InstanceId"
type: "String"
description: "Instance ID"
default: ""
mainSteps:
name: "Step1"
action:
actionType: "aws:executeScript"
inputs:
runCommand:
"echo 'Executing Step 1'"
name: "Step 1"
name: "Step2"
action:
actionType: "aws:executeScript"
inputs:
runCommand:
"echo 'Executing Step 2 with Instance ID: {{ InstanceId }}'"
name: "Step 2"
name: "Step3"
action:
actionType: "aws:executeScript"
inputs:
runCommand:
"echo 'Executing Step 3 with DestinationInstanceId: {{ AWSSupport_CopyEC2Instance.sameRegionLaunchInstanceWithoutKeyPair.InstanceIds.Payload }}'"
name: "Step 3"
Contenus pertinents
- demandé il y a un an
- demandé il y a un an
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a un an