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" '
asked 2 years ago23 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions