Skip to content

Teardown

When the lab session is complete, destroy all Azure resources to stop billing.

From the directory containing the Terraform configuration:

Terminal window
terraform plan -destroy
terraform destroy

Terraform will prompt for confirmation. Type yes to proceed.

Confirm all resources have been removed:

Terminal window
az group show --name "$(terraform output -raw resource_group_name)" 2>&1 \
| grep -q "ResourceGroupNotFound" \
&& echo "Resource group deleted" \
|| echo "Resource group still exists"

Remove Terraform state and cached files:

Terminal window
rm -rf .terraform .terraform.lock.hcl terraform.tfstate terraform.tfstate.backup

If you created F5 XC resources pointing to this origin server, remove them:

  1. Delete the HTTP load balancer
  2. Delete the origin pool
  3. Delete any WAF policies created for testing