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
demandé il y a un an403 vues
1 réponse
1
Réponse acceptée

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
répondu il y a un an
profile picture
EXPERT
vérifié il y a 10 mois
profile picture
EXPERT
vérifié il y a un an
  • Awesome. That got it working. Thanks!

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions