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 creates or updates a pull through cache rule. A pull through cache rule provides a way to cache images from an upstream registry in your Amazon ECR private registry.
Idawscc.ecr.pull_through_cache_rules

Fields

NameDatatypeDescription
ecr_repository_prefixstringThe Amazon ECR repository prefix associated with the pull through cache rule.
upstream_registry_urlstringThe upstream registry URL associated with the pull through cache rule.
credential_arnstringThe ARN of the Secrets Manager secret associated with the pull through cache rule.
upstream_registrystringThe name of the upstream source registry associated with the pull through cache rule.
custom_role_arnstringThe ARN of the IAM role associated with the pull through cache rule.
upstream_repository_prefixstringThe upstream repository prefix associated with the pull through cache rule.
regionstringAWS region.

For more information, see AWS::ECR::PullThroughCacheRule.

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 properties from an individual pull_through_cache_rule.

SELECT
region,
ecr_repository_prefix,
upstream_registry_url,
credential_arn,
upstream_registry,
custom_role_arn,
upstream_repository_prefix
FROM awscc.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 awscc.ecr.pull_through_cache_rules (
EcrRepositoryPrefix,
UpstreamRegistryUrl,
CredentialArn,
UpstreamRegistry,
CustomRoleArn,
UpstreamRepositoryPrefix,
region
)
SELECT
'{{ EcrRepositoryPrefix }}',
'{{ UpstreamRegistryUrl }}',
'{{ CredentialArn }}',
'{{ UpstreamRegistry }}',
'{{ CustomRoleArn }}',
'{{ UpstreamRepositoryPrefix }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM awscc.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,
iam:PassRole

Read

ecr:DescribePullThroughCacheRules

Update

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

Delete

ecr:DescribePullThroughCacheRules,
ecr:DeletePullThroughCacheRule

List

ecr:DescribePullThroughCacheRules