Skip to main content

registry_policies

Creates, updates, deletes or gets a registry_policy resource or lists registry_policies in a region

Overview

Nameregistry_policies
TypeResource
DescriptionThe 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*.
Idaws.ecr.registry_policies

Fields

NameDatatypeDescription
registry_idstringThe AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
policy_textobjectThe JSON policy text for your registry.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTPolicyText, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.ecr.registry_policies (
PolicyText,
region
)
SELECT
'{{ PolicyText }}',
'{{ region }}';

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