Cloud Keys 2020 Python Edition

Questions / Feedback?

create_secret Method

Creates a new secret.

Syntax

def create_secret(secret_name: str, content_type: str) -> str: ...

Remarks

This method creates a new secret with the given SecretName. If a secret with the specified SecretName already exists, a new version of it is created. The version Id of the newly-created secret is returned.

The secret value is taken from the specified local_file or the secret_data property. If the encode_data property is enabled, the value will be base64-encoded before it is sent.

The value passed for SecretName must consist solely of alphanumeric characters and hyphens (-).

The ContentType parameter is optional, and can be set to any string value.

If there are any items in the Tag* properties, they will be applied to the newly-created secret. Secrets may have up to 15 tags.

The following configuration settings can also be used to send additional values when creating the secret, refer to their documentation for more information:

Note: If there is already a soft-deleted secret with the specified SecretName in the currently-selected vault, then a new secret cannot be created with the same name. To resolve such a situation, the soft-deleted secret would need to be recovered (using recover_secret) or permanently deleted (using purge_secret) first.

Copyright (c) 2022 /n software inc. - All rights reserved.
Cloud Keys 2020 Python Edition - Version 20.0 [Build 8157]