Skip to main content

repository_creation_templates

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

Overview

Namerepository_creation_templates
TypeResource
Idaws.ecr.repository_creation_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
applied_forarrayA list of enumerable Strings representing the repository creation scenarios that this template will apply towards. The supported scenarios are PULL_THROUGH_CACHE, REPLICATION, and CREATE_ON_PUSH
created_atstring (date-time)The date and time, in JavaScript date format, when the repository creation template was created.
custom_role_arnstringThe ARN of the role to be assumed by Amazon ECR. Amazon ECR will assume your supplied role when the customRoleArn is specified. When this field isn't specified, Amazon ECR will use the service-linked role for the repository creation template.
descriptionstringThe description associated with the repository creation template.
encryption_configurationobjectThe encryption configuration associated with the repository creation template.
image_tag_mutabilitystringThe tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten. (MUTABLE, IMMUTABLE, IMMUTABLE_WITH_EXCLUSION, MUTABLE_WITH_EXCLUSION)
image_tag_mutability_exclusion_filtersarrayA list of filters that specify which image tags are excluded from the repository creation template's image tag mutability setting.
lifecycle_policystringThe lifecycle policy to use for repositories created using the template.
prefixstringThe repository namespace prefix associated with the repository creation template. (pattern: <code>^([a-z0-9]+((.||__|-+)[a-z0-9]+)*(/[a-z0-9]+((.||__|-+)[a-z0-9]+))/?|ROOT)$</code>)
repository_policystringThe repository policy to apply to repositories created using the template. A repository policy is a permissions policy associated with a repository to control access permissions.
resource_tagsarrayThe metadata to apply to the repository to help you categorize and organize. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
updated_atstring (date-time)The date and time, in JavaScript date format, when the repository creation template was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_repository_creation_templatesselectregionReturns details about the repository creation templates in a registry. The prefixes request parameter can be used to return the details for a specific repository creation template.
create_repository_creation_templateinsertregion, prefix, appliedForCreates a repository creation template. This template is used to define the settings for repositories created by Amazon ECR on your behalf. For example, repositories created through pull through cache actions. For more information, see Private repository creation templates in the Amazon Elastic Container Registry User Guide.
update_repository_creation_templateupdateregion, prefixUpdates an existing repository creation template.
delete_repository_creation_templatedeleteregionDeletes a repository creation template.

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

Returns details about the repository creation templates in a registry. The prefixes request parameter can be used to return the details for a specific repository creation template.

SELECT
applied_for,
created_at,
custom_role_arn,
description,
encryption_configuration,
image_tag_mutability,
image_tag_mutability_exclusion_filters,
lifecycle_policy,
prefix,
repository_policy,
resource_tags,
updated_at
FROM aws.ecr.repository_creation_templates
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a repository creation template. This template is used to define the settings for repositories created by Amazon ECR on your behalf. For example, repositories created through pull through cache actions. For more information, see Private repository creation templates in the Amazon Elastic Container Registry User Guide.

INSERT INTO aws.ecr.repository_creation_templates (
prefix,
description,
encryptionConfiguration,
resourceTags,
imageTagMutability,
imageTagMutabilityExclusionFilters,
repositoryPolicy,
lifecyclePolicy,
appliedFor,
customRoleArn,
region
)
SELECT
'{{ prefix }}' /* required */,
'{{ description }}',
'{{ encryptionConfiguration }}',
'{{ resourceTags }}',
'{{ imageTagMutability }}',
'{{ imageTagMutabilityExclusionFilters }}',
'{{ repositoryPolicy }}',
'{{ lifecyclePolicy }}',
'{{ appliedFor }}' /* required */,
'{{ customRoleArn }}',
'{{ region }}'
RETURNING
registry_id,
repository_creation_template
;

UPDATE examples

Updates an existing repository creation template.

UPDATE aws.ecr.repository_creation_templates
SET
prefix = '{{ prefix }}',
description = '{{ description }}',
encryptionConfiguration = '{{ encryptionConfiguration }}',
resourceTags = '{{ resourceTags }}',
imageTagMutability = '{{ imageTagMutability }}',
imageTagMutabilityExclusionFilters = '{{ imageTagMutabilityExclusionFilters }}',
repositoryPolicy = '{{ repositoryPolicy }}',
lifecyclePolicy = '{{ lifecyclePolicy }}',
appliedFor = '{{ appliedFor }}',
customRoleArn = '{{ customRoleArn }}'
WHERE
region = '{{ region }}' --required
AND prefix = '{{ prefix }}' --required
RETURNING
registry_id,
repository_creation_template;

DELETE examples

Deletes a repository creation template.

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