CodeCommit - SNS Notification Beautify

0

Is there anyway to beautify the CodeCommit Notifications instead of getting a large JSON?

I was thinking of involving a Lambda function which receives that Large JSON and modify it, but i'm trying to find an easier way.

This is an example of the JSON sent through the SNS Topic configured in CodeCommit Notifications (Replaced acct. number with ?): {"account":"??","detailType":"CodeCommit Repository State Change","region":"us-east-1","source":"aws.codecommit","time":"2022-02-10T14:18:25Z","notificationRuleArn":"arn:aws:codestar-notifications:us-east-1:??:notificationrule/a6d8f86a6feb72ca5b3c342a1c0e463e5394f5e1","detail":{"referenceFullName":"refs/heads/dev","repositoryId":"3f8a3a4f-eac4-4077-b13c-fd1ac749171e","referenceType":"branch","commitId":"822aef94a812d7d73c2382f3a68ca187ea67aec9","callerUserArn":"arn:aws:iam::??:user/athmfiuser","event":"referenceUpdated","repositoryName":"athm-dev-athmfi-onpremiseapi-pipeline","oldCommitId":"29a8687b679861dc257dba49b9440db85b0ced0a","referenceName":"dev"},"resources":["arn:aws:codecommit:us-east-1:??:athm-dev-athmfi-onpremiseapi-pipeline"],"additionalAttributes":{}}

2개 답변
1

I can think of two options:

  1. Create a lambda that that subscribes to the SNS topic and use the JSON to sendEmail or sendTemplatedEmail using SES

  2. Use InputTransformer to customize the message going into SNS

profile pictureAWS
중재자
답변함 2년 전
0

An alternate solution is to use AWS Chatbot to forward pre-formatted CodeCommit notifications to your Slack channels. https://aws.amazon.com/blogs/devops/receive-aws-developer-tools-notifications-over-slack-using-aws-chatbot/

AWS
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠