Skip to main content
Version: 1.7.0

HashiCorpSecret

class HashiCorpSecret(path: str, name: str, vault: str = 'HASHICORP')

Bases: Secret

Categories: secret

Secrets class representing a secret stored in Hashicorp Vault.

Attributes: path (str): The path to the secret in Hashicorp Vault. name (str): The name of the secret in Hashicorp Vault. vault (str): If multiple vaults exist in the system, the name of the vault to use. When executing in the server, the URL and token associated to that specific vault will be used. The name can only contain uppercase letters, numbers and underscores, and can't begin with a number. Defaults to "HASHICORP".

Methods: to_dict() -> dict: Convert the HashiCorpSecret object to a dictionary. secret_value() -> str: Get the secret value.

Initialize the HashiCorpSecret object.

Parameters

parameter
pathstr

The path to the secret in Hashicorp Vault.

parameter
namestr

The name of the secret in Hashicorp Vault.

parameter
vaultstr, optional

If multiple vaults exist in the system, the name of the vault to use. When executing in the server, the URL and token associated to that specific vault will be used. The name can only contain uppercase letters, numbers and underscores, and can't begin with a number. Defaults to "HASHICORP".

Properties

property
secret_valuestr

Get the secret value pointed at by the secret. To be used only during execution in the backend.

Returns: str: The secret value.

property
vaultstr