Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CodeCommit: Repository Notifications vs Repository Triggers

Notifications: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html

Triggers: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-notify.html

The official document states that for CodeCommit repository 'events which follow CloudWatch Event Rules' (like pull requests), we use Repository Notifications.

Whereas for CodeCommit repository events which are just 'operational events' (like creating branches, pushing code to a branch), we use Repository Triggers.

I don't understand the difference between 'events which follow CloudWatch Event Rules' and 'operational events'. For me, both pull requests and pushing code to branch seem similar events.

Thus, confused between why we need both Repository Notifications and Repository Triggers.

like image 332
vvv Avatar asked Mar 25 '19 12:03

vvv


People also ask

Which AWS service help you to trigger notification when pull request created on AWS CodeCommit repository?

You can use the CodeCommit console and the AWS CLI to configure notification rules.

How do you notify Lambda CodeCommit?

To create a trigger for a Lambda functionOpen the CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home . In Repositories, choose the repository where you want to create triggers for repository events. In the navigation pane for the repository, choose Settings, and then choose Triggers.

Which connections types are supported by CodeCommit?

IAM supports CodeCommit with three types of credentials: Git credentials, an IAM-generated user name and password pair you can use to communicate with CodeCommit repositories over HTTPS.


2 Answers

I have asked the same question today and I found this on docs:

Repository notifications are different from repository triggers. Although you can configure a trigger to use Amazon SNS to send emails about some repository events, those events are limited to operational events, such as creating branches and pushing code to a branch. Triggers do not use CloudWatch Events rules to evaluate repository events. They are more limited in scope. For more information about using triggers, see Manage Triggers for a Repository.

like image 190
Pedro Arantes Avatar answered Nov 04 '22 15:11

Pedro Arantes


IMO, AWS documentation has not clearly stated the difference between notification and triggers and cloudwatch events. Here is my understanding :

Notifications should be used for literal notification and not for taking action based on them.

Triggers are supposed to initiate action. So, if I need to invoke some service based on this event on which trigger is based, I would do that and hence the option to integrate Lambda service. In a way to add automation after codecommit events.

However, Cloudwatch Events provide a wide variety of integration option for codecommit events which are not available with trigger.

like image 40
urOutsourced Avatar answered Nov 04 '22 16:11

urOutsourced