At the moment our team is getting AWS SNS messages regarding pull requests, branch changes etc as JSON embedded in an email, which means, without line-breaks, etc, a JSON structure wrapped to the width of the mail message. That's OK, but makes it difficult for people to read at a glance what's occurred, and, thus, easy to ignore. Is there a way to have it arrive better formatted? I looked through the SNS options and did some googling and found this -- Sending html content in AWS SNS(Simple Notification Service) emails notifications -- which says that Simple Email Service is a better option. How might I attach this to Code Commit events?
Asked
Active
Viewed 2,184 times
7
-
1Off the top of my head, given that you can set a lambda to be triggered on CC events, you could make that lambda get the relevant info from the event, format it as desired, and send it through the SES sdk. I've done the lambda bit for SES for other events, dead easy, and you get nicely formatted emails. – 404 Dec 11 '19 at 10:00
-
1Have you tried Cloudwatch Events input transformer? It usually increases readability by formatting json events. – Vikyol Dec 11 '19 at 12:06
-
1Is it possible that you have forgotten to remove the old event rule? I've never come across SNS sending duplicate messages. – Vikyol Dec 11 '19 at 13:53
1 Answers
8
Cloudwatch Events Input Transformer can be used to convert event data in Json format to a more readable format.
The sample rule below matches the fields of CodeCommit:pullRequestCreated event and transforms it to a readable notification message.

Vikyol
- 5,051
- 23
- 24
-
1
-
I created a input transformer role with above json input. Nothing happens. https://stackoverflow.com/questions/73527591/aws-code-commit-slack-integration-display-author-and-commit-details – Santosh Aug 29 '22 at 10:45