Created
May 22, 2021 09:54
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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