Dagger
Search

vault-kv

This module uses the Vault commands (CLI) to communicate with the Vault instance.
The functions can be called from the dagger CLI or from one of the SDKs.

Check the original documentation: https://developer.hashicorp.com/vault/docs/commands/

Installation

dagger install github.com/puzzle/dagger-module-vault-kv/vault-kv@v0.9.2

Entrypoint

Return Type
VaultKv
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
func (m *myModule) example() *VaultKv  {
	return dag.
			VaultKv()
}
@function
def example() -> dag.VaultKv:
	return (
		dag.vault_kv()
	)
@func()
example(): VaultKv {
	return dag
		.vaultKv()
}

Types

VaultKv 🔗

Contains the Vault K/V command options.

address() 🔗

Vault address

Return Type
String !
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 address
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			VaultKv().
			Address(ctx)
}
@function
async def example() -> str:
	return await (
		dag.vault_kv()
		.address()
	)
@func()
async example(): Promise<string> {
	return dag
		.vaultKv()
		.address()
}

token() 🔗

Vault access token used for login

Return Type
String !
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 token
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			VaultKv().
			Token(ctx)
}
@function
async def example() -> str:
	return await (
		dag.vault_kv()
		.token()
	)
@func()
async example(): Promise<string> {
	return dag
		.vaultKv()
		.token()
}

mount() 🔗

kv get command option: mount

Return Type
String !
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 mount
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			VaultKv().
			Mount(ctx)
}
@function
async def example() -> str:
	return await (
		dag.vault_kv()
		.mount()
	)
@func()
async example(): Promise<string> {
	return dag
		.vaultKv()
		.mount()
}

path() 🔗

path / key referencing the K/V secret

Return Type
String !
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 path
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			VaultKv().
			Path(ctx)
}
@function
async def example() -> str:
	return await (
		dag.vault_kv()
		.path()
	)
@func()
async example(): Promise<string> {
	return dag
		.vaultKv()
		.path()
}

field() 🔗

kv get output option: field

Return Type
String !
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 field
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			VaultKv().
			Field(ctx)
}
@function
async def example() -> str:
	return await (
		dag.vault_kv()
		.field()
	)
@func()
async example(): Promise<string> {
	return dag
		.vaultKv()
		.field()
}

newForAddress() 🔗

Configure Vault address to connect to

Return Type
VaultKv !
Arguments
NameTypeDefault ValueDescription
addressString !-Vault address
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 new-for-address --address string
func (m *myModule) example(address string) *VaultKv  {
	return dag.
			VaultKv().
			NewForAddress(address)
}
@function
def example(address: str) -> dag.VaultKv:
	return (
		dag.vault_kv()
		.new_for_address(address)
	)
@func()
example(address: string): VaultKv {
	return dag
		.vaultKv()
		.newForAddress(address)
}

login() 🔗

Configure access token to be used for Vault login

Return Type
VaultKv !
Arguments
NameTypeDefault ValueDescription
tokenString !-Vault access token used for login
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 login --token string
func (m *myModule) example(token string) *VaultKv  {
	return dag.
			VaultKv().
			Login(token)
}
@function
def example(token: str) -> dag.VaultKv:
	return (
		dag.vault_kv()
		.login(token)
	)
@func()
example(token: string): VaultKv {
	return dag
		.vaultKv()
		.login(token)
}

getKv() 🔗

The kv get command retrieves the value from K/V secrets from Vault.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
mountString !-The path where the KV backend is mounted
pathString !-path / key referencing the K/V secret
fieldString !-Print only the field with the given name
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 get-kv --mount string --path string --field string
func (m *myModule) example(ctx context.Context, mount string, path string, field string) string  {
	return dag.
			VaultKv().
			GetKv(ctx, mount, path, field)
}
@function
async def example(mount: str, path: str, field: str) -> str:
	return await (
		dag.vault_kv()
		.get_kv(mount, path, field)
	)
@func()
async example(mount: string, path: string, field: string): Promise<string> {
	return dag
		.vaultKv()
		.getKv(mount, path, field)
}

putKv() 🔗

The kv put command creates a secret in Vault.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
mountString !-The path where the KV backend is mounted
pathString !-path / key referencing the K/V secret
fieldString !-Field to be created
valueString !-Value to be assigned
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e37733941af6517eb3a128a8d4782e240b5e559e call \
 put-kv --mount string --path string --field string --value string
func (m *myModule) example(ctx context.Context, mount string, path string, field string, value string) string  {
	return dag.
			VaultKv().
			PutKv(ctx, mount, path, field, value)
}
@function
async def example(mount: str, path: str, field: str, value: str) -> str:
	return await (
		dag.vault_kv()
		.put_kv(mount, path, field, value)
	)
@func()
async example(mount: string, path: string, field: string, value: string): Promise<string> {
	return dag
		.vaultKv()
		.putKv(mount, path, field, value)
}