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
preguntada hace un año404 visualizaciones
1 Respuesta
1
Respuesta aceptada

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
EXPERTO
respondido hace un año
profile picture
EXPERTO
revisado hace 10 meses
profile picture
EXPERTO
revisado hace un año
  • Awesome. That got it working. Thanks!

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas