Skip to content
This repository has been archived by the owner on Dec 21, 2018. It is now read-only.

Commit

Permalink
Merge pull request #12 from leozhad/master
Browse files Browse the repository at this point in the history
added CLI named profile support
  • Loading branch information
jpignata committed Apr 20, 2018
2 parents a22704d + 7b10213 commit 9882d15
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/deploy
Expand Up @@ -5,21 +5,22 @@ set -o errexit
days=${DAYS:-30}
schedule=${SCHEDULE:-rate(1 day)}
region=${REGION:-$(aws configure get region)}
profile=${AWS_PROFILE:default}

bucket_name="temp-lightsail-auto-snapshots-$(openssl rand -hex 8)"

aws s3 mb "s3://${bucket_name}" --region $region
aws --profile $profile s3 mb "s3://${bucket_name}" --region $region

aws cloudformation package \
aws --profile $profile cloudformation package \
--output-template-file deploy/output.yaml \
--template-file lightsail-auto-snapshots.yaml \
--s3-bucket="${bucket_name}"

aws cloudformation deploy \
aws --profile $profile cloudformation deploy \
--template-file deploy/output.yaml \
--stack-name LightsailAutoSnapshots \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides "RetentionDays=${days}" "Schedule=${schedule}" \
--region $region

aws s3 rb --force "s3://${bucket_name}" --region $region
aws --profile $profile s3 rb --force "s3://${bucket_name}" --region $region

0 comments on commit 9882d15

Please sign in to comment.