forked from transcom/mymove
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.envrc.chamber.template
16 lines (13 loc) · 998 Bytes
/
.envrc.chamber.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /usr/bin/env bash
#############################
# Load Secrets from Chamber #
#############################
# Secrets should also be added to chamber with `DISABLE_AWS_VAULT_WRAPPER=1 AWS_REGION=us-gov-west-1 aws-vault exec transcom-gov-dev -- chamber write app-devlocal lower_case_version secret_key`
# This line grabs any available secrets in app-devlocal and adds them to the environment.
# Lines that begin with `require ...` should still run to verify the secret is set.
if ! DISABLE_AWS_VAULT_WRAPPER=1 AWS_REGION=us-gov-west-1 aws-vault exec transcom-gov-dev -- chamber list app-devlocal --retries=1 > /dev/null ; then
log_error "Unable to access app-devlocal variables with chamber."
log_error "Login to chamber with 'DISABLE_AWS_VAULT_WRAPPER=1 AWS_REGION=us-gov-west-1 aws-vault exec transcom-gov-dev -- chamber list app-devlocal'."
else
eval "$(DISABLE_AWS_VAULT_WRAPPER=1 AWS_REGION=us-gov-west-1 aws-vault exec transcom-gov-dev -- chamber env app-devlocal --retries=1)"
fi