ECR / Client / create_pull_through_cache_rule

create_pull_through_cache_rule#

ECR.Client.create_pull_through_cache_rule(**kwargs)#

Creates a pull through cache rule. A pull through cache rule provides a way to cache images from an upstream registry source in your Amazon ECR private registry. For more information, see Using pull through cache rules in the Amazon Elastic Container Registry User Guide.

See also: AWS API Documentation

Request Syntax

response = client.create_pull_through_cache_rule(
    ecrRepositoryPrefix='string',
    upstreamRegistryUrl='string',
    registryId='string',
    upstreamRegistry='ecr'|'ecr-public'|'quay'|'k8s'|'docker-hub'|'github-container-registry'|'azure-container-registry'|'gitlab-container-registry',
    credentialArn='string',
    customRoleArn='string',
    upstreamRepositoryPrefix='string'
)
Parameters:
  • ecrRepositoryPrefix (string) –

    [REQUIRED]

    The repository name prefix to use when caching images from the source registry.

    Warning

    There is always an assumed / applied to the end of the prefix. If you specify ecr-public as the prefix, Amazon ECR treats that as ecr-public/.

  • upstreamRegistryUrl (string) –

    [REQUIRED]

    The registry URL of the upstream public registry to use as the source for the pull through cache rule. The following is the syntax to use for each supported upstream registry.

    • Amazon ECR ( ecr) – dkr.ecr.<region>.amazonaws.com

    • Amazon ECR Public ( ecr-public) – public.ecr.aws

    • Docker Hub ( docker-hub) – registry-1.docker.io

    • GitHub Container Registry ( github-container-registry) – ghcr.io

    • GitLab Container Registry ( gitlab-container-registry) – registry.gitlab.com

    • Kubernetes ( k8s) – registry.k8s.io

    • Microsoft Azure Container Registry ( azure-container-registry) – <custom>.azurecr.io

    • Quay ( quay) – quay.io

  • registryId (string) – The Amazon Web Services account ID associated with the registry to create the pull through cache rule for. If you do not specify a registry, the default registry is assumed.

  • upstreamRegistry (string) – The name of the upstream registry.

  • credentialArn (string) – The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that identifies the credentials to authenticate to the upstream registry.

  • customRoleArn (string) – Amazon Resource Name (ARN) of the IAM role to be assumed by Amazon ECR to authenticate to the ECR upstream registry. This role must be in the same account as the registry that you are configuring.

  • upstreamRepositoryPrefix (string) – The repository name prefix of the upstream registry to match with the upstream repository name. When this field isn’t specified, Amazon ECR will use the ROOT.

Return type:

dict

Returns:

Response Syntax

{
    'ecrRepositoryPrefix': 'string',
    'upstreamRegistryUrl': 'string',
    'createdAt': datetime(2015, 1, 1),
    'registryId': 'string',
    'upstreamRegistry': 'ecr'|'ecr-public'|'quay'|'k8s'|'docker-hub'|'github-container-registry'|'azure-container-registry'|'gitlab-container-registry',
    'credentialArn': 'string',
    'customRoleArn': 'string',
    'upstreamRepositoryPrefix': 'string'
}

Response Structure

  • (dict) –

    • ecrRepositoryPrefix (string) –

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

    • upstreamRegistryUrl (string) –

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

    • createdAt (datetime) –

      The date and time, in JavaScript date format, when the pull through cache rule was created.

    • registryId (string) –

      The registry ID associated with the request.

    • upstreamRegistry (string) –

      The name of the upstream registry associated with the pull through cache rule.

    • credentialArn (string) –

      The Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret associated with the pull through cache rule.

    • customRoleArn (string) –

      The ARN of the IAM role associated with the pull through cache rule.

    • upstreamRepositoryPrefix (string) –

      The upstream repository prefix associated with the pull through cache rule.

Exceptions

  • ECR.Client.exceptions.ServerException

  • ECR.Client.exceptions.InvalidParameterException

  • ECR.Client.exceptions.ValidationException

  • ECR.Client.exceptions.PullThroughCacheRuleAlreadyExistsException

  • ECR.Client.exceptions.UnsupportedUpstreamRegistryException

  • ECR.Client.exceptions.LimitExceededException

  • ECR.Client.exceptions.UnableToAccessSecretException

  • ECR.Client.exceptions.SecretNotFoundException

  • ECR.Client.exceptions.UnableToDecryptSecretValueException