Skip to content

ECR

Bases: DuploResourceV3

Manage AWS ECR Repository resources.

Provides commands to create, find, list, update, and delete Elastic Container Registry (ECR) repositories within a tenant.

Read more at: https://docs.duplocloud.com/docs/overview/aws-services/ecr

Commands

apply

Apply a ECR

Create or Update a ECR resource with Duplocloud cli.

CLI Usage

duploctl ecr apply -f 'ecr.yaml'
Contents of the ecr.yaml file
Name: duploctl-test
EnableTagImmutability: false
EnableScanImageOnPush: false

Returns:

Name Type Description
message dict

Success message.

Parameters:

--file, -f, --cli-input
A file to read the input from
FileType('r') action: YamlAction
--patches, --add, --remove, --copy, --replace, --test, --move
The json patch to apply
str action: JsonPatchAction

create

Create an ECR repository.

CLI Usage

duploctl ecr create -f ecr.yaml
Contents of the ecr.yaml file
Name: duploctl-test
EnableTagImmutability: false
EnableScanImageOnPush: false

Returns:

Name Type Description
resource dict

The created ECR repository object.

Raises:

Type Description
DuploError

If the repository could not be created.

Parameters:

--file, -f, --cli-input
A file to read the input from
FileType('r') action: YamlAction

delete

Delete a ECR resource by name.

cli usage
duploctl ecr delete <name>

Returns:

Name Type Description
message dict

A success message.

Raises:

Type Description
DuploError

If the {{kind}} resource could not be found or deleted.

Parameters:

name positional
The resource name
str

find

Find an ECR repository by name.

CLI Usage
duploctl ecr find <name>

Returns:

Name Type Description
resource dict

The ECR repository object.

Raises:

Type Description
DuploError

If the repository could not be found.

Parameters:

name positional
The resource name
str

list

List all ECR repositories for the tenant.

CLI Usage
duploctl ecr list

Returns:

Name Type Description
list list

A list of ECR repository objects.

update

Update a V3 resource by name.

Returns:

Name Type Description
message

Success message.

Raises:

Type Description
DuploError

If the resource could not be created.

Parameters:

name positional
The resource name
str
--file, -f, --cli-input
A file to read the input from
FileType('r') action: YamlAction
--patches, --add, --remove, --copy, --replace, --test, --move
The json patch to apply
str action: JsonPatchAction

Methods

name_from_body

Extract the repository name from a response body.