Prefect HashiCorp Vault blocks.
Project description
prefect-vault
Welcome!
Prefect blocks for HashiCorp Vault.
Getting Started
Python setup
Requires an installation of Python 3.7+.
We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.
These tasks are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the Prefect documentation.
Installation
Install prefect-vault
with pip
:
pip install prefect-vault
Create VaultSecret block with token authentication
from prefect_vault import VaultSecret, VaultToken
vault_secret = VaultSecret(
vault_auth=VaultToken(
vault_url='http://myvault:8200',
token='my_secret_token',
),
)
await vault_secret.save('my-vault-secret')
Create VaultSecret block with approle authentication
from prefect_vault import VaultAppRole, VaultSecret
vault_secret = VaultSecret(
vault_auth=VaultAppRole(
vault_url='http://myvault:8200',
role_id='my_role_id',
secret_id='my_secret_id',
),
)
await vault_secret.save('my-vault-secret')
Use VaultSecret in Prefect flow
from prefect import flow
from prefect_vault import VaultSecret
@flow
async def use_vault_secret():
vault_secret = await VaultSecret.load('my-vault-secret')
secret_value = vault_secret.get_secret('path/to/my/secret')['secret_key']
Resources
If you encounter any bugs while using prefect-vault
, feel free to open an issue in the prefect-vault repository.
If you have any questions or issues while using prefect-vault
, you can find help in either the Prefect Discourse forum or the Prefect Slack community.
Development
If you'd like to install a version of prefect-vault
for development, clone the repository and perform an editable install with pip
:
git clone https://github.com/pbchekin/prefect-vault.git
cd prefect-vault/
pip install -e ".[dev]"
# Install linting pre-commit hooks
pre-commit install
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file prefect-vault-0.1.5.tar.gz
.
File metadata
- Download URL: prefect-vault-0.1.5.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae2f5065cb4889fc5b291902c99e6ab144e51e89bab5e2045129ebaec53744a8 |
|
MD5 | 782c18ca59649d6993c8ce7a8e2e1006 |
|
BLAKE2b-256 | e1f3f70e43357a5f099586aa1dde3dbd2b54902490ed8c9abc7f34abc0e38680 |
File details
Details for the file prefect_vault-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: prefect_vault-0.1.5-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f69d69e6799e2b94bd3163af738163f6e1396213c8aad6b87093a6f35b46b83a |
|
MD5 | e8f10e48af2aee7faceea054e8ea9984 |
|
BLAKE2b-256 | bf09ce6d049ae75337fdff8fdca6bb931ac62429ee887973cceec10f43c9ad78 |