Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active March 8, 2020 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/cf1163e94dcf9e51d03004d7d0c18dcb to your computer and use it in GitHub Desktop.
Save garystafford/cf1163e94dcf9e51d03004d7d0c18dcb to your computer and use it in GitHub Desktop.
# Get data bucket name
DATA_BUCKET=$(aws cloudformation describe-stacks \
--stack-name redshift-stack \
| jq -r '.Stacks[].Outputs[] | select(.OutputKey == "DataBucket") | .OutputValue')
echo ${DATA_BUCKET}
# Get log bucket name
LOG_BUCKET=$(aws cloudformation describe-stacks \
--stack-name redshift-stack \
| jq -r '.Stacks[].Outputs[] | select(.OutputKey == "LogBucket") | .OutputValue')
echo ${LOG_BUCKET}
# Delete demonstration resources
python3 ./scripts/delete_buckets.py
aws cloudformation delete-stack --stack-name kinesis-firehose-stack
# Wait for first stack to be deleted
aws cloudformation delete-stack --stack-name redshift-stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment