Skip to main content

repositories

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

Overview

Namerepositories
TypeResource
Idaws.ecr_public.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.
registry_idstringThe Amazon Web Services account ID that's associated with the public 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/test.
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 repositories that are in a public registry.
create_repositoryinsertregion, repositoryNameCreates a repository in a public registry. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide.
delete_repositorydeleteregionDeletes a repository in a public registry. If the repository contains images, you must either manually delete all images in the repository or use the force option. This option deletes all images on your behalf before deleting the repository.
batch_check_layer_availabilityexecregion, repositoryName, layerDigestsChecks the availability of one or more image layers that are within a repository in a public registry. 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 that are within a repository in a public registry. 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 digest of the image in your request.
complete_layer_uploadexecregion, repositoryName, uploadId, layerDigestsInforms Amazon ECR that the image layer upload is complete for a specified public 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 for each new image layer to verify that the upload is complete. 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 for each image layer that hasn't already been uploaded. Whether an image layer uploads 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 (about 20MB). The UploadLayerPart API is called once for 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 repositories that are in a public registry.

SELECT
created_at,
registry_id,
repository_arn,
repository_name,
repository_uri
FROM aws.ecr_public.repositories
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a repository in a public registry. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide.

INSERT INTO aws.ecr_public.repositories (
repositoryName,
catalogData,
tags,
region
)
SELECT
'{{ repositoryName }}' /* required */,
'{{ catalogData }}',
'{{ tags }}',
'{{ region }}'
RETURNING
catalog_data,
repository
;

DELETE examples

Deletes a repository in a public registry. If the repository contains images, you must either manually delete all images in the repository or use the force option. This option deletes all images on your behalf before deleting the repository.

DELETE FROM aws.ecr_public.repositories
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Checks the availability of one or more image layers that are within a repository in a public registry. 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_public.repositories.batch_check_layer_availability
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}",
"layerDigests": "{{ layerDigests }}"
}'
;