AwsSecret
Bases: DuploResourceV3
AWS Secrets Manager Secrets resource.
This resource allows you to create, find, update, and delete AWS Secrets Manager secrets.
Manages AWS Secrets Manager in the background.
Commands
apply
Apply a AwsSecret
Create or Update a AwsSecret resource with Duplocloud cli.
CLI Usage
Contents of theawssecret.yaml file
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Success message. |
Parameters:
--file, -f, --cli-input
--patches, --add, --remove, --copy, --replace, --test, --move
create
Create an AWS Secrets Manager Secret
Using DuploCloud's native support for AWS Secrets Manager, you can create a new secret. This method acts and feels like how the Kubernetes secrets work within this cli. Supports the secrets value as a string or a key/value JSON object where each value is a string. If you give a JSON object with any key that is not a string, the entire value will be simply a string with a JSON value. The examples below mostly include the --dry-run so you can see the output. Simply remove that to actually create the secret.
Create a secret from a datamap
Merge a body with new keys
Notice the the --file flag is set to - which means it will read a body file from stdin. Since a name is given, the name in the body file will be replaced with the name given in the command.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Either a success message is returned or if --dry-run is passed then the body is what is returned. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the AWS secret already exists. |
Parameters:
name
positional
--file, -f, --cli-input
--fromfile, --from-file, --from-literal
--parametervalue, -pval, -val, --value
--dryrun, --dry-run
delete
find
Find an AWS Secrets Manager secret by name and return its content
Returns:
| Name | Type | Description |
|---|---|---|
resource |
dict
|
The AWS secret object. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the AWS secret could not be found. |
Parameters:
name
positional
--showsensitive, -show
list
Retrieve a List of AwsSecret resources
Returns:
| Name | Type | Description |
|---|---|---|
list |
list
|
A list of AwsSecret. |
update
Update an AWS Secrets Manager secret.
Follows all the same arguments and style of the create method. This requires the secret to already exist.
Returns:
| Name | Type | Description |
|---|---|---|
message |
dict
|
Either a success message is returned or if --dry-run is passed then the body is what is returned. |
Raises:
| Type | Description |
|---|---|
DuploError
|
If the AWS secret could not be found or doesn't exist. |
Parameters:
name
positional
--file, -f, --cli-input
--fromfile, --from-file, --from-literal
--parametervalue, -pval, -val, --value
--dryrun, --dry-run
Methods
name_from_body
prefixed_name
Override to handle slash-separated secret paths.