GoogleCloudPlatform / pbmm-on-gcp-onboarding

GCP Canadian Public Sector Landing Zone overlay on top of the TEF via CFT modules - a secure cloud foundation
https://cloud.google.com/architecture/security-foundations
Apache License 2.0
38 stars 55 forks source link

terraform destroy - procedure and docs #437

Open obriensystems opened 1 month ago

obriensystems commented 1 month ago

document delete procedures

Here we just have 0-bootstrap from #431

 - projects_step_terraform_service_account_email     = "sa-terraform-proj@prj-b-seed-cf20.iam.gserviceaccount.com" -> null
  - required_groups                                   = {
      - audit_data_users           = "gcp-audit-data3@obrienlabs.dev"
      - billing_data_users         = "gcp-billing-data3@obrienlabs.dev"
      - group_billing_admins       = "gcp-billing-admins3@obrienlabs.dev"
      - group_org_admins           = "gcp-organization-admins3@obrienlabs.dev"
      - monitoring_workspace_users = "gcp-monitoring-workspace3@obrienlabs.dev"
    } -> null
  - seed_project_id                                   = "prj-b-seed-cf20" -> null
╷
│ Error: Instance cannot be destroyed
│ 
│   on .terraform/modules/seed_bootstrap.kms/main.tf line 27:
│   27: resource "google_kms_crypto_key" "key" {
│ 
│ Resource module.seed_bootstrap.module.kms[0].google_kms_crypto_key.key[0] has lifecycle.prevent_destroy set, but the plan calls for this resource to
│ be destroyed. To avoid this error and continue with the plan, either disable lifecycle.prevent_destroy or reduce the scope of the plan using the
│ -target flag.
╵
michael@cloudshell:~/tef-oldev3/pbmm-on-gcp-onboarding/0-bootstrap (tef-oldev)$ terraform plan -destroy