vault-kv
Uses the Vault commands (CLI) to communicate with the Vault instance.Installation
dagger install github.com/puzzle/dagger-module-vault-kv/vault-kv@v0.9.0
Entrypoint
Return Type
VaultKv
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@c5bb4b439e7298ae42624062abb3d6324c9299ff 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 🔗
address() 🔗
Vault address
Return Type
String !
Example
dagger -m github.com/puzzle/dagger-module-vault-kv/vault-kv@c5bb4b439e7298ae42624062abb3d6324c9299ff 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@c5bb4b439e7298ae42624062abb3d6324c9299ff 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@c5bb4b439e7298ae42624062abb3d6324c9299ff 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@c5bb4b439e7298ae42624062abb3d6324c9299ff 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@c5bb4b439e7298ae42624062abb3d6324c9299ff 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@c5bb4b439e7298ae42624062abb3d6324c9299ff 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@c5bb4b439e7298ae42624062abb3d6324c9299ff 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@c5bb4b439e7298ae42624062abb3d6324c9299ff 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)
}