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 Public Registry (Amazon Public ECR) repository, where users can push and pull Docker images. For more information, see https://docs.aws.amazon.com/AmazonECR
Idaws.ecr.public_repositories

Fields

NameDatatypeDescription
repository_namestringThe 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). If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the repository name. For more information, see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html.
repository_policy_textobjectThe JSON repository policy text to apply to the repository. For more information, see https://docs.aws.amazon.com/AmazonECR/latest/userguide/RepositoryPolicyExamples.html in the Amazon Elastic Container Registry User Guide.
arnstring
repository_catalog_dataobjectThe CatalogData property type specifies Catalog data for ECR Public Repository. For information about Catalog Data, see <link>
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all public_repositories in a region.

SELECT
region,
repository_name,
repository_policy_text,
arn,
repository_catalog_data,
tags
FROM aws.ecr.public_repositories
WHERE region = 'us-east-1';

Gets all properties from an individual public_repository.

SELECT
region,
repository_name,
repository_policy_text,
arn,
repository_catalog_data,
tags
FROM aws.ecr.public_repositories
WHERE region = 'us-east-1' AND data__Identifier = '<RepositoryName>';

INSERT example

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

/*+ create */
INSERT INTO aws.ecr.public_repositories (
RepositoryName,
RepositoryPolicyText,
RepositoryCatalogData,
Tags,
region
)
SELECT
'{{ RepositoryName }}',
'{{ RepositoryPolicyText }}',
'{{ RepositoryCatalogData }}',
'{{ Tags }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ecr.public_repositories
WHERE data__Identifier = '<RepositoryName>'
AND region = 'us-east-1';

Permissions

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

Create

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

Read

ecr-public:DescribeRepositories,
ecr-public:GetRepositoryPolicy,
ecr-public:GetRepositoryCatalogData,
ecr-public:ListTagsForResource

Update

ecr-public:SetRepositoryPolicy,
ecr-public:DeleteRepositoryPolicy,
ecr-public:PutRepositoryCatalogData,
ecr-public:TagResource,
ecr-public:UntagResource

Delete

ecr-public:DeleteRepository

List

ecr-public:DescribeRepositories