Skip to main content

registry_policies

Creates, updates, deletes, gets or lists a registry_policies resource.

Overview

Nameregistry_policies
TypeResource
Idaws.ecr.registry_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
policy_textstringThe JSON text of the permissions policy for a registry.
registry_idstringThe registry ID associated with the request. (pattern: <code>[0-9]{12}</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_registry_policyselectregionRetrieves the permissions policy for a registry.
put_registry_policyreplaceregion, policyTextCreates or updates the permissions policy for your registry. A registry policy is used to specify permissions for another Amazon Web Services account and is used when configuring cross-account replication. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.
delete_registry_policydeleteregionDeletes the registry permissions policy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves the permissions policy for a registry.

SELECT
policy_text,
registry_id
FROM aws.ecr.registry_policies
WHERE region = '{{ region }}' -- required
;

REPLACE examples

Creates or updates the permissions policy for your registry. A registry policy is used to specify permissions for another Amazon Web Services account and is used when configuring cross-account replication. For more information, see Registry permissions in the Amazon Elastic Container Registry User Guide.

REPLACE aws.ecr.registry_policies
SET
policyText = '{{ policyText }}'
WHERE
region = '{{ region }}' --required
AND policyText = '{{ policyText }}' --required
RETURNING
policy_text,
registry_id;

DELETE examples

Deletes the registry permissions policy.

DELETE FROM aws.ecr.registry_policies
WHERE region = '{{ region }}' --required
;