repositories
Creates, updates, deletes, gets or lists a repositories resource.
Overview
| Name | repositories |
| Type | Resource |
| Id | aws.ecr_public.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. |
registry_id | string | The Amazon Web Services account ID that's associated with the public 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/test. |
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 repositories that are in a public registry. | |
create_repository | insert | region, repositoryName | Creates a repository in a public registry. For more information, see Amazon ECR repositories in the Amazon Elastic Container Registry User Guide. | |
delete_repository | delete | region | 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. | |
batch_check_layer_availability | exec | region, repositoryName, layerDigests | 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. | |
batch_delete_image | exec | region, repositoryName, imageIds | Deletes 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_upload | exec | region, repositoryName, uploadId, layerDigests | Informs 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_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 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_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 (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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_repositories
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
- create_repository
- Manifest
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
;
# Description fields are for documentation purposes
- name: repositories
props:
- name: region
value: "{{ region }}"
description: Required parameter for the repositories resource.
- name: repositoryName
value: "{{ repositoryName }}"
description: |
The name to use for the repository. This appears publicly in the Amazon ECR Public Gallery. The repository name can be specified on its own (for example nginx-web-app) or prepended with a namespace to group the repository into a category (for example project-a/nginx-web-app).
- name: catalogData
description: |
The details about the repository that are publicly visible in the Amazon ECR Public Gallery.
value:
description: "{{ description }}"
architectures:
- "{{ architectures }}"
operatingSystems:
- "{{ operatingSystems }}"
logoImageBlob: "{{ logoImageBlob }}"
aboutText: "{{ aboutText }}"
usageText: "{{ usageText }}"
- name: tags
description: |
The metadata that you apply to each repository to help categorize and organize your repositories. Each tag consists of a key and an optional value. You define both of them. 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 }}"
DELETE examples
- delete_repository
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
- 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 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 }}"
}'
;
Deletes 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.
EXEC aws.ecr_public.repositories.batch_delete_image
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}",
"imageIds": "{{ imageIds }}"
}'
;
Informs 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.
EXEC aws.ecr_public.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 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.
EXEC aws.ecr_public.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 (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.
EXEC aws.ecr_public.repositories.upload_layer_part
@region='{{ region }}' --required
@@json=
'{
"registryId": "{{ registryId }}",
"repositoryName": "{{ repositoryName }}",
"uploadId": "{{ uploadId }}",
"partFirstByte": {{ partFirstByte }},
"partLastByte": {{ partLastByte }},
"layerPartBlob": "{{ layerPartBlob }}"
}'
;