Created
March 14, 2018 17:12
-
-
Save markround/c32580ac8df94af8381b0c786cdd83bc to your computer and use it in GitHub Desktop.
Terraform outputs to env vars
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
eval $(terraform output -json \ | |
| jq 'map_values(.value)' \ | |
| jq -r 'keys[] as $k | "\($k)='"'"'\(.[$k])'"'"'"' \ | |
| awk -F"=" '{l = $0; sub($1, "", l); print "export "toupper($1) l}' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment