AWS::ECR::ReplicationConfiguration - Amazon CloudFormation
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).

AWS::ECR::ReplicationConfiguration

The AWS::ECR::ReplicationConfiguration resource creates or updates the replication configuration for a private registry. The first time a replication configuration is applied to a private registry, a service-linked IAM role is created in your account for the replication process. For more information, see Using Service-Linked Roles for Amazon ECR in the Amazon Elastic Container Registry User Guide.

Note

When configuring cross-account replication, the destination account must grant the source account permission to replicate. This permission is controlled using a private registry permissions policy. For more information, see AWS::ECR::RegistryPolicy.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::ECR::ReplicationConfiguration", "Properties" : { "ReplicationConfiguration" : ReplicationConfiguration } }

YAML

Type: AWS::ECR::ReplicationConfiguration Properties: ReplicationConfiguration: ReplicationConfiguration

Properties

ReplicationConfiguration

The replication configuration for a registry.

Required: Yes

Type: ReplicationConfiguration

Update requires: No interruption

Return values

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

RegistryId

The account ID of the destination registry.

Examples

Specify a replication configuration for a private registry

The following example specifies a replication configuration in a source Region for a private registry to replicate the contents to the us-east-2 and us-west-1 Regions within the same account.

JSON

"TestReplicationConfiguration": { "Type": "AWS::ECR::ReplicationConfiguration", "Properties": { "ReplicationConfiguration": { "Rules": [ { "Destinations": [ { "Region": "us-east-2", "RegistryId": "123456789012" }, { "Region": "us-west-1", "RegistryId": "123456789012" } ] } ] } } }

YAML

Resources: MyReplicationConfig: Type: AWS::ECR::ReplicationConfiguration Properties: ReplicationConfiguration: Rules: - Destinations: - Region: "us-east-2" RegistryId: "123456789012" - Region: "us-west-1" RegistryId: "123456789012"