Back to integrations
Using Dagster with Hashicorp Vault

Dagster Integration:
Using Dagster with Hashicorp Vault

Centrally manage credentials and certificates, then use them in your pipelines.

About this integration

Package for integrating Hashicorp Vault into Dagster so that you can securely manage tokens and passwords.

Installation

pip install dagster-hashicorp

Example

# See the Resources docs to learn more: https://docs.dagster.io/concepts/resources

from dagster import asset, repository, with_resources
from dagster_hashicorp.vault import vault_resource
import os

@asset(required_resource_keys={"vault"})
def example_asset(context):
    secret_data = context.resources.vault.read_secret(
        secret_path="secret/data/foo/bar"
    )
    context.log.debug(f"Secret: {secret_data}")


assets = with_resources(
    [example_asset],
    {"vault": vault_resource.configured({
        "url": "vault-host:8200",
        "auth_type": {"token": {"token": os.environ['VAULT_AUTH_TOKEN']}},
    })}
)

About Hashicorp Vault

HashiCorp provides open-source tools and commercial products that enable developers, operators and security professionals to provision, secure, run and connect cloud-computing infrastructure. HashiCorp Vault secures, stores, and tightly controls access to tokens, passwords, certificates, API keys, and other secrets in modern computing.


Community / Partner integration:

This integration was built and is maintained by a community user or a technology partner from outside of Dagster Labs.