Skip to content

Commit

Permalink
Setup env for LSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
switch180 committed Nov 15, 2024
1 parent e2c2ff5 commit 10384d6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions design-patterns/cloudformation/UserDataC9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ AWS_ACCOUNT_ID=$2
AWS_REGION=$3
WorkshopZIP="$4" # ${WorkshopZIP}"
DDB_REPLICATION_ROLE="$5" #!Sub echo ${DDBReplicationRole.Arn}
DB_USER="$6"
DB_PASSWORD="$7"

function log
{
Expand Down Expand Up @@ -52,12 +54,15 @@ output = json
EOF
#chmod 600 /home/ubuntu/.aws/config
cat >> /home/ubuntu/.bashrc <<EOF
PATH=$PATH:/usr/local/bin'
export PATH' >> /home/ubuntu/.bashrc
PATH=$PATH:/usr/local/bin
export PATH >> /home/ubuntu/.bashrc
EOF
cat >> /home/ubuntu/.bash_profile <<EOF
export AWS_ACCOUNT_ID="${AWS_ACCOUNT_ID}"
export AWS_REGION="${AWS_REGION}"
export AWS_DEFAULT_REGION="${AWS_REGION}"
export MYSQL_PASSWORD="${DB_PASSWORD}"
export MYSQL_USERNAME="${DB_USER}"
aws cloud9 update-environment --environment-id \$C9_PID --managed-credentials-action DISABLE --region $AWS_REGION &> /dev/null
rm -vf ${HOME}/.aws/credentials &> /dev/null
EOF
Expand Down

0 comments on commit 10384d6

Please sign in to comment.