How to add or update a trigger in a repository in AWS CodeCommit

0 votes

Hi Team,

I have one repository in AWS CodeCommit. I want to add a trigger in the repository. Can anyone tell me how can I do this with CLI command?

Nov 24, 2020 in AWS by akhtar
• 38,180 points
49 views

1 answer to this question.

0 votes

Hi@akhtar,

The below example demonstrates how to update triggers named 'MyFirstTrigger' and 'MySecondTrigger' using an already-created JSON file that contains the structure of all the triggers for a repository named MyDemoRepo.

$ aws codecommit put-repository-triggers --repository-name MyDemoRepo file://MyTriggers.json

JSON file sample contents:
{
  "repositoryName": "MyDemoRepo",
  "triggers": [
      {
          "destinationArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MyCodeCommitTopic",
          "branches": [
              "master",
              "preprod"
          ],
          "name": "MyFirstTrigger",
          "customData": "",
          "events": [
              "all"
          ]
      },
              {
          "destinationArn": "arn:aws:lambda:us-east-1:111111111111:function:MyCodeCommitPythonFunction",
          "branches": [],
          "name": "MySecondTrigger",
          "customData": "EXAMPLE",
          "events": [
              "all"
          ]
      }
  ]
}
answered Nov 25, 2020 by MD
• 95,140 points

Related Questions In AWS

0 votes
1 answer

How to create a new, empty repository in AWS CodeCommit?

Hi@akhtar, You can create a repository and associate it with ...READ MORE

answered Nov 23, 2020 in AWS by MD
• 95,140 points
71 views
0 votes
1 answer

How to delete a repository in AWS CodeCommit?

Hi@akhtar, You can delete a repository in AWS CodeCommit. ...READ MORE

answered Nov 23, 2020 in AWS by MD
• 95,140 points
87 views
0 votes
1 answer

How to view information about a commit in a repository in AWS CodeCommit?

Hi@akhtar, You can get information about a commit, ...READ MORE

answered Nov 23, 2020 in AWS by MD
• 95,140 points
58 views
0 votes
1 answer

How to get information about differences for a commit specifier in a repository in AWS CodeCommit?

Hi@akhtar, You can get information about the differences ...READ MORE

answered Nov 23, 2020 in AWS by MD
• 95,140 points
85 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to add a file to a repository in AWS CodeCommit?

Hi@akhtar, You can add or update a file in a ...READ MORE

answered Nov 24, 2020 in AWS by MD
• 95,140 points
563 views
0 votes
1 answer

How to create a branch in an AWS CodeCommit repository?

Hi@akhtar, This example creates a branch in an ...READ MORE

answered Nov 22, 2020 in AWS by MD
• 95,140 points
118 views