-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteardown.sh
More file actions
executable file
·23 lines (15 loc) · 1.41 KB
/
teardown.sh
File metadata and controls
executable file
·23 lines (15 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
# Get Bucket Names from Stacks
TEMPLATES_BUCKET=$(aws cloudformation describe-stacks --stack-name batch-scgenomics-zone --query 'Stacks[].Outputs[?OutputKey==`TemplatesBucket`].OutputValue' --output text); echo ${TEMPLATES_BUCKET}
RESULTS_BUCKET=$(aws cloudformation describe-stacks --stack-name batch-scgenomics-pipeline --query 'Stacks[].Outputs[?OutputKey==`JobResultsBucket`].OutputValue' --output text); echo ${RESULTS_BUCKET}
# Clear Buckets
aws s3 rm --recursive s3://${TEMPLATES_BUCKET}/
aws s3 rm --recursive s3://${RESULTS_BUCKET}/
# Disable Termination Protection on Stacks
aws cloudformation update-termination-protection --no-enable-termination-protection --stack-name batch-scgenomics-tools
aws cloudformation update-termination-protection --no-enable-termination-protection --stack-name batch-scgenomics-pipeline
aws cloudformation update-termination-protection --no-enable-termination-protection --stack-name batch-scgenomics-zone
# Delete Stacks
aws cloudformation delete-stack --stack-name batch-scgenomics-tools; aws cloudformation wait stack-delete-complete --stack-name batch-scgenomics-tools
aws cloudformation delete-stack --stack-name batch-scgenomics-pipeline; aws cloudformation wait stack-delete-complete --stack-name batch-scgenomics-pipeline
aws cloudformation delete-stack --stack-name batch-scgenomics-zone; aws cloudformation wait stack-delete-complete --stack-name batch-scgenomics-zone