-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6874d2f
commit 17f45b0
Showing
7 changed files
with
70 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TF_VAR_aws_profile=asics-digital | ||
AWS_PROFILE=asics-digital | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_SDK_LOAD_CONFIG=1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# shellcheck shell=bash | ||
if [[ -f .env ]]; then | ||
dotenv | ||
fi | ||
|
||
|
||
# auth against Vault if configured | ||
if has vault; then | ||
if [[ "$VAULT_ADDR" && "$VAULT_AUTH_GITHUB_TOKEN" ]]; then | ||
log_status "vault: are we already authenticated?" | ||
vault token lookup -format=json > /dev/null && vault token renew -format=json > /dev/null | ||
|
||
if [[ "$?" == "0" ]]; then | ||
log_status "vault: authenticated with existing token!" | ||
else | ||
log_status "vault: authenticate, since our token could not be refreshed" | ||
vault login -method=github -no-print | ||
log_status "vault: authenticated with new token!" | ||
fi | ||
fi | ||
fi | ||
|
||
function get_vault_kv { | ||
vault_path=$1 | ||
vault_key=${2:-value} | ||
if [[ "$VAULT_ADDR" ]]; then | ||
VAULT_KV=$(curl -s -H "X-Vault-Token: $(cat ~/.vault-token )" -X GET $VAULT_ADDR/v1/${vault_path} | jq -r .data.${vault_key}) | ||
fi | ||
} | ||
|
||
# vim: set et fenc=utf-8 ff=unix ft=sh sts=2 sw=2 ts=2 : |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.12.17 |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |