Databricks Secret Scope
HashiCorpVaultSecrets
Bases: SecretsInterface
Retrieves and creates/updates secrets in a Hashicorp Vault. For more information about Hashicorp Vaults, see here.
Example
# Retrieves Secrets from HashiCorp Vault
from rtdip_sdk.pipelines.secrets import HashiCorpVaultSecrets
get_hashicorp_secret = HashiCorpVaultSecrets(
vault="http://127.0.0.1:8200",
key="{KEY}",
secret=None,
credential="{CREDENTIAL}",
kwargs=None
)
get_hashicorp_secret.get()
# Creates or Updates Secrets in Hashicorp Vault
from rtdip_sdk.pipelines.secrets import HashiCorpVaultSecrets
set_hashicorp_secret = AzureKeyVaultSecrets(
vault="http://127.0.0.1:8200",
key="{KEY}",
secret="{SECRET-TO-BE-SET}",
credential="{CREDENTIAL}",
kwargs=None
)
set_hashicorp_secret.set()
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vault |
str
|
Hashicorp Vault URL |
required |
key |
str
|
Name/Key of the secret in the Hashicorp Vault |
required |
secret |
str
|
Secret or Password to be stored in the Hashicorp Vault |
None
|
credential |
str
|
Token for authentication with the Hashicorp Vault |
None
|
kwargs |
dict
|
List of additional parameters to be passed when creating a Hashicorp Vault Client. Please see here for more details on parameters that can be provided to the client |
{}
|
Source code in src/sdk/python/rtdip_sdk/pipelines/secrets/hashicorp_vault.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
system_type()
staticmethod
Attributes:
Name | Type | Description |
---|---|---|
SystemType |
Environment
|
Requires PYTHON |
Source code in src/sdk/python/rtdip_sdk/pipelines/secrets/hashicorp_vault.py
87 88 89 90 91 92 93 |
|
get()
Retrieves the secret from the Hashicorp Vault
Source code in src/sdk/python/rtdip_sdk/pipelines/secrets/hashicorp_vault.py
108 109 110 111 112 113 |
|
set()
Creates or updates a secret in the Hashicorp Vault
Source code in src/sdk/python/rtdip_sdk/pipelines/secrets/hashicorp_vault.py
115 116 117 118 119 120 121 122 123 |
|