Get result of aws:approve action as output of custom Document

0

Hi, I would like to get the value of ApproverDecisions.Comment from aws:approve to use as input to the next step. Is there any specific syntax on this?

ApproverDecisions
{
  "Approver": "xxx",
  "Decision": "Approve",
  "ApprovalDecisionTime": "2022-04-06T07:22:51.034463Z",
  "Comment": "Approve because it is valid"
}

I have tried the following but not working

mainSteps:
  - name: ReviewImage
    action: 'aws:approve'
    inputs:
      NotificationArn: 'XXX'
      Message: 'Notification Hello'
      MinRequiredApprovals: 1
      Approvers:
        - 'XXXX'
    outputs:
      - Name: CommentVal
        Selector: $.ApprovalDecisions[0].Comment
        Type: String
      - Name: CommentVal2
        Selector: $.ApprovalDecisions.Comment
        Type: String
  - name: TestLogging
    action: 'aws:runCommand'
    inputs:
      DocumentName: AWS-RunPowerShellScript
      InstanceIds:
        - XXXXX
      Parameters:
        commands:
          - ' $comment = {{ ReviewImage.CommentVal }} '
	  - ' Write-Host "$comment" '
          - ' $comment2 = {{ ReviewImage.CommentVal2 }} '
	  - ' Write-Host "$comment2" '
질문됨 2년 전23회 조회
답변 없음

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

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

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

관련 콘텐츠