Remove auto trigger from ECR as Source in AWS CodePipeline

634 views Asked by At

I have a pipeline with Source stage which reads from ECR. For every image pushed to ECR my pipeline is triggered automatically. I don't want this behavior and would like to start my pipeline manually from Release Change button. How to achieve this?

I managed to achieve the same for GitHub Source Stage by removing the webhook from GitHub repo itself. Unable to find similar web-hook for ECR.

1

There are 1 answers

0
shariqmaws On

CodePipeline uses CloudWatch rules when the source is configured as ECR to start its execution on an Image Push.

To verify this, you can check the associated CloudWatch rule [1] and look if the event pattern currently set on your rule matches an event on ECR Image Push. Also you can refer to this sample Event for a Completed Image Push [2] to see the available attributes for filtering.

As a general guidance, you might want to check the following links that will walk through the process of using ECR as a Source on CodePipeline[3].

[1] Use CloudWatch Events to Start a Pipeline (Amazon ECR Source) - https://docs.aws.amazon.com/codepipeline/latest/userguide/create-cwe-ecr-source.html

[2] Amazon ECR Events and EventBridge - Sample Events from Amazon ECR - https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr-eventbridge.html#ecr-eventbridge-bus

[3] AWS DevOps Blog - https://aws.amazon.com/pt/blogs/devops/build-a-continuous-delivery-pipeline-for-your-container-images-with-amazon-ecr-as-source/