Skip to content

Commit

Permalink
Avoid manually modifying source file when destroying
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry authored Oct 22, 2024
1 parent 2b838e3 commit dca3969
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dca3969

Please sign in to comment.