Skip to main content

public_repositories

Creates, updates, deletes or gets a public_repository resource or lists public_repositories in a region

Overview

Namepublic_repositories
TypeResource
DescriptionThe ``AWS::ECR::PublicRepository`` resource specifies an Amazon Elastic Container Registry Public (Amazon ECR Public) repository, where users can push and pull Docker images, Open Container Initiative (OCI) images, and OCI compatible artifacts. For more information, see [Amazon ECR public repositories](https://docs.aws.amazon.com/AmazonECR/latest/public/public-repositories.html) in the *Amazon ECR Public User Guide*.
Idawscc.ecr.public_repositories

Fields

NameDatatypeDescription
repository_namestringThe name to use for the public repository. The repository name may be specified on its own (such as &#96;&#96;nginx-web-app&#96;&#96;) or it can be prepended with a namespace to group the repository into a category (such as &#96;&#96;project-a/nginx-web-app&#96;&#96;). If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see &#91;Name Type&#93;(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html).<br />If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
repository_policy_textobjectThe JSON repository policy text to apply to the public repository. For more information, see &#91;Amazon ECR Public repository policies&#93;(https://docs.aws.amazon.com/AmazonECR/latest/public/public-repository-policies.html) in the &#42;Amazon ECR Public User Guide&#42;.
arnstring
repository_catalog_dataobjectThe details about the repository that are publicly visible in the Amazon ECR Public Gallery. For more information, see &#91;Amazon ECR Public repository catalog data&#93;(https://docs.aws.amazon.com/AmazonECR/latest/public/public-repository-catalog-data.html) in the &#42;Amazon ECR Public User Guide&#42;.
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

For more information, see AWS::ECR::PublicRepository.

Methods

NameResourceAccessible byRequired Params
create_resourcepublic_repositoriesINSERTregion
delete_resourcepublic_repositoriesDELETEIdentifier, region
update_resourcepublic_repositoriesUPDATEIdentifier, PatchDocument, region
list_resourcespublic_repositories_list_onlySELECTregion
get_resourcepublic_repositoriesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual public_repository.

SELECT
region,
repository_name,
repository_policy_text,
arn,
repository_catalog_data,
tags
FROM awscc.ecr.public_repositories
WHERE
region = 'us-east-1' AND
Identifier = '{{ repository_name }}';

INSERT example

Use the following StackQL query and manifest file to create a new public_repository resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ecr.public_repositories (
RepositoryName,
RepositoryPolicyText,
RepositoryCatalogData,
Tags,
region
)
SELECT
'{{ repository_name }}',
'{{ repository_policy_text }}',
'{{ repository_catalog_data }}',
'{{ tags }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a public_repository resource, using stack-deploy.

/*+ update */
UPDATE awscc.ecr.public_repositories
SET PatchDocument = string('{{ {
"RepositoryPolicyText": repository_policy_text,
"RepositoryCatalogData": repository_catalog_data,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ repository_name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ecr.public_repositories
WHERE
Identifier = '{{ repository_name }}' AND
region = 'us-east-1';

Permissions

To operate on the public_repositories resource, the following permissions are required:

ecr-public:CreateRepository,
ecr-public:SetRepositoryPolicy,
ecr-public:PutRepositoryCatalogData,
ecr-public:TagResource