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
gefragt vor einem Jahr404 Aufrufe
1 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Jahr
profile picture
EXPERTE
überprüft vor 10 Monaten
profile picture
EXPERTE
überprüft vor einem Jahr
  • Awesome. That got it working. Thanks!

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen