From 8d4ea4ec67cb3ab353ec80ac22368dc0e95e3ac8 Mon Sep 17 00:00:00 2001 From: Antonio Lopez <94461129+ajlopezn@users.noreply.github.com> Date: Fri, 3 Jun 2022 13:06:46 +0200 Subject: [PATCH] Update CLEANUP.md --- fast/CLEANUP.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/fast/CLEANUP.md b/fast/CLEANUP.md index 952339bf..26adeaf9 100644 --- a/fast/CLEANUP.md +++ b/fast/CLEANUP.md @@ -29,10 +29,28 @@ cd $FAST_PWD/02-security/ terraform destroy ``` -# Networking +# Stage 2 (Networking) ```bash cd $FAST_PWD/02-networking-XXX/ terraform destroy -```bash +``` There's a minor glitch that can surface running terraform destroy, where the service project attachments to the Shared VPC will not get destroyed even with the relevant API call succeeding. We are investigating the issue, in the meantime just manually remove the attachment in the Cloud console or via the gcloud beta compute shared-vpc associated-projects remove command when terraform destroy fails, and then relaunch the command. + +# Stage 1 (Resource Management) +Stage 1 is a little more complicated because of the GCS Buckets. By default terraform refuses to delete non-empty buckets, which is a good thing for your terraform state. However, it makes destruction a bit harder + + +```bash +cd $FAST_PWD/01-resman/ + +# remove buckets from state since terraform refuses to delete them +for x in $(terraform state list | grep google_storage_bucket.bucket); do + terraform state rm "$x" +done + +terraform destroy + +``` + +