- Home
- Traffic Generator
- Teardown
Teardown
When the lab session is complete, destroy all Azure resources to stop billing.
Terraform Destroy
Section titled “Terraform Destroy”From the terraform/ directory:
cd terraform/
terraform plan -destroy
terraform destroyTerraform will prompt for confirmation. Type yes to proceed.
Verify Cleanup
Section titled “Verify Cleanup”Confirm all resources have been removed:
RG_NAME=$(terraform output -raw resource_group_name)
az group show --name "${RG_NAME}" 2>&1 | grep -q "ResourceGroupNotFound" \ && echo "Resource group deleted" \ || echo "Resource group still exists"
az resource list --resource-group "${RG_NAME}" -o table 2>/dev/nullClean Up Local State
Section titled “Clean Up Local State”Remove Terraform state and cached files:
rm -rf .terraform .terraform.lock.hcl terraform.tfstate terraform.tfstate.backupPreserve Results (Optional)
Section titled “Preserve Results (Optional)”If you want to keep the traffic suite results before destroying the VM, copy them locally:
TGEN_IP=$(terraform output -raw public_ip)
# Copy all results to local machinescp -r azureuser@${TGEN_IP}:/opt/traffic-generator/results/ ./traffic-results/
# Or copy just the latest runLATEST=$(ssh azureuser@${TGEN_IP} 'ls -t /opt/traffic-generator/results/ | head -1')scp -r azureuser@${TGEN_IP}:/opt/traffic-generator/results/${LATEST} ./traffic-results/F5 XC Cleanup
Section titled “F5 XC Cleanup”If you also want to remove the F5 XC configuration that the traffic generator was targeting:
- Delete the HTTP load balancer
- Delete the origin pool
- Delete any WAF policies, Bot Defense configurations, API Security policies, or CSD configurations created for testing
These F5 XC resources do not incur Azure costs but should be cleaned up when the demo environment is no longer needed.