Recently, I had a problem how to parse multiple outputs from one child SSM Automation to another child SSM Automation.
Child1 automation is providing two outputs which I would like to use as inputs in Child2 automation.
This issue was resolved with assistance from Charles, an AWS Systems Manager SME from AWS Support.
As he told me, output from aws:executeAutomation action is in StringList format, which is essentially a list of strings. This format cannot be processed with standard Selector syntax because Selector syntax is designed to work with JSONPath formatted outputs, which are structured JSON objects or arrays. To bridge this gap, an intermediary step is required to extract the content of the StringList output and convert it into a JSON format that can be processed further.
An intermediary step is required to extract content of StringList output and convert to JSON.
The main automation executes Child1, parses its output (ProcessListToJSON step), and then executes Child2 with the parsed inputs.
In this repo you will find example of such solution.
Configuration:
- region -
Ireland (eu-west-1) - profile -
default
./deploy.sh
aws ssm start-automation-execution --document-name main
| Name | Version |
|---|---|
| terraform | >= 1.5.7 |
| aws | ~> 5.0 |
| Name | Version |
|---|---|
| aws | 5.98.0 |
No modules.
| Name | Type |
|---|---|
| aws_iam_policy.pass_role_policy | resource |
| aws_iam_role.ssm_automation_role | resource |
| aws_iam_role_policy_attachment.ssm_automation_policy_attachment | resource |
| aws_iam_role_policy_attachment.ssm_pass_role_policy_attachment | resource |
| aws_ssm_document.child_1 | resource |
| aws_ssm_document.child_2 | resource |
| aws_ssm_document.main | resource |
No inputs.
| Name | Description |
|---|---|
| main_ssm_document_name | Name of the Main SSM document |
