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-public'|'quay'|'k8s'|'docker-hub'|'github-container-registry'|'azure-container-registry'|'gitlab-container-registry',
    credentialArn='string'
)
Parameters:
  • ecrRepositoryPrefix (string) –

    [REQUIRED]

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

  • 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 Public ( ecr-public) - public.ecr.aws

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

    • Quay ( quay) - quay.io

    • Kubernetes ( k8s) - registry.k8s.io

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

    • Microsoft Azure Container Registry ( azure-container-registry) - <custom>.azurecr.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.

Return type:

dict

Returns:

Response Syntax

{
    'ecrRepositoryPrefix': 'string',
    'upstreamRegistryUrl': 'string',
    'createdAt': datetime(2015, 1, 1),
    'registryId': 'string',
    'upstreamRegistry': 'ecr-public'|'quay'|'k8s'|'docker-hub'|'github-container-registry'|'azure-container-registry'|'gitlab-container-registry',
    'credentialArn': '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.

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