Skip to content

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.

  1. Confirm your environment targets the intended tenant and domain:

    Terminal window
    echo "$XCSH_API_URL"
    grep '^domain' terraform/terraform.tfvars
  2. Review what will be destroyed:

    Terminal window
    cd terraform
    terraform plan -destroy
  3. Destroy after reviewing the plan:

    Terminal window
    terraform destroy

Confirm the zone is gone from F5 XC (expect HTTP 404):

Terminal window
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.

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:

Terminal window
az group delete --name f5-sales-demo-tfstate --yes

To rebuild, start again at Phase 1 — Build.