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" '
gefragt vor 2 Jahren23 Aufrufe
Keine Antworten

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