Skip to content

Latest commit

 

History

History
59 lines (53 loc) · 1.13 KB

README.md

File metadata and controls

59 lines (53 loc) · 1.13 KB

vaultenv

an opinionated and simple secrets to environment variable tool

the rules

  • only works with kv secret backend.
  • obey standard vault environment variable settings. (VAULT_ADDR, VAULT_TOKEN, etc)
  • all secrets must be valid environment key/value pairs. no additional translation is done.
  • kv pairs are merged left to right. left most kv pairs are the environment of vaultenv itself.
  • always uses the latest version of a secret.

installation

go get -u github.com/james-lawrence/vaultenv

command flags/options

vaultenv --help

quick start examples

assuming you've logged in to vault.

# given the following secrets
# runtime environment:
# PATH=/usr/bin
# FOO=bar1
# secret/key1:
# FOO=bar2
# BIZZ=BAZZ
# secret/key2:
# FOO=bar3
# HELLO=world
vaultenv secret/key1 secret/key2
# output:
# PATH=/usr/bin
# FOO=bar3
# BIZZ=BAZZ
# HELLO=world
# given the following secrets
# runtime environment:
# PATH=/usr/bin
# FOO=bar1
# secret/key1:
# FOO=bar2
# BIZZ=BAZZ
# secret/key2:
# FOO=bar3
# HELLO=world
vaultenv --clean secret/key1 secret/key2
# output:
# FOO=bar3
# BIZZ=BAZZ
# HELLO=world