translate SNS notifications from SSM to useful readable informations

0

Hello,

I'm receiving SNS notification after run command (AWS_applypatchbaseline) , but it is containing only instance ID and run command result (failed, success...). Example below :

{"commandId":"a55a64ed-b532-4cf0-a9fd-redacted","documentName":"AWS-ApplyPatchBaseline","instanceId":"mi-0529853redacted","requestedDateTime":"2023-03-09T10:00:07.38Z","status":"Failed","detailedStatus":"Failed","eventTime":"2023-03-09T10:19:54.568Z"}

I would like to translate this to instance name + run command **output **(where I can see installed KB)

Any directions where I should look at ?

1 Answer
0

Hello,

In regards to monitoring run Command and Maintenance Windows tasks, one can configure Amazon SNS notifications for command tasks. [1]

The summary that is currently sent from SNS includes fields such as eventTime, documentName etc [2] which I can see in your example message as well.

In regards to customization query of an SNS message [3], generally one can leverage a Lambda function instead as a target if and when possible with service. Then, configure that Lambda function to publish a custom message to the Amazon SNS topic. This will help filter for the information you require for a specific use case.

In this specific case scenario, I would recommend you to open a case with our Premium Support team for SSM service to confirm if Lambda can be used as a target.

I hope the above shared information shed light on your customization query. Please feel free to reach out if you have any questions.


References:

[1] https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html

[2] https://docs.aws.amazon.com/systems-manager/latest/userguide/monitoring-sns-notifications.html

[3] https://repost.aws/knowledge-center/change-sns-email-for-eventbridge

profile pictureAWS
SUPPORT ENGINEER
Yash_C
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