forked from carrier-io/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
destroyinfra.sh
11 lines (10 loc) · 887 Bytes
/
destroyinfra.sh
1
2
3
4
5
6
7
8
9
10
11
export GOOGLE_APPLICATION_CREDENTIALS=/installer/gcp_install/credentials.json
export AWS_DEFAULT_REGION=`grep -w "region" "/installer/aws_install/terraform.tfvars" | cut -d: -f2 | sed s/' '//g | sed s/'"'//g | sed s/','//g | sed s/'region='//g`
export AWS_ACCESS_KEY_ID=`grep -w "access_key" "/installer/aws_install/terraform.tfvars" | cut -d: -f2 | sed s/' '//g | sed s/'"'//g | sed s/','//g | sed s/'access_key='//g`
export AWS_SECRET_ACCESS_KEY=`grep -w "secret_key" "/installer/aws_install/terraform.tfvars" | cut -d: -f2 | sed s/' '//g | sed s/'"'//g | sed s/','//g | sed s/'secret_key='//g`
if [ -f ${GOOGLE_APPLICATION_CREDENTIALS} ] || [ ${AWS_SECRET_ACCESS_KEY} != "your_secret_key" ]; then
terraform destroy -auto-approve -no-color > /installer/static/status
else
cd /installer/azure_install
terraform destroy -auto-approve -no-color > /installer/static/status
fi