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 in the Amazon ECR Public User Guide. |
| Id | awscc.ecr.public_repositories |
Fields
- get (all properties)
- list (identifiers only)
| 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 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 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 in the Amazon ECR Public User Guide. |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| 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 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. |
region | string | AWS region. |
For more information, see AWS::ECR::PublicRepository.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | public_repositories | INSERT | region |
delete_resource | public_repositories | DELETE | Identifier, region |
update_resource | public_repositories | UPDATE | Identifier, PatchDocument, region |
list_resources | public_repositories_list_only | SELECT | region |
get_resource | public_repositories | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = '{{ region }}' AND
Identifier = '{{ repository_name }}';
Lists all public_repositories in a region.
SELECT
region,
repository_name
FROM awscc.ecr.public_repositories_list_only
WHERE
region = '{{ region }}';
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
'{{ repository_name }}',
'{{ repository_policy_text }}',
'{{ repository_catalog_data }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.ecr.public_repositories (
RepositoryName,
RepositoryPolicyText,
RepositoryCatalogData,
Tags,
region
)
SELECT
'{{ repository_name }}',
'{{ repository_policy_text }}',
'{{ repository_catalog_data }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: public_repository
props:
- name: repository_name
value: '{{ repository_name }}'
- name: repository_policy_text
value: {}
- name: repository_catalog_data
value:
repository_description: '{{ repository_description }}'
architectures:
- '{{ architectures[0] }}'
operating_systems:
- '{{ operating_systems[0] }}'
about_text: '{{ about_text }}'
usage_text: '{{ usage_text }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.ecr.public_repositories
WHERE
Identifier = '{{ repository_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the public_repositories resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
ecr-public:CreateRepository,
ecr-public:SetRepositoryPolicy,
ecr-public:PutRepositoryCatalogData,
ecr-public:TagResource
ecr-public:DescribeRepositories,
ecr-public:GetRepositoryPolicy,
ecr-public:GetRepositoryCatalogData,
ecr-public:ListTagsForResource
ecr-public:DescribeRepositories,
ecr-public:SetRepositoryPolicy,
ecr-public:DeleteRepositoryPolicy,
ecr-public:PutRepositoryCatalogData,
ecr-public:TagResource,
ecr-public:UntagResource
ecr-public:DeleteRepository
ecr-public:DescribeRepositories