aws-cloudformation / aws-cloudformation-resource-providers-awsutilities-commandrunner

Apache License 2.0
81 stars 21 forks source link

Multiple Outputs from the command #59

Closed Bharath509 closed 6 months ago

Bharath509 commented 1 year ago

Hello Everyone, I'm running a command that gives json object as output I'm writing that to command-output.txt file

Imagine I wrote {"key1": "value1", "key2": "value2"} to the file

But when I tried to access the output as !GetAtt Command.Output.a I'm getting below error

Requested attribute Output.a does not exist in schema for AWSUtility::CloudFormation::CommandRunner

But when I wrote !GetAtt Command.Output as output got {\ as output

Please give me a solution where I can access multiple outputs from a command

shantgup commented 6 months ago

Hi @Bharath509, you can write your outputs to multiple SSM Parameters, and then reference them in the template using the below format. For more information, see here.

{{resolve:ssm:ParameterName:1}}