I am trying to print the output of multiple EC2 instances executed via AWS-RunPowerShellScript document through AWS SSM Automationin Automation execution step outputs section. However, it seems to be not working. Can anyone help me with correct syntax for the same. Please find the below code:
description: printssmruncommandoutput
schemaVersion: '0.3'
mainsteps:
-name:printssmoutput
action:'aws:runcommand'
onfailure:Abort
inputs:
DocumentName:AWS-RunPowerShellScript
Targets:
-Key: ec2key
Values:
- ec2instance
Parameters:
Commands:
- 'hostname'
- 'Write-Host "this is the test server"'
outputs:
- Name: DesiredOutput
Selector: $.OutputPayload
Type: String
outputs:
- DesiredOutput.OutputPayload.CommandId
- DesiredOutput.OutputPayload.Status
It seems like not working. In the outputs section of SSM Automation execution, I am seeing this error even after successful execution of SSM automation document step: "No output available yet because the step is not successfully executed"