Skip to content

Instantly share code, notes, and snippets.

@timmow
Last active January 8, 2016 12:49
Show Gist options
  • Save timmow/de46d549a1c255b9b342 to your computer and use it in GitHub Desktop.
Save timmow/de46d549a1c255b9b342 to your computer and use it in GitHub Desktop.

Destroy

Hijack the cf-deployment container:

fly -t remote hijack -j "deploy-cloudfoundry/deploy-cf" sh

Now login to the microbosh instance

bosh target https://10.0.0.6:25555

username is admin, password is from bosh-secrets.yml inside the state bucket.

Check the existing deployments

bosh deployments

Then delete the cloudfoundry deployment

bosh delete deployment <DEPLOY_ENV>

exit the container.

Now hijack the cf-terraform container -

fly -t remote hijack -j "deploy-cloudfoundry/cf-terraform" sh

and find the build directory ( the only one in /tmp/build )

cd /tmp/build/<build directory>

source the terraform variables into the environment -

. terraform-variables/bosh.tfvars.sh
. terraform-variables/vpc.tfvars.sh
. terraform-variables/concourse.tfvars.sh

export AWS_DEFAULT_REGION=eu-west-1
export TF_VAR_AWS_ACCESS_KEY_ID=<access-key-id>
export TF_VAR_AWS_SECRET_ACCESS_KEY=<secret-access-key>

Then run terraform destroy -

cd paas-cf/terraform/cloudfoundry/
terraform destroy -force -var env=<DEPLOY_ENV> -state=../../../cf.tfstate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment