public_repositories
Creates, updates, deletes or gets a public_repository resource or lists public_repositories in a region
Overview
| Name | public_repositories |
| Type | Resource |
| Description | The ``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*. |
| Id | awscc.ecr.public_repositories |
Fields
| Name | Datatype | Description |
|---|---|---|
repository_name | string | The name to use for the public 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, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see [Name Type](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_text | object | The JSON repository policy text to apply to the public repository. For more information, see [Amazon ECR Public repository policies](https://docs.aws.amazon.com/AmazonECR/latest/public/public-repository-policies.html) in the *Amazon ECR Public User Guide*. |
arn | string | |
repository_catalog_data | object | The details about the repository that are publicly visible in the Amazon ECR Public Gallery. For more information, see [Amazon ECR Public repository catalog data](https://docs.aws.amazon.com/AmazonECR/latest/public/public-repository-catalog-data.html) in the *Amazon ECR Public User Guide*. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
For more information, see AWS::ECR::PublicRepository.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, 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 data__Identifier = '<RepositoryName>';
INSERT example
Use the following StackQL query and manifest file to create a new public_repository resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ecr.public_repositories (
RepositoryName,
RepositoryPolicyText,
RepositoryCatalogData,
Tags,
region
)
SELECT
'{{ RepositoryName }}',
'{{ RepositoryPolicyText }}',
'{{ RepositoryCatalogData }}',
'{{ Tags }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ecr.public_repositories (
RepositoryName,
RepositoryPolicyText,
RepositoryCatalogData,
Tags,
region
)
SELECT
'{{ RepositoryName }}',
'{{ RepositoryPolicyText }}',
'{{ RepositoryCatalogData }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: public_repository
props:
- name: RepositoryName
value: '{{ RepositoryName }}'
- name: RepositoryPolicyText
value: {}
- name: RepositoryCatalogData
value:
RepositoryDescription: '{{ RepositoryDescription }}'
Architectures:
- '{{ Architectures[0] }}'
OperatingSystems:
- '{{ OperatingSystems[0] }}'
AboutText: '{{ AboutText }}'
UsageText: '{{ UsageText }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE example
/*+ delete */
DELETE FROM awscc.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:DescribeRepositories,
ecr-public:SetRepositoryPolicy,
ecr-public:DeleteRepositoryPolicy,
ecr-public:PutRepositoryCatalogData,
ecr-public:TagResource,
ecr-public:UntagResource
Delete
ecr-public:DeleteRepository
List
ecr-public:DescribeRepositories