Resource: aws_ecr_pull_through_cache_rule

Provides an Elastic Container Registry Pull Through Cache Rule.

More information about pull through cache rules, including the set of supported upstream repositories, see Using pull through cache rules.

Example Usage

resource "aws_ecr_pull_through_cache_rule" "example" {
  ecr_repository_prefix = "ecr-public"
  upstream_registry_url = "public.ecr.aws"
  credential_arn        = "arn:aws:secretsmanager:us-east-1:123456789:secret:ecr-pullthroughcache/ecrpublic"
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import a pull-through cache rule using the ecr_repository_prefix. For example:

import {
  to = aws_ecr_pull_through_cache_rule.example
  id = "ecr-public"
}

Using terraform import, import a pull-through cache rule using the ecr_repository_prefix. For example:

% terraform import aws_ecr_pull_through_cache_rule.example ecr-public