종료
랩 세션이 완료되면, 과금을 중단하기 위해 모든 Azure 리소스를 삭제합니다.
Terraform Destroy
섹션 제목: “Terraform Destroy”Terraform 구성이 포함된 디렉터리에서 실행합니다:
# Review what will be destroyedterraform plan -destroy
# Destroy all resourcesterraform destroyTerraform은 확인을 요청합니다. 계속하려면 yes를 입력합니다.
정리 확인
섹션 제목: “정리 확인”모든 리소스가 제거되었는지 확인합니다:
# Check resource group is goneaz group show --name "$(terraform output -raw resource_group_name)" 2>&1 \ | grep -q "ResourceGroupNotFound" \ && echo "Resource group deleted" \ || echo "Resource group still exists"로컬 상태 정리
섹션 제목: “로컬 상태 정리”Terraform 상태 및 캐시된 파일을 제거합니다:
rm -rf .terraform .terraform.lock.hcl terraform.tfstate terraform.tfstate.backupDNS/Hosts 변경 사항 되돌리기
섹션 제목: “DNS/Hosts 변경 사항 되돌리기”통합 과정에서 DNS 또는 hosts 파일을 수정한 경우, 해당 변경 사항을 되돌립니다:
# Remove hosts file entry (Linux/macOS)sudo sed -i '/<CDN_EDGE_PUBLIC_IP>/d' /etc/hostsDNS A 레코드를 생성한 경우, DNS 공급자를 통해 해당 레코드를 삭제합니다.