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

NameResourceAccessible byRequired Params
create_resourcepull_through_cache_rulesINSERTregion
delete_resourcepull_through_cache_rulesDELETEIdentifier, region
update_resourcepull_through_cache_rulesUPDATEIdentifier, PatchDocument, region
list_resourcespull_through_cache_rules_list_onlySELECTregion
get_resourcepull_through_cache_rulesSELECTIdentifier, 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 = '{{ region }}' AND
Identifier = '{{ ecr_repository_prefix }}';

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
'{{ ecr_repository_prefix }}',
'{{ upstream_registry_url }}',
'{{ credential_arn }}',
'{{ upstream_registry }}',
'{{ custom_role_arn }}',
'{{ upstream_repository_prefix }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ecr.pull_through_cache_rules
WHERE
Identifier = '{{ ecr_repository_prefix }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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