LOCATION: 인프라 관리자가 실행되는 위치입니다. 유효한 위치 목록은 인프라 관리자 위치를 참고하세요.
DEPLOYMENT_ID: 사용자가 지정한 배포 식별자입니다. 배포 식별자의 제약조건에 관한 자세한 내용은 배포 이름을 참고하세요.
프로비저닝된 리소스 유지
배포를 삭제하고 배포에서 프로비저닝한 Google Cloud 리소스를 유지할 수 있습니다.
예를 들어 Google Cloud용 Terraform 청사진 및 모듈에서 구성을 배포합니다. 배포 후에는 코드형 인프라 (IaC)를 사용하지 않고 콘솔을 통해 리소스를 관리하려고 합니다. 이 경우 배포의 메타데이터를 사용할 필요가 없으므로 배포를 삭제하는 것이 좋습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eThis guide details the process of deleting an Infrastructure Manager deployment, which involves removing the associated metadata and optionally, the provisioned resources.\u003c/p\u003e\n"],["\u003cp\u003eBefore deleting, ensure Infrastructure Manager is enabled, you have the necessary IAM permissions, and the service account and Terraform configuration used for the deployment are valid.\u003c/p\u003e\n"],["\u003cp\u003eYou can choose to delete the deployment along with all provisioned Google Cloud resources, or opt to retain the resources while only deleting the deployment metadata.\u003c/p\u003e\n"],["\u003cp\u003eTo delete both the deployment and provisioned resources, use the \u003ccode\u003egcloud infra-manager deployments delete\u003c/code\u003e command, and for keeping the resources, use the same command with the \u003ccode\u003e--delete-policy=abandon\u003c/code\u003e flag.\u003c/p\u003e\n"],["\u003cp\u003eThe service account used for the operation needs permissions for the Infrastructure Manager service and to delete resources within the specified Google Cloud project and location, as well as a valid Terraform configuration.\u003c/p\u003e\n"]]],[],null,["# Delete a deployment\n\nThis page describes how to delete an Infrastructure Manager deployment.\n\nThis page assumes you are familiar with Terraform. For details, see\n[Terraform and Infrastructure Manager](/infrastructure-manager/docs/terraform).\n\nBefore you begin\n----------------\n\n1. Ensure [Infra Manager is enabled](/infrastructure-manager/docs/enable-service).\n2. Ensure that you have the IAM permissions needed to create deployments: `roles/config.admin`.\n3. Ensure the service account that was last used to create or update the deployment is still valid. Infra Manager uses this service account to delete the deployment.\n - For details about configuring the service account, including setting up required permissions, see [Configure the service account](/infrastructure-manager/docs/configure-service-account).\n - To determine the service account that was last used for the deployment, see [View the state of a revision](/infrastructure-manager/docs/view-deployments#revision-details).\n4. Ensure the Terraform configuration that Infra Manager used to create or update the deployment is still valid. Infra Manager uses this configuration to delete the deployment.\n5. Identify the Infra Manager deployment to delete.\n6. Ensure that the service account has the IAM permissions needed to delete resources in the specified projects and locations.\n\nGrant permissions specific to the configuration\n-----------------------------------------------\n\nTo delete Google Cloud resources in a specific deployment, the service\naccount that you use to call Infra Manager needs\npermissions that are specific to what you are deleting.\n\nThese permissions are in addition to the permissions needed to use the\nInfra Manager service.\n\nFor details about granting permissions for the Google Cloud resources and\nensuring you have access to the needed projects, see\n[Configure the service account](/infrastructure-manager/docs/configure-service-account).\n\nDelete a deployment\n-------------------\n\nWhen an Infra Manager deployment is created, Infra Manager\nstores metadata about the deployment, the Terraform configuration that is\ndeployed, and the state file.\n\nWhen you delete a deployment, you delete this metadata and files. You can\nalso delete the resources provisioned by the deployment, or keep these\nresources.\n\n### Delete provisioned resources\n\n| **Caution:** Deleting Google Cloud resources can cause unrecoverable data loss. Re-deploying the configuration will not restore data.\n\nTo delete the deployment metadata and delete the provisioned resources:\n\n1. Optionally, list the resources provisioned by the deployment:\n\n gcloud infra-manager resources list projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/deployments/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e/revisions/\u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID where Infrastructure Manager runs.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n - \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e: the deployment identifier that you specify. See [Deployment name](/infrastructure-manager/docs/overview#deployments) for details about constraints on the deployment identifier.\n - \u003cvar translate=\"no\"\u003eREVISION_ID\u003c/var\u003e: the revision ID representing a specific revision of a deployment. See [Deployment name](/infrastructure-manager/docs/overview#deployments) for details about constraints on the revision identifier.\n2. Preview the deletion of the resources. For details, see\n [Preview a deletion of a deployment](/infrastructure-manager/docs/preview-deployment-deletion).\n\n3. Delete the deployment and provisioned resources:\n\n gcloud infra-manager deployments delete projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/deployments/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID where Infrastructure Manager runs.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n - \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e: the deployment identifier that you specify. See [Deployment name](/infrastructure-manager/docs/overview#deployments) for details about constraints on the deployment identifier.\n\n### Keep provisioned resources\n\nYou may want to delete the deployment and keep the Google Cloud resources\nthat were provisioned by the deployment.\n\nFor example, you deploy a configuration from the\n[Terraform blueprints and modules for Google Cloud](/docs/terraform/blueprints/terraform-blueprints). Once it's deployed, you want to manage the resources\nthrough the console, and not use Infrastructure as Code (IaC). In this case,\nyou may want to delete the deployment as you don't have use for the\ndeployment's metadata.\n| **Note:** After you delete the deployment, Infra Manager is not able to identify or manage the Google Cloud resources that are kept.\n\nTo delete the deployment metadata and keep the provisioned resources: \n\n gcloud infra-manager deployments delete projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/deployments/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e \\\n --delete-policy=abandon\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID where Infrastructure Manager runs.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e: the deployment identifier that you specify. See [Deployment name](/infrastructure-manager/docs/overview#deployments) for details about constraints on the deployment identifier.\n\nWhat's next\n-----------\n\n- Learn more about [Terraform with Google Cloud](/docs/terraform).\n- [View the state of a deployment](/infrastructure-manager/docs/view-deployments).\n- [View resources deployed](/infrastructure-manager/docs/view-resources)."]]