1 Answer
- Newest
- Most votes
- Most comments
0
It turns out that:
- SSM Automation does expect Strings to be passed in inside brackets, as if it were an array
- The error
Failed to resolve input: InstanceId to type StringList. InstanceId is found to be of type String.
relates to theInstanceIds
parameter onRunCommandOnInstances
, not an issue when invoking the Automation with that parameter.
The fix was thus:
{
"InstanceId": ["<InstanceId>"],
"Role": ["<Role>"]
}
schemaVersion: '0.3'
parameters:
InstanceId:
type: StringList
Role:
type: String
assumeRole: '{{ Role }}'
mainSteps:
- name: RunCommandOnInstances
action: aws:runCommand
isEnd: true
inputs:
DocumentName: AWS-RunPowerShellScript
Parameters:
commands:
- echo "hi"
InstanceIds: '{{ InstanceId }}'
answered 8 months ago
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
For the avoidance of doubt, the JSON input passed through to the DLQ is always valid JSON - neither InstanceId nor Role contain any quotes. And interestingly, if I use constants instead of an input transformer in the Console, it ends up wrapping whatever I put in in a JSON array...