Skip to main content

pull_through_cache_rules

Creates, updates, deletes or gets a pull_through_cache_rule resource or lists pull_through_cache_rules in a region

Overview

Namepull_through_cache_rules
TypeResource
DescriptionThe AWS::ECR::PullThroughCacheRule resource configures the upstream registry configuration details for an Amazon Elastic Container Registry (Amazon Private ECR) pull-through cache.
Idaws.ecr.pull_through_cache_rules

Fields

NameDatatypeDescription
ecr_repository_prefixstringThe ECRRepositoryPrefix is a custom alias for upstream registry url.
upstream_registry_urlstringThe upstreamRegistryUrl is the endpoint of upstream registry url of the public repository to be cached
credential_arnstringThe Amazon Resource Name (ARN) of the AWS Secrets Manager secret that identifies the credentials to authenticate to the upstream registry.
upstream_registrystringThe name of the upstream registry.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all pull_through_cache_rules in a region.

SELECT
region,
ecr_repository_prefix,
upstream_registry_url,
credential_arn,
upstream_registry
FROM aws.ecr.pull_through_cache_rules
WHERE region = 'us-east-1';

Gets all properties from an individual pull_through_cache_rule.

SELECT
region,
ecr_repository_prefix,
upstream_registry_url,
credential_arn,
upstream_registry
FROM aws.ecr.pull_through_cache_rules
WHERE region = 'us-east-1' AND data__Identifier = '<EcrRepositoryPrefix>';

INSERT example

Use the following StackQL query and manifest file to create a new pull_through_cache_rule resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ecr.pull_through_cache_rules (
EcrRepositoryPrefix,
UpstreamRegistryUrl,
CredentialArn,
UpstreamRegistry,
region
)
SELECT
'{{ EcrRepositoryPrefix }}',
'{{ UpstreamRegistryUrl }}',
'{{ CredentialArn }}',
'{{ UpstreamRegistry }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ecr.pull_through_cache_rules
WHERE data__Identifier = '<EcrRepositoryPrefix>'
AND region = 'us-east-1';

Permissions

To operate on the pull_through_cache_rules resource, the following permissions are required:

Create

ecr:DescribePullThroughCacheRules,
ecr:CreatePullThroughCacheRule,
ecr:DeletePullThroughCacheRule,
iam:CreateServiceLinkedRole,
secretsmanager:GetSecretValue

Read

ecr:DescribePullThroughCacheRules

Update

ecr:DescribePullThroughCacheRules,
ecr:CreatePullThroughCacheRule,
ecr:DeletePullThroughCacheRule,
iam:CreateServiceLinkedRole,
secretsmanager:GetSecretValue

Delete

ecr:DescribePullThroughCacheRules,
ecr:DeletePullThroughCacheRule

List

ecr:DescribePullThroughCacheRules