Skip to main content

repositories

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

Overview

Namerepositories
TypeResource
Idaws.ecr.repositories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The date and time, in JavaScript date format, when the repository was created.
encryption_configurationobjectThe encryption configuration for the repository. This determines how the contents of your repository are encrypted at rest.
image_scanning_configurationobjectThe image scanning configuration for a repository.
image_tag_mutabilitystringThe tag mutability setting for the repository. (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's image tag mutability setting.
registry_idstringThe Amazon Web Services account ID associated with the registry that contains the repository. (pattern: <code>[0-9]{12}</code>)
repository_arnstringThe 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_namestringThe name of the repository. (pattern: <code>[a-z0-9]+((.||__|-+)[a-z0-9]+)*(/[a-z0-9]+((.||__|-+)[a-z0-9]+))</code>)
repository_uristringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_repositoriesselectregionDescribes image repositories in a registry.
create_repositoryinsertregion, repositoryNameCreates a repository. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide.
delete_repositorydeleteregionDeletes 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_availabilityexecregion, repositoryName, layerDigestsChecks 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_imageexecregion, repositoryName, imageIdsDeletes 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_uploadexecregion, repositoryName, uploadId, layerDigestsInforms 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_uploadexecregion, repositoryNameNotifies 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_partexecregion, repositoryName, uploadId, partFirstByte, partLastByte, layerPartBlobUploads 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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

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
;

DELETE examples

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

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 }}"
}'
;