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.3Entrypoint
Return Type
VaultKv Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
func (m *MyModule) Example() *dagger.VaultKv {
return dag.
VaultKv()
}@function
def example() -> dagger.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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
addressfunc (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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
tokenfunc (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 getcommand option: mount
Return Type
String ! Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
mountfunc (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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
pathfunc (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 getoutput option: field
Return Type
String ! Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
fieldfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | String ! | - | Vault address |
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
new-for-address --address stringfunc (m *MyModule) Example(address string) *dagger.VaultKv {
return dag.
VaultKv().
NewForAddress(address)
}@function
def example(address: str) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| token | String ! | - | Vault access token used for login |
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
login --token stringfunc (m *MyModule) Example(token string) *dagger.VaultKv {
return dag.
VaultKv().
Login(token)
}@function
def example(token: str) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| mount | String ! | - | The path where the KV backend is mounted |
| path | String ! | - | path / key referencing the K/V secret |
| field | String ! | - | Print only the field with the given name |
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
get-kv --mount string --path string --field stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| mount | String ! | - | The path where the KV backend is mounted |
| path | String ! | - | path / key referencing the K/V secret |
| field | String ! | - | Field to be created |
| value | String ! | - | Value to be assigned |
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee call \
put-kv --mount string --path string --field string --value stringfunc (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)
}