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.3
Entrypoint
Return Type
VaultKv
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@e126fb6646f1cefcf64ef872a72b5b7a13b224ee 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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee 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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee 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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee 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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee 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@e126fb6646f1cefcf64ef872a72b5b7a13b224ee 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
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 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
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 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
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 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
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 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)
}