AWS::ECR::PullThroughCacheRule - AWS CloudFormation

AWS::ECR::PullThroughCacheRule

Creates a pull through cache rule. A pull through cache rule provides a way to cache images from an external public registry in your Amazon ECR private registry.

Syntax

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

JSON

{ "Type" : "AWS::ECR::PullThroughCacheRule", "Properties" : { "EcrRepositoryPrefix" : String, "UpstreamRegistryUrl" : String } }

YAML

Type: AWS::ECR::PullThroughCacheRule Properties: EcrRepositoryPrefix: String UpstreamRegistryUrl: String

Properties

EcrRepositoryPrefix

The Amazon ECR repository prefix associated with the pull through cache rule.

Required: Yes

Type: String

Minimum: 2

Maximum: 20

Pattern: [a-z0-9]+(?:[._-][a-z0-9]+)*

Update requires: Replacement

UpstreamRegistryUrl

The upstream registry URL associated with the pull through cache rule.

Required: Yes

Type: String

Update requires: No interruption

Return values

Fn::GetAtt

RegistryId

The account ID of the private registry.

Examples

The following resource examples show how to create a pull through cache rule for a private registry.

Create a pull through cache rule for a private registry

The following example creates a pull through cache rule that caches repositories with the name prefix my-ecr from the Amazon ECR Public registry into your private registry.

JSON

{ "Resources": { "MyECRPullThroughCacheRule": { "Type": "AWS::ECR::PullThroughCacheRule", "Properties": { "EcrRepositoryPrefix": "my-ecr", "UpstreamRegistryUrl": "public.ecr.aws" } } } }

YAML

Resources: MyECRPullThroughCacheRule: Type: 'AWS::ECR::PullThroughCacheRule' Properties: EcrRepositoryPrefix: 'my-ecr' UpstreamRegistryUrl: 'public.ecr.aws'