Trigger secondary SSM Automation Document error

0

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.

bobie
asked 10 months ago393 views
1 Answer
1
Accepted Answer

It should be possible to specify multiple Values, so changing it to a list may be successful.

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
profile picture
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago
profile picture
EXPERT
reviewed 10 months ago
  • Awesome. That got it working. Thanks!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions