Skip to content

Commit

Permalink
added remove aws credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianobaez committed Jan 5, 2023
1 parent a7d317e commit 8a8883e
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,24 @@ if [[ ! -z "$PARAMETER_OVERRIDES" ]]; then
PARAMETER_OVERRIDES="--parameter-overrides $PARAMETER_OVERRIDES"
fi

aws configure --profile cloudformation-action <<-EOF
${AWS_ACCESS_KEY_ID}
${AWS_SECRET_ACCESS_KEY}
${AWS_REGION}
text
EOF

aws cloudformation package --profile cloudformation-action --template-file $TEMPLATE --output-template-file $TEMPLATEOUTPUT --s3-bucket $AWS_DEPLOY_BUCKET $AWS_BUCKET_PREFIX $FORCE_UPLOAD $USE_JSON
aws cloudformation deploy --profile cloudformation-action --template-file aws $TEMPLATEOUTPUT --stack-name $AWS_STACK_NAME $CAPABILITIES $PARAMETER_OVERRIDES
# if exist folder delete
if [ -d ~/.aws ]; then
rm -rf ~/.aws
fi

mkdir ~/.aws
touch ~/.aws/credentials
touch ~/.aws/config

echo "[default]
aws_access_key_id = $AWS_ACCESS_KEY_ID
aws_secret_access_key = $AWS_SECRET_ACCESS_KEY
region = $AWS_REGION" > ~/.aws/credentials

echo "[default]
output = text
region = $AWS_REGION" > ~/.aws/config

aws cloudformation package --template-file $TEMPLATE --output-template-file $TEMPLATEOUTPUT --s3-bucket $AWS_DEPLOY_BUCKET $AWS_BUCKET_PREFIX $FORCE_UPLOAD $USE_JSON
aws cloudformation deploy --template-file aws $TEMPLATEOUTPUT --stack-name $AWS_STACK_NAME $CAPABILITIES $PARAMETER_OVERRIDES

0 comments on commit 8a8883e

Please sign in to comment.