Skip to main content

repository_creation_templates

Creates, updates, deletes or gets a repository_creation_template resource or lists repository_creation_templates in a region

Overview

Namerepository_creation_templates
TypeResource
DescriptionAWS::ECR::RepositoryCreationTemplate is used to create repository with configuration from a pre-defined template.
Idaws.ecr.repository_creation_templates

Fields

NameDatatypeDescription
prefixstringThe prefix use to match the repository name and apply the template.
descriptionstringThe description of the template.
image_tag_mutabilitystringThe image tag mutability setting for the repository.
repository_policystringThe JSON repository policy text to apply to the repository. For more information, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/RepositoryPolicyExamples.html
lifecycle_policystringThe JSON lifecycle policy text to apply to the repository. For information about lifecycle policy syntax, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html
encryption_configurationobjectThe encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest. By default, when no encryption configuration is set or the AES256 encryption type is used, Amazon ECR uses server-side encryption with Amazon S3-managed encryption keys which encrypts your data at rest using an AES-256 encryption algorithm. This does not require any action on your part.
For more information, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html
resource_tagsarrayAn array of key-value pairs to apply to this resource.
applied_forarrayA list of enumerable Strings representing the repository creation scenarios that the template will apply towards.
custom_role_arnstringThe ARN of the role to be assumed by ECR. This role must be in the same account as the registry that you are configuring.
created_atstringCreate timestamp of the template.
updated_atstringUpdate timestamp of the template.
regionstringAWS region.

For more information, see AWS::ECR::RepositoryCreationTemplate.

Methods

NameAccessible byRequired Params
create_resourceINSERTPrefix, AppliedFor, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all repository_creation_templates in a region.

SELECT
region,
prefix,
description,
image_tag_mutability,
repository_policy,
lifecycle_policy,
encryption_configuration,
resource_tags,
applied_for,
custom_role_arn,
created_at,
updated_at
FROM aws.ecr.repository_creation_templates
WHERE region = 'us-east-1';

Gets all properties from an individual repository_creation_template.

SELECT
region,
prefix,
description,
image_tag_mutability,
repository_policy,
lifecycle_policy,
encryption_configuration,
resource_tags,
applied_for,
custom_role_arn,
created_at,
updated_at
FROM aws.ecr.repository_creation_templates
WHERE region = 'us-east-1' AND data__Identifier = '<Prefix>';

INSERT example

Use the following StackQL query and manifest file to create a new repository_creation_template resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ecr.repository_creation_templates (
Prefix,
AppliedFor,
region
)
SELECT
'{{ Prefix }}',
'{{ AppliedFor }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ecr.repository_creation_templates
WHERE data__Identifier = '<Prefix>'
AND region = 'us-east-1';

Permissions

To operate on the repository_creation_templates resource, the following permissions are required:

Create

ecr:CreateRepositoryCreationTemplate,
ecr:PutLifecyclePolicy,
ecr:SetRepositoryPolicy,
ecr:CreateRepository,
iam:CreateServiceLinkedRole,
iam:PassRole

Read

ecr:DescribeRepositoryCreationTemplates

Update

ecr:DescribeRepositoryCreationTemplates,
ecr:UpdateRepositoryCreationTemplate,
ecr:PutLifecyclePolicy,
ecr:SetRepositoryPolicy,
ecr:CreateRepository,
iam:CreateServiceLinkedRole,
iam:PassRole

Delete

ecr:DeleteRepositoryCreationTemplate

List

ecr:DescribeRepositoryCreationTemplates