repository_creation_templates
Creates, updates, deletes, gets or lists a repository_creation_templates resource.
Overview
| Name | repository_creation_templates |
| Type | Resource |
| Id | aws.ecr.repository_creation_templates |
Fields
The following fields are returned by SELECT queries:
- describe_repository_creation_templates
| Name | Datatype | Description |
|---|---|---|
applied_for | array | A 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_at | string (date-time) | The date and time, in JavaScript date format, when the repository creation template was created. |
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. |
description | string | The description associated with the repository creation template. |
encryption_configuration | object | The encryption configuration 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. (MUTABLE, IMMUTABLE, IMMUTABLE_WITH_EXCLUSION, MUTABLE_WITH_EXCLUSION) |
image_tag_mutability_exclusion_filters | array | A list of filters that specify which image tags are excluded from the repository creation template's image tag mutability setting. |
lifecycle_policy | string | The lifecycle policy to use for repositories created using the template. |
prefix | string | The 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_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. |
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. |
updated_at | string (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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_repository_creation_templates | select | region | 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. | |
create_repository_creation_template | insert | region, prefix, appliedFor | 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. | |
update_repository_creation_template | update | region, prefix | Updates an existing repository creation template. | |
delete_repository_creation_template | delete | region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_repository_creation_templates
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
- create_repository_creation_template
- Manifest
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
;
# Description fields are for documentation purposes
- name: repository_creation_templates
props:
- name: region
value: "{{ region }}"
description: Required parameter for the repository_creation_templates resource.
- name: prefix
value: "{{ prefix }}"
description: |
The repository namespace prefix to associate with the template. All repositories created using this namespace prefix will have the settings defined in this template applied. For example, a prefix of prod would apply to all repositories beginning with prod/. Similarly, a prefix of prod/team would apply to all repositories beginning with prod/team/. To apply a template to all repositories in your registry that don't have an associated creation template, you can use ROOT as the prefix. There is always an assumed / applied to the end of the prefix. If you specify ecr-public as the prefix, Amazon ECR treats that as ecr-public/. When using a pull through cache rule, the repository prefix you specify during rule creation is what you should specify as your repository creation template prefix as well.
- name: description
value: "{{ description }}"
description: |
A description for the repository creation template.
- name: encryptionConfiguration
description: |
The encryption configuration to use for repositories created using the template.
value:
encryptionType: "{{ encryptionType }}"
kmsKey: "{{ kmsKey }}"
- name: resourceTags
description: |
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.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: imageTagMutability
value: "{{ imageTagMutability }}"
description: |
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.
valid_values: ['MUTABLE', 'IMMUTABLE', 'IMMUTABLE_WITH_EXCLUSION', 'MUTABLE_WITH_EXCLUSION']
- name: imageTagMutabilityExclusionFilters
description: |
A list of filters that specify which image tags should be excluded from the repository creation template's image tag mutability setting.
value:
- filterType: "{{ filterType }}"
filter: "{{ filter }}"
- name: repositoryPolicy
value: "{{ repositoryPolicy }}"
description: |
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.
- name: lifecyclePolicy
value: "{{ lifecyclePolicy }}"
description: |
The lifecycle policy to use for repositories created using the template.
- name: appliedFor
value:
- "{{ appliedFor }}"
description: |
A list of enumerable strings representing the Amazon ECR repository creation scenarios that this template will apply towards. The supported scenarios are PULL_THROUGH_CACHE, REPLICATION, and CREATE_ON_PUSH
- name: customRoleArn
value: "{{ customRoleArn }}"
description: |
The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as the registry that you are configuring. 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.
UPDATE examples
- update_repository_creation_template
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
- delete_repository_creation_template
Deletes a repository creation template.
DELETE FROM aws.ecr.repository_creation_templates
WHERE region = '{{ region }}' --required
;