Phase 4 — Teardown
Phase 4 removes everything the plan created. terraform destroy deletes the managed xcsh_dns_zone
(and its records) through the F5 XC API and updates the remote state.
Destroy
Section titled “Destroy”-
Confirm your environment targets the intended tenant and domain:
Terminal window echo "$XCSH_API_URL"grep '^domain' terraform/terraform.tfvars -
Review what will be destroyed:
Terminal window cd terraformterraform plan -destroy -
Destroy after reviewing the plan:
Terminal window terraform destroy
Verify removal
Section titled “Verify removal”Confirm the zone is gone from F5 XC (expect HTTP 404):
curl -s -o /dev/null -w '%{http_code}\n' \ -H "Authorization: APIToken xF5XC_API_TOKENx" \ "xF5XC_API_URLx/api/config/dns/namespaces/system/dns_zones/xF5XC_DOMAINx"Public resolution stops once the delegated nameservers drop the records.
What remains
Section titled “What remains”The Azure state backend (resource group, storage account, container) is not removed by
terraform destroy — it holds the state and is reused across runs. The state file remains, now
recording an empty configuration. Remove the backend only when you are retiring the environment
entirely, with the Azure CLI:
az group delete --name f5-sales-demo-tfstate --yesTo rebuild, start again at Phase 1 — Build.