repositories
Creates, updates, deletes, gets or lists a repositories resource.
Overview
| Name | repositories |
| Type | Resource |
| Id | aws.ecr.repositories |
Fields
The following fields are returned by SELECT queries:
- describe_repositories
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The date and time, in JavaScript date format, when the repository was created. |
encryption_configuration | object | The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest. |
image_scanning_configuration | object | The image scanning configuration for a repository. |
image_tag_mutability | string | The tag mutability setting for the repository. (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's image tag mutability setting. |
registry_id | string | The Amazon Web Services account ID associated with the registry that contains the repository. (pattern: <code>[0-9]{12}</code>) |
repository_arn | string | The Amazon Resource Name (ARN) that identifies the repository. The ARN contains the arn:aws:ecr namespace, followed by the region of the repository, Amazon Web Services account ID of the repository owner, repository namespace, and repository name. For example, arn:aws:ecr:region:012345678910:repository-namespace/repository-name. |
repository_name | string | The name of the repository. (pattern: <code>[a-z0-9]+((.||__|-+)[a-z0-9]+)*(/[a-z0-9]+((.||__|-+)[a-z0-9]+))</code>) |
repository_uri | string | The URI for the repository. You can use this URI for container image push and pull operations. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_repositories | select | region | Describes image repositories in a registry. | |
create_repository | insert | region, repositoryName | Creates a repository. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide. | |
delete_repository | delete | region | Deletes a repository. If the repository isn't empty, you must either delete the contents of the repository or use the force option to delete the repository and have Amazon ECR delete all of its contents on your behalf. | |
batch_check_layer_availability | exec | region, repositoryName, layerDigests | Checks the availability of one or more image layers in a repository. When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images. | |
batch_delete_image | exec | region, repositoryName, imageIds | Deletes a list of specified images within a repository. Images are specified with either an imageTag or imageDigest. You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository. You can completely delete an image (and all of its tags) by specifying the image's digest in your request. | |
complete_layer_upload | exec | region, repositoryName, uploadId, layerDigests | Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID. You can optionally provide a sha256 digest of the image layer for data validation purposes. When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images. | |
initiate_layer_upload | exec | region, repositoryName | Notifies Amazon ECR that you intend to upload an image layer. When an image is pushed, the InitiateLayerUpload API is called once per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images. | |
upload_layer_part | exec | region, repositoryName, uploadId, partFirstByte, partLastByte, layerPartBlob | Uploads an image layer part to Amazon ECR. When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images. |
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_repositories
Describes image repositories in a registry.
SELECT
created_at,
encryption_configuration,
image_scanning_configuration,
image_tag_mutability,
image_tag_mutability_exclusion_filters,
registry_id,
repository_arn,
repository_name,
repository_uri
FROM aws.ecr.repositories
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_repository
- Manifest
Creates a repository. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide.
INSERT INTO aws.ecr.repositories (
registryId,
repositoryName,
tags,
imageTagMutability,
imageTagMutabilityExclusionFilters,
imageScanningConfiguration,
encryptionConfiguration,
region
)
SELECT
'{{ registryId }}',
'{{ repositoryName }}' /* required */,
'{{ tags }}',
'{{ imageTagMutability }}',
'{{ imageTagMutabilityExclusionFilters }}',
'{{ imageScanningConfiguration }}',
'{{ encryptionConfiguration }}',
'{{ region }}'
RETURNING
repository
;
# Description fields are for documentation purposes
- name: repositories
props:
- name: region
value: "{{ region }}"
description: Required parameter for the repositories resource.
- name: registryId
value: "{{ registryId }}"
description: |
The Amazon Web Services account ID associated with the registry to create the repository. If you do not specify a registry, the default registry is assumed.
- name: repositoryName
value: "{{ repositoryName }}"
description: |
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app). The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.
- name: tags
description: |
The metadata that you apply to the repository to help you categorize and organize them. 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's image tag mutability setting.
value:
- filterType: "{{ filterType }}"
filter: "{{ filter }}"
- name: imageScanningConfiguration
description: |
The imageScanningConfiguration parameter is being deprecated, in favor of specifying the image scanning configuration at the registry level. For more information, see PutRegistryScanningConfiguration. The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
value:
scanOnPush: {{ scanOnPush }}
- name: encryptionConfiguration
description: |
The encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
value:
encryptionType: "{{ encryptionType }}"
kmsKey: "{{ kmsKey }}"
DELETE examples
- delete_repository
Deletes a repository. If the repository isn't empty, you must either delete the contents of the repository or use the force option to delete the repository and have Amazon ECR delete all of its contents on your behalf.
DELETE FROM aws.ecr.repositories
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- batch_check_layer_availability
- batch_delete_image
- complete_layer_upload
- initiate_layer_upload
- upload_layer_part
Checks the availability of one or more image layers in a repository. When an image is pushed to a repository, each image layer is checked to verify if it has been uploaded before. If it has been uploaded, then the image layer is skipped. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.
EXEC aws.ecr.repositories.batch_check_layer_availability
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}",
"layerDigests": "{{ layerDigests }}"
}'
;
Deletes a list of specified images within a repository. Images are specified with either an imageTag or imageDigest. You can remove a tag from an image by specifying the image's tag in your request. When you remove the last tag from an image, the image is deleted from your repository. You can completely delete an image (and all of its tags) by specifying the image's digest in your request.
EXEC aws.ecr.repositories.batch_delete_image
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}",
"imageIds": "{{ imageIds }}"
}'
;
Informs Amazon ECR that the image layer upload has completed for a specified registry, repository name, and upload ID. You can optionally provide a sha256 digest of the image layer for data validation purposes. When an image is pushed, the CompleteLayerUpload API is called once per each new image layer to verify that the upload has completed. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.
EXEC aws.ecr.repositories.complete_layer_upload
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}",
"uploadId": "{{ uploadId }}",
"layerDigests": "{{ layerDigests }}"
}'
;
Notifies Amazon ECR that you intend to upload an image layer. When an image is pushed, the InitiateLayerUpload API is called once per image layer that has not already been uploaded. Whether or not an image layer has been uploaded is determined by the BatchCheckLayerAvailability API action. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.
EXEC aws.ecr.repositories.initiate_layer_upload
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}"
}'
;
Uploads an image layer part to Amazon ECR. When an image is pushed, each new image layer is uploaded in parts. The maximum size of each image layer part can be 20971520 bytes (or about 20MB). The UploadLayerPart API is called once per each new image layer part. This operation is used by the Amazon ECR proxy and is not generally used by customers for pulling and pushing images. In most cases, you should use the docker CLI to pull, tag, and push images.
EXEC aws.ecr.repositories.upload_layer_part
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}",
"uploadId": "{{ uploadId }}",
"partFirstByte": {{ partFirstByte }},
"partLastByte": {{ partLastByte }},
"layerPartBlob": "{{ layerPartBlob }}"
}'
;