From dca3969f130b7e5ae39246b2bf2569164c445030 Mon Sep 17 00:00:00 2001 From: "Yang, Bo" Date: Tue, 22 Oct 2024 00:32:47 -0700 Subject: [PATCH] Avoid manually modifying source file when destroying --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index 48bacc2..ef45b79 100644 --- a/README.md +++ b/README.md @@ -133,16 +133,7 @@ Terraform configuration as usual. Follow this procedure to delete your deployment. -1. In `main.tf`, change the `terraform_state_backend` module arguments as - follows: - ```hcl - module "terraform_state_backend" { - # ... - terraform_backend_config_file_path = "" - force_destroy = true - } - ``` -1. `terraform apply -target module.terraform_state_backend -auto-approve`. +1. `terraform destroy -target module.terraform_state_backend.local_file.terraform_backend_config -auto-approve`. This implements the above modifications by deleting the `backend.tf` file and enabling deletion of the S3 state bucket. 1. `terraform init -force-copy`. Terraform detects that you want to move your