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
| Name | pull_through_cache_rules |
| Type | Resource |
| Description | The ``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. |
| Id | awscc.ecr.pull_through_cache_rules |
Fields
| Name | Datatype | Description |
|---|---|---|
ecr_repository_prefix | string | The Amazon ECR repository prefix associated with the pull through cache rule. |
upstream_registry_url | string | The upstream registry URL associated with the pull through cache rule. |
credential_arn | string | The ARN of the Secrets Manager secret associated with the pull through cache rule. |
upstream_registry | string | The name of the upstream source registry associated with the pull through cache rule. |
custom_role_arn | string | The ARN of the IAM role associated with the pull through cache rule. |
upstream_repository_prefix | string | The upstream repository prefix associated with the pull through cache rule. |
region | string | AWS region. |
For more information, see AWS::ECR::PullThroughCacheRule.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ecr.pull_through_cache_rules (
EcrRepositoryPrefix,
UpstreamRegistryUrl,
CredentialArn,
UpstreamRegistry,
CustomRoleArn,
UpstreamRepositoryPrefix,
region
)
SELECT
'{{ EcrRepositoryPrefix }}',
'{{ UpstreamRegistryUrl }}',
'{{ CredentialArn }}',
'{{ UpstreamRegistry }}',
'{{ CustomRoleArn }}',
'{{ UpstreamRepositoryPrefix }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ecr.pull_through_cache_rules (
EcrRepositoryPrefix,
UpstreamRegistryUrl,
CredentialArn,
UpstreamRegistry,
CustomRoleArn,
UpstreamRepositoryPrefix,
region
)
SELECT
'{{ EcrRepositoryPrefix }}',
'{{ UpstreamRegistryUrl }}',
'{{ CredentialArn }}',
'{{ UpstreamRegistry }}',
'{{ CustomRoleArn }}',
'{{ UpstreamRepositoryPrefix }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: pull_through_cache_rule
props:
- name: EcrRepositoryPrefix
value: '{{ EcrRepositoryPrefix }}'
- name: UpstreamRegistryUrl
value: '{{ UpstreamRegistryUrl }}'
- name: CredentialArn
value: '{{ CredentialArn }}'
- name: UpstreamRegistry
value: '{{ UpstreamRegistry }}'
- name: CustomRoleArn
value: '{{ CustomRoleArn }}'
- name: UpstreamRepositoryPrefix
value: '{{ UpstreamRepositoryPrefix }}'
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