Menu
AWS CodeCommit
User Guide (API Version 2015-04-13)

Configure Repository Notifications

You can keep repository users informed of repository events by configuring notifications. When you configure notifications, subscribed users receive emails about the events that you specify, such as when someone comments on a commit. For more information, see Using Repository Notifications.

To use the AWS CodeCommit console to configure notifications for a repository in AWS CodeCommit, you must have the following managed policy or the equivalent permissions attached to your IAM user:

  • CloudWatchEventsFullAccess

  • AmazonSNSFullAccess

Note

Equivalent permissions are included in the AWSCodeCommitFullAccess policy, which is required to configure repository notifications. If you have this policy applied, you do not need the other two policies. If you have a customized policy applied, you might need to modify it to include the required permissions for CloudWatch Events and Amazon SNS.

To configure notifications for a repository

  1. Open the AWS CodeCommit console at https://console.aws.amazon.com/codecommit.

  2. In the list of repositories, choose the name of the repository where you want to configure notifications.

  3. In the navigation pane, choose Settings, and then choose Notifications.

  4. In Event types, select the event types you want included in the CloudWatch Events rule for the repository.

    
            Configuring notifications in an AWS CodeCommit repository
  5. In SNS topic, either choose a topic from the list of Amazon SNS topics in your AWS account, or create a topic to use for this repository.

    Note

    If you create a topic, you can manage subscriptions for that policy from the AWS CodeCommit console. If you use an existing topic, you cannot manage subscriptions for that topic unless you have permissions to manage subscriptions for all topics in Amazon SNS. For more information, see Amazon Simple Notification Service Developer Guide.

    If you create a topic, in Topic name, type a name for the topic. Optionally, in Display name, type a short name . Choose Create.

  6. To add the email addresses of the repository users, choose Manage subscriptions. In Add email subscriber, type the email address of a repository user, and then choose Save. You can add only one email address at a time.

    Note

    A confirmation email is sent to the address as soon as you choose Save. However, the status of the subscription is not updated while you remain in Manage subscriptions.

    After you have added all the email addresses to the list of subscribers, choose Close.

    Tip

    Amazon SNS coordinates and manages the delivery and sending of messages to subscribing endpoints and email addresses. Endpoints include web servers, email addresses, Amazon Simple Queue Service queues, and AWS Lambda functions. For more information, see What Is Amazon Simple Notification Service? and Sending Amazon SNS Messages to HTTP/HTTPS Endpoints.

  7. To finish configuring notifications, choose Save.

After you have configured notifications for a repository, you can view the CloudWatch Events rule automatically created for the repository.

Important

Do not edit or delete this rule. Changing or deleting the rule might cause operational issues. For example, emails might not be sent to subscribers or the inability to change notification settings for a repository in AWS CodeCommit.

To view the CloudWatch Events rule for a repository

  1. Sign in to the AWS Management Console and open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

  2. In the navigation bar, under Events, choose Rules.

  3. Choose the rule for your repository from the list. The rule name is displayed on the Notifications tab in your repository settings.

  4. View the rule summary information.

    Important

    Do not edit, delete, or disable this rule.