Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save josephsindel/fc3b3e140fbd9b6e3fd27ca07e2b5522 to your computer and use it in GitHub Desktop.
Save josephsindel/fc3b3e140fbd9b6e3fd27ca07e2b5522 to your computer and use it in GitHub Desktop.
#!/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