AWS::ECR::PullThroughCacheRule - 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::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 Amazon 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: No

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: No

Type: String

Update requires: Replacement

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'