AWS CodeCommit notification is a feature of AWS CodeCommit, a managed source control service provided by Amazon Web Services (AWS). The notification feature allows you to receive automated notifications via various channels when certain events occur in your AWS CodeCommit repositories, such as code pushes, pull requests, and branch or tag creations or deletions.
AWS CodeCommit notifications can be configured to send notifications to a variety of destinations, including email addresses, Amazon Simple Notification Service (SNS) topics, and AWS Lambda functions. You can also customize the content of the notification messages, including the message template and the events that trigger notifications.
Create SNS topic
If you do not have existing SNS topic, please follow the below procedure to create one.
- Navigate to SNS topic service and click on “Create topic”
- Select the topic type as “Standard”
- Navigate to subscriptions and click on “Create subscription”
- Enter the subscription details
- SNS topic has been successfully created
- Login to the email endpoint and click on “confirm subscription”
Configure AWS CodeCommit notifications
- Open the AWS Management Console and navigate to the CodeCommit service
- In the CodeCommit console, select the repository for which you want to configure notifications
- From the repository details page, choose the “Settings” option in the left navigation menu
- Scroll down to the “Notifications” section, and choose “Create Notification”
- Select the type of notification you want to configure. AWS CodeCommit supports notifications for various events, such as repository pushes, pull requests, and branch or tag creations or deletions.
Specify the notification recipients. This can include email addresses, Amazon SNS topics, or AWS Lambda functions.
- Customize the notification settings as needed, such as the message template and the events that trigger notifications
- Choose “Submit” to save the configuration
- Navigate to triggers
- Configure triggers like below
Test our work
- Let’s create a new branch. Navigate to CodeCommit – > Branches
- Create a new branch from master
- Once the branch is created, click on the branch to browse the repo. I have selected “pom.xml” to make some updates to it
- Once the update is made, click on “create pull request”
- In real world, one of your team members or authorized reviewer will review the change and merge it with master
- Click on merge to push the changes from developer1 branch to master
- Once you merge the pull request, you should have got the notification on your email like below
Conclusion
By using AWS CodeCommit notifications, you can stay informed about important events in your repositories and respond quickly to changes in your codebase. This can help you to improve collaboration and streamline your development workflow. You can configure multiple notifications for a single repository, and you can also use AWS CloudWatch Events to route notifications to other AWS services, such as Amazon SNS or AWS Lambda.
Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.