Collect output of all steps from a single SSM document

0

I got a SSM automation document, which does have 5 steps/codes. right now it works perfect. once i ran it, i can click on each executed step-ID , check its output.

but i want to know is there any way to accumulate all 5steps output and send everything as an email once ssm finished running ??? or anyway to collect outputs from all 5step-id's and put it in a 6th step and send it as email as part of the ssm document itself. ?

1 Answer
0

Automation, a capability of AWS Systems Manager, integrates with Amazon CloudWatch Logs. You can send the output from aws:executeScript actions to the log group you specify. You can read about enabling the CloudWatch logging on this documentation page.

To monitor the execution status of your automation document, you can use Amazon EventBridge. Amazon EventBridge is a serverless event bus service that allows you to connect your applications with data from a variety of sources. EventBridge was formerly called Amazon CloudWatch Events. EventBridge can add events from dozens of AWS services to your rules, including Systems Manager. EventBridge also supports events from the Systems Manager's Automation capability. See an example of an Automation event pattern here.

You can define an AWS Lambda function as the target of your EventBridge rule. This Lambda function will gather the CloudWatch logs and send them via email. You can use the Amazon SNS service to send emails. A similar solution is described in this blog post.

profile pictureAWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions