Skip to main content

pull_through_cache_rules

Creates, updates, deletes, gets or lists a pull_through_cache_rules resource.

Overview

Namepull_through_cache_rules
TypeResource
Idaws.ecr.pull_through_cache_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The date and time the pull through cache was created.
credential_arnstringThe ARN of the Secrets Manager secret associated with the pull through cache rule. (pattern: <code>^arn:aws(-\w+)*:secretsmanager:[a-zA-Z0-9-:]+:secret:ecr-pullthroughcache/[a-zA-Z0-9/_+=.@-]+$</code>)
custom_role_arnstringThe ARN of the IAM role associated with the pull through cache rule.
ecr_repository_prefixstringThe Amazon ECR repository prefix associated with the pull through cache rule. (pattern: <code>^([a-z0-9]+((.||__|-+)[a-z0-9]+)*(/[a-z0-9]+((.||__|-+)[a-z0-9]+))/?|ROOT)$</code>)
registry_idstringThe Amazon Web Services account ID associated with the registry the pull through cache rule is associated with. (pattern: <code>[0-9]{12}</code>)
updated_atstring (date-time)The date and time, in JavaScript date format, when the pull through cache rule was last updated.
upstream_registrystringThe name of the upstream source registry associated with the pull through cache rule. (ecr, ecr-public, quay, k8s, docker-hub, github-container-registry, azure-container-registry, gitlab-container-registry, chainguard)
upstream_registry_urlstringThe upstream registry URL associated with the pull through cache rule.
upstream_repository_prefixstringThe upstream repository prefix associated with the pull through cache rule. (pattern: <code>^([a-z0-9]+((.||__|-+)[a-z0-9]+)*(/[a-z0-9]+((.||__|-+)[a-z0-9]+))/?|ROOT)$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_pull_through_cache_rulesselectregionReturns the pull through cache rules for a registry.
create_pull_through_cache_ruleinsertregion, ecrRepositoryPrefix, upstreamRegistryUrlCreates 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.
update_pull_through_cache_ruleupdateregion, ecrRepositoryPrefixUpdates an existing pull through cache rule.
delete_pull_through_cache_ruledeleteregionDeletes a pull through cache rule.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns the pull through cache rules for a registry.

SELECT
created_at,
credential_arn,
custom_role_arn,
ecr_repository_prefix,
registry_id,
updated_at,
upstream_registry,
upstream_registry_url,
upstream_repository_prefix
FROM aws.ecr.pull_through_cache_rules
WHERE region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.ecr.pull_through_cache_rules (
ecrRepositoryPrefix,
upstreamRegistryUrl,
registryId,
upstreamRegistry,
credentialArn,
customRoleArn,
upstreamRepositoryPrefix,
region
)
SELECT
'{{ ecrRepositoryPrefix }}' /* required */,
'{{ upstreamRegistryUrl }}' /* required */,
'{{ registryId }}',
'{{ upstreamRegistry }}',
'{{ credentialArn }}',
'{{ customRoleArn }}',
'{{ upstreamRepositoryPrefix }}',
'{{ region }}'
RETURNING
created_at,
credential_arn,
custom_role_arn,
ecr_repository_prefix,
registry_id,
upstream_registry,
upstream_registry_url,
upstream_repository_prefix
;

UPDATE examples

Updates an existing pull through cache rule.

UPDATE aws.ecr.pull_through_cache_rules
SET
registryId = '{{ registryId }}',
ecrRepositoryPrefix = '{{ ecrRepositoryPrefix }}',
credentialArn = '{{ credentialArn }}',
customRoleArn = '{{ customRoleArn }}'
WHERE
region = '{{ region }}' --required
AND ecrRepositoryPrefix = '{{ ecrRepositoryPrefix }}' --required
RETURNING
credential_arn,
custom_role_arn,
ecr_repository_prefix,
registry_id,
updated_at,
upstream_repository_prefix;

DELETE examples

Deletes a pull through cache rule.

DELETE FROM aws.ecr.pull_through_cache_rules
WHERE region = '{{ region }}' --required
;