I'm building an automation document in which I need to trigger the AWS-StartEC2Instance document and target a tag. When I execute in the console, I get this error:
Step fails when it is validating and resolving the step inputs. Failed to convert Targets to type java.util.ArrayList<com.amazonaws.services.simplesystemsmanagement.model.Target>. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.
description: Testing
schemaVersion: '0.3'
assumeRole: 'arn:aws:iam::999999999999:role/my-iam-role'
mainSteps:
- name: Startup
action: 'aws:executeAutomation'
inputs:
DocumentName: AWS-StartEC2Instance
DocumentVersion: $DEFAULT
TargetParameterName: InstanceId
Targets:
- Key: 'tag:my-tag'
Values: my-tag-value
I can do this in command line and it works
aws ssm start-automation-execution \
--document-name AWS-StartEC2Instance \
--targets Key=tag:my-tag,Values=my-tag-value \
--target-parameter-name InstanceId \
--parameters "AutomationAssumeRole=arn:aws:iam::999999999999:role/my-iam-role"
Is this a bug, or what am I doing wrong? Stumped.
Awesome. That got it working. Thanks!