Amazon ECR - Amazon CodePipeline
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon ECR

Triggers the pipeline when a new image is pushed to the Amazon ECR repository. This action provides an image definitions file referencing the URI for the image that was pushed to Amazon ECR. This source action is often used in conjunction with another source action, such as CodeCommit, to allow a source location for all other source artifacts. For more information, see Tutorial: Create a pipeline with an Amazon ECR source and ECS-to-CodeDeploy deployment.

When you use the console to create or edit your pipeline, CodePipeline creates a CloudWatch Events rule that starts your pipeline when a change occurs in the repository.

You must have already created an Amazon ECR repository and pushed an image before you connect the pipeline through an Amazon ECR action.

Action type

  • Category: Source

  • Owner: AWS

  • Provider: ECR

  • Version: 1

Configuration parameters


Required: Yes

The name of the Amazon ECR repository where the image was pushed.


Required: No

The tag used for the image.


If a value for ImageTag is not specified, the value defaults to latest.

Input artifacts

  • Number of artifacts: 0

  • Description: Input artifacts do not apply for this action type.

Output artifacts

Output variables

When configured, this action produces variables that can be referenced by the action configuration of a downstream action in the pipeline. This action produces variables which can be viewed as output variables, even if the action doesn't have a namespace. You configure an action with a namespace to make those variables available to the configuration of downstream actions.

For more information, see Variables.


The Amazon account ID associated with the registry that contains the repository.


The name of the Amazon ECR repository where the image was pushed.


The tag used for the image.


The sha256 digest of the image manifest.


The URI for the image.

Action declaration (Amazon ECR example)

Name: Source Actions: - InputArtifacts: [] ActionTypeId: Version: '1' Owner: AWS Category: Source Provider: ECR OutputArtifacts: - Name: SourceArtifact RunOrder: 1 Configuration: ImageTag: latest RepositoryName: my-image-repo Name: ImageSource
{ "Name": "Source", "Actions": [ { "InputArtifacts": [], "ActionTypeId": { "Version": "1", "Owner": "AWS", "Category": "Source", "Provider": "ECR" }, "OutputArtifacts": [ { "Name": "SourceArtifact" } ], "RunOrder": 1, "Configuration": { "ImageTag": "latest", "RepositoryName": "my-image-repo" }, "Name": "ImageSource" } ] },

The following related resources can help you as you work with this action.