Skip to content

S3

Bases: DuploResourceV3

Commands

apply

Apply a S3

Create or Update a S3 resource with Duplocloud cli.

CLI Usage

duploctl s3 apply -f 's3.yaml'
Contents of the s3.yaml file
Name: test-bucket
AllowPublicAccess: false
EnableVersioning: null
Region: us-west-2
Policies:
 - ssl

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 a S3 resource.

CLI Usage

duploctl s3 create -f 's3.yaml'
Contents of the s3.yaml file
Name: test-bucket
AllowPublicAccess: false
EnableVersioning: null
Region: us-west-2
Policies:
 - ssl

One liner example
echo """
Name: test-bucket
AllowPublicAccess: false
EnableVersioning: null
Region: us-west-2
Policies:
 - ssl
""" | duploctl s3 create -f -

Returns:

Name Type Description
message dict

Success message.

Raises:

Type Description
DuploError

If the resource could not be created.

Parameters:

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

delete

Delete an S3 bucket by name.

CLI Usage
duploctl s3 delete <name>

Returns:

Name Type Description
message dict

A success message.

Raises:

Type Description
DuploError

If the bucket could not be deleted.

Parameters:

name positional
The resource name
str

find

Find an S3 bucket by name.

Accepts either the short name (e.g. mybucket) or the full AWS bucket name (e.g. duploservices-tenant-mybucket-123456).

Resolution order
  1. Try the name as-is via the single-bucket GET endpoint.
  2. On 404, build the full name using the tenant prefix and AWS account ID, and retry the single-bucket GET.
  3. If still 404, raise DuploNotFound.
CLI Usage
duploctl s3 find <name>

Returns:

Name Type Description
bucket dict

The S3 bucket object.

Raises:

Type Description
DuploNotFound

If the bucket could not be found.

Parameters:

name positional
The resource name
str

list

Retrieve a List of S3 resources

cli usage
duploctl s3 list

Returns:

Name Type Description
list list

A list of S3.

update

Update an S3 bucket.

CLI Usage
duploctl s3 update -f 's3.yaml'

Returns:

Name Type Description
dict dict

The updated bucket details.

Raises:

Type Description
DuploError

If the bucket could not be updated.

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