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
질문됨 일 년 전405회 조회
1개 답변
1
수락된 답변

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
전문가
답변함 일 년 전
profile picture
전문가
검토됨 10달 전
profile picture
전문가
검토됨 일 년 전
  • Awesome. That got it working. Thanks!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠