清除環境
實驗課程結束後,請銷毀所有 Azure 資源以停止計費。
Terraform 銷毀
Section titled “Terraform 銷毀”在包含 Terraform 設定的目錄中執行:
terraform plan -destroy
terraform destroyTerraform 將提示確認。輸入 yes 以繼續。
驗證清除結果
Section titled “驗證清除結果”確認所有資源已被移除:
az group show --name "$(terraform output -raw resource_group_name)" 2>&1 \ | grep -q "ResourceGroupNotFound" \ && echo "Resource group deleted" \ || echo "Resource group still exists"清理本地狀態
Section titled “清理本地狀態”移除 Terraform 狀態及快取檔案:
rm -rf .terraform .terraform.lock.hcl terraform.tfstate terraform.tfstate.backupF5 XC 清除
Section titled “F5 XC 清除”若您已建立指向此來源伺服器的 F5 XC 資源,請將其移除:
- 刪除 HTTP 負載平衡器
- 刪除來源池
- 刪除任何為測試而建立的 WAF 政策