repository_creation_templates
Creates, updates, deletes or gets a repository_creation_template resource or lists repository_creation_templates in a region
Overview
| Name | repository_creation_templates |
| Type | Resource |
| Description | The details of the repository creation template associated with the request. |
| Id | awscc.ecr.repository_creation_templates |
Fields
| Name | Datatype | Description |
|---|---|---|
prefix | string | The repository namespace prefix associated with the repository creation template. |
description | string | The description associated with the repository creation template. |
image_tag_mutability | string | The 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. |
image_tag_mutability_exclusion_filters | array | Defines the image tag mutability exclusion filters to apply when creating repositories from this template. These filters specify which image tags can override the repository's default image tag mutability setting. |
repository_policy | string | The 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. |
lifecycle_policy | string | The lifecycle policy to use for repositories created using the template. |
encryption_configuration | object | The encryption configuration associated with the repository creation template. |
resource_tags | array | The 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. |
applied_for | array | A list of enumerable Strings representing the repository creation scenarios that this template will apply towards. The two supported scenarios are PULL_THROUGH_CACHE and REPLICATION |
custom_role_arn | string | The 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. |
created_at | string | |
updated_at | string | |
region | string | AWS region. |
For more information, see AWS::ECR::RepositoryCreationTemplate.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | Prefix, AppliedFor, 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 properties from an individual repository_creation_template.
SELECT
region,
prefix,
description,
image_tag_mutability,
image_tag_mutability_exclusion_filters,
repository_policy,
lifecycle_policy,
encryption_configuration,
resource_tags,
applied_for,
custom_role_arn,
created_at,
updated_at
FROM awscc.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.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ecr.repository_creation_templates (
Prefix,
AppliedFor,
region
)
SELECT
'{{ Prefix }}',
'{{ AppliedFor }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ecr.repository_creation_templates (
Prefix,
Description,
ImageTagMutability,
ImageTagMutabilityExclusionFilters,
RepositoryPolicy,
LifecyclePolicy,
EncryptionConfiguration,
ResourceTags,
AppliedFor,
CustomRoleArn,
region
)
SELECT
'{{ Prefix }}',
'{{ Description }}',
'{{ ImageTagMutability }}',
'{{ ImageTagMutabilityExclusionFilters }}',
'{{ RepositoryPolicy }}',
'{{ LifecyclePolicy }}',
'{{ EncryptionConfiguration }}',
'{{ ResourceTags }}',
'{{ AppliedFor }}',
'{{ CustomRoleArn }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: repository_creation_template
props:
- name: Prefix
value: '{{ Prefix }}'
- name: Description
value: '{{ Description }}'
- name: ImageTagMutability
value: '{{ ImageTagMutability }}'
- name: ImageTagMutabilityExclusionFilters
value:
- ImageTagMutabilityExclusionFilterType: '{{ ImageTagMutabilityExclusionFilterType }}'
ImageTagMutabilityExclusionFilterValue: '{{ ImageTagMutabilityExclusionFilterValue }}'
- name: RepositoryPolicy
value: '{{ RepositoryPolicy }}'
- name: LifecyclePolicy
value: '{{ LifecyclePolicy }}'
- name: EncryptionConfiguration
value:
EncryptionType: '{{ EncryptionType }}'
KmsKey: '{{ KmsKey }}'
- name: ResourceTags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: AppliedFor
value:
- '{{ AppliedFor[0] }}'
- name: CustomRoleArn
value: '{{ CustomRoleArn }}'
DELETE example
/*+ delete */
DELETE FROM awscc.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