Amazon EC2 Container Registry

2024/05/08 - Amazon EC2 Container Registry - 2 updated api methods

Changes  This release adds pull through cache rules support for GitLab container registry in Amazon ECR.

CreatePullThroughCacheRule (updated) Link ¶
Changes (both)
{'upstreamRegistry': {'gitlab-container-registry'}}

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

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'
)
type ecrRepositoryPrefix

string

param ecrRepositoryPrefix

[REQUIRED]

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

type upstreamRegistryUrl

string

param upstreamRegistryUrl

[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

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

type registryId

string

param registryId

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.

type upstreamRegistry

string

param upstreamRegistry

The name of the upstream registry.

type credentialArn

string

param credentialArn

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

rtype

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.

DescribePullThroughCacheRules (updated) Link ¶
Changes (response)
{'pullThroughCacheRules': {'upstreamRegistry': {'gitlab-container-registry'}}}

Returns the pull through cache rules for a registry.

See also: AWS API Documentation

Request Syntax

client.describe_pull_through_cache_rules(
    registryId='string',
    ecrRepositoryPrefixes=[
        'string',
    ],
    nextToken='string',
    maxResults=123
)
type registryId

string

param registryId

The Amazon Web Services account ID associated with the registry to return the pull through cache rules for. If you do not specify a registry, the default registry is assumed.

type ecrRepositoryPrefixes

list

param ecrRepositoryPrefixes

The Amazon ECR repository prefixes associated with the pull through cache rules to return. If no repository prefix value is specified, all pull through cache rules are returned.

  • (string) --

type nextToken

string

param nextToken

The nextToken value returned from a previous paginated DescribePullThroughCacheRulesRequest request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.

type maxResults

integer

param maxResults

The maximum number of pull through cache rules returned by DescribePullThroughCacheRulesRequest in paginated output. When this parameter is used, DescribePullThroughCacheRulesRequest only returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another DescribePullThroughCacheRulesRequest request with the returned nextToken value. This value can be between 1 and 1000. If this parameter is not used, then DescribePullThroughCacheRulesRequest returns up to 100 results and a nextToken value, if applicable.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    • pullThroughCacheRules (list) --

      The details of the pull through cache rules.

      • (dict) --

        The details of a pull through cache rule.

        • 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 the pull through cache was created.

        • registryId (string) --

          The Amazon Web Services account ID associated with the registry the pull through cache rule is associated with.

        • credentialArn (string) --

          The ARN of the Secrets Manager secret associated with the pull through cache rule.

        • upstreamRegistry (string) --

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

        • updatedAt (datetime) --

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

    • nextToken (string) --

      The nextToken value to include in a future DescribePullThroughCacheRulesRequest request. When the results of a DescribePullThroughCacheRulesRequest request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return.