AWS SSM Document automation - to create a new step to send out email with all outputs
Budget: $10 – $30 AUD
I got a AWS SSM document (Automation) which is written in powershell and in YAML format., which works good.
in mainstep - got few different child steps. each step gives its output upon opening in different tab.
Task is : i want to create a new step - to collect all output from all child steps and send it as email. ?
example code:
Parameters:
Email:
type: String
description: type the email address to which collective outputs will be sent
mainSteps:
- name: Get hostname
action: 'aws:runCommand'
inputs:
DocumentName: AWS-RunPowerShellScript
Parameters:
Commands:
- $a = hostname.exe
- echo $a
- name: Get OSVersion
action: 'aws:runCommand'
inputs:
DocumentName: AWS-RunPowerShellScript
Parameters:
Commands:
- $b = (Get-WmiObject win32_operatingsystem) | Select Version
- echo $b
so when the above ssm example runs - it succeeds and can open each output in a different window.
now i want to create a new step to collect both the steps output (hostname&osverion) and send it in an email which will be specified in parameter section
in mainstep - got few different child steps. each step gives its output upon opening in different tab.
Task is : i want to create a new step - to collect all output from all child steps and send it as email. ?
example code:
Parameters:
Email:
type: String
description: type the email address to which collective outputs will be sent
mainSteps:
- name: Get hostname
action: 'aws:runCommand'
inputs:
DocumentName: AWS-RunPowerShellScript
Parameters:
Commands:
- $a = hostname.exe
- echo $a
- name: Get OSVersion
action: 'aws:runCommand'
inputs:
DocumentName: AWS-RunPowerShellScript
Parameters:
Commands:
- $b = (Get-WmiObject win32_operatingsystem) | Select Version
- echo $b
so when the above ssm example runs - it succeeds and can open each output in a different window.
now i want to create a new step to collect both the steps output (hostname&osverion) and send it in an email which will be specified in parameter section
Related categories:
Business, Accounting, Human Resources & Legal
Amazon Web Services
JSON
Powershell
Coding