Skip to content

Instantly share code, notes, and snippets.

@lesnuages
Created May 22, 2021 09:54
Show Gist options
  • Save lesnuages/72e35a6454654239b6a6f5e609e4ae18 to your computer and use it in GitHub Desktop.
Save lesnuages/72e35a6454654239b6a6f5e609e4ae18 to your computer and use it in GitHub Desktop.
ZSH function to extract key/values from vault and store them as environment variables. Relies on jq
function vault-env() {
source <(vault kv get --format json $1 | jq -r '.data.data| keys[] as $k | "export \($k)=\"\(.[$k])\""')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment