问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/59283052/aws-code-commit-simple-notification-service-is-there-a-way-to-get-better-format