Created
March 18, 2020 22:18
-
-
Save josephsindel/fc3b3e140fbd9b6e3fd27ca07e2b5522 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
MAC=$(curl -s http://169.254.169.254/latest/meta-data/mac/) | |
VPCID=$(curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MAC}/vpc-id/) | |
if [[ $VPCID == vpc-fd264e9b ]] | |
then | |
export ENV=prod | |
else | |
export ENV=qa | |
fi | |
export MB_DB_PASS=$(aws ssm get-parameter --with-decryption --name "${ENV}-metabase-db-pass" --query Parameter --region us-east-1 | jq '.Value' --raw-output) | |
export MB_DB_HOST=$(aws ssm get-parameter --name "${ENV}-metabase-db-endpoint" --query Parameter --region us-east-1| jq '.Value' --raw-output) | |
render /etc/default/metabase |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment