Description
HashiCorp Vault is an identity-based secrets and encryption management system for storing API encryption keys, passwords, and certificates.Examples
Dependency:
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>vault</artifactId>
<version>1.20.0</version>
<scope>test</scope>
</dependency>
Usage:
var vault = new VaultContainer<>(DockerImageName.parse("hashicorp/vault:1.13.0"));
vault.start();
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/vault
Usage:
vaultContainer, err := vault.Run(ctx,
"hashicorp/vault:1.13.0",
vault.WithToken("root-token"),
vault.WithInitCommand("secrets enable transit", "write -f transit/keys/my-key"),
vault.WithInitCommand("kv put secret/test1 foo1=bar1"),
)
Dependency:
pip install testcontainers[vault]
Usage:
with VaultContainer("hashicorp/vault:1.16.1") as vault_container:
connection_url = vault_container.get_connection_url()
client = hvac.Client(url=connection_url, token=vault_container.root_token)