registry_policies
Creates, updates, deletes or gets a registry_policy
resource or lists registry_policies
in a region
Overview
Name | registry_policies |
Type | Resource |
Description | The AWS::ECR::RegistryPolicy resource creates or updates the permissions policy for a private registry.A private registry policy is used to specify permissions for another AWS-account and is used when configuring cross-account replication. For more information, see [Registry permissions](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry-permissions.html) in the *Amazon Elastic Container Registry User Guide*. |
Id | aws.ecr.registry_policies |
Fields
Name | Datatype | Description |
---|---|---|
registry_id | string | The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed. |
policy_text | object | The JSON policy text for your registry. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | PolicyText, 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 registry_policies
in a region.
SELECT
region,
registry_id,
policy_text
FROM aws.ecr.registry_policies
WHERE region = 'us-east-1';
Gets all properties from an individual registry_policy
.
SELECT
region,
registry_id,
policy_text
FROM aws.ecr.registry_policies
WHERE region = 'us-east-1' AND data__Identifier = '<RegistryId>';
INSERT
example
Use the following StackQL query and manifest file to create a new registry_policy
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ecr.registry_policies (
PolicyText,
region
)
SELECT
'{{ PolicyText }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ecr.registry_policies (
PolicyText,
region
)
SELECT
'{{ PolicyText }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: registry_policy
props:
- name: PolicyText
value: {}
DELETE
example
/*+ delete */
DELETE FROM aws.ecr.registry_policies
WHERE data__Identifier = '<RegistryId>'
AND region = 'us-east-1';
Permissions
To operate on the registry_policies
resource, the following permissions are required:
Create
ecr:GetRegistryPolicy,
ecr:PutRegistryPolicy
Read
ecr:GetRegistryPolicy
List
ecr:GetRegistryPolicy
Update
ecr:GetRegistryPolicy,
ecr:PutRegistryPolicy
Delete
ecr:DeleteRegistryPolicy