Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird beschrieben, wie Sie ein Infrastructure Manager-Deployment löschen.
Auf dieser Seite wird davon ausgegangen, dass Sie mit Terraform vertraut sind. Weitere Informationen finden Sie unter Terraform und Infrastructure Manager.
Prüfen Sie, ob Sie die erforderlichen IAM-Berechtigungen zum Erstellen von Bereitstellungen haben: roles/config.admin.
Achten Sie darauf, dass das Dienstkonto, das zuletzt zum Erstellen oder Aktualisieren der Bereitstellung verwendet wurde, weiterhin gültig ist. Infra Manager verwendet dieses Dienstkonto, um die Bereitstellung zu löschen.
Weitere Informationen zum Konfigurieren des Dienstkontos, einschließlich des Einrichtens der erforderlichen Berechtigungen, finden Sie unter Dienstkonto konfigurieren.
Informationen dazu, welches Dienstkonto zuletzt für die Bereitstellung verwendet wurde, finden Sie unter Status einer Revision ansehen.
Prüfen Sie, ob die Terraform-Konfiguration, die Infra Manager zum Erstellen oder Aktualisieren der Bereitstellung verwendet hat, noch gültig ist. Infra Manager verwendet diese Konfiguration, um die Bereitstellung zu löschen.
Suchen Sie die Infra Manager-Bereitstellung, die Sie löschen möchten.
Prüfen Sie, ob das Dienstkonto die IAM-Berechtigungen hat, die zum Löschen von Ressourcen in den angegebenen Projekten und Standorten erforderlich sind.
Konfigurationsspezifische Berechtigungen erteilen
Wenn Sie Google Cloud Ressourcen in einem bestimmten Deployment löschen möchten, benötigt das Dienstkonto, mit dem Sie Infra Manager aufrufen, Berechtigungen, die sich darauf beziehen, was Sie löschen.
Diese Berechtigungen sind zusätzlich zu den Berechtigungen erforderlich, die für die Verwendung des Infra Manager-Dienstes benötigt werden.
Weitere Informationen zum Erteilen von Berechtigungen für die Google Cloud -Ressourcen und zum Sicherstellen, dass Sie Zugriff auf die erforderlichen Projekte haben, finden Sie unter Dienstkonto konfigurieren.
Deployment löschen
Wenn ein Infra Manager-Deployment erstellt wird, speichert Infra Manager Metadaten zum Deployment, zur bereitgestellten Terraform-Konfiguration und zur Zustandsdatei.
Wenn Sie eine Bereitstellung löschen, werden auch diese Metadaten und Dateien gelöscht. Sie können auch die von der Bereitstellung bereitgestellten Ressourcen löschen oder beibehalten.
Bereitgestellte Ressourcen löschen
So löschen Sie die Deployment-Metadaten und die bereitgestellten Ressourcen:
Optional können Sie die vom Deployment bereitgestellten Ressourcen auflisten:
PROJECT_ID: die Projekt-ID, unter der Infrastructure Manager ausgeführt wird.
LOCATION: Der Ort, an dem Infra Manager ausgeführt wird. Eine Liste der gültigen Standorte finden Sie unter Infrastructure Manager-Standorte.
DEPLOYMENT_ID: die von Ihnen angegebene Deployment-ID. Weitere Informationen zu Einschränkungen für die Bereitstellungs-ID finden Sie unter Bereitstellungsname.
REVISION_ID: Die Revisions-ID, die eine bestimmte Revision eines Deployments darstellt. Weitere Informationen zu Einschränkungen für die Revisions-ID finden Sie unter Bereitstellungsname.
PROJECT_ID: die Projekt-ID, unter der Infrastructure Manager ausgeführt wird.
LOCATION: Der Ort, an dem Infra Manager ausgeführt wird. Eine Liste der gültigen Standorte finden Sie unter Infrastructure Manager-Standorte.
DEPLOYMENT_ID: die von Ihnen angegebene Deployment-ID. Weitere Informationen zu Einschränkungen für die Bereitstellungs-ID finden Sie unter Bereitstellungsname.
Bereitgestellte Ressourcen beibehalten
Möglicherweise möchten Sie das Deployment löschen und die Google Cloud Ressourcen beibehalten, die durch das Deployment bereitgestellt wurden.
Sie stellen beispielsweise eine Konfiguration aus den Terraform-Blueprints und -Modulen für Google Cloud bereit. Nach der Bereitstellung möchten Sie die Ressourcen über die Console verwalten und nicht Infrastructure as Code (IaC) verwenden. In diesem Fall sollten Sie das Deployment löschen, da Sie die Metadaten des Deployments nicht benötigen.
So löschen Sie die Deployment-Metadaten und behalten die bereitgestellten Ressourcen:
PROJECT_ID: die Projekt-ID, unter der Infrastructure Manager ausgeführt wird.
LOCATION: Der Ort, an dem Infra Manager ausgeführt wird. Eine Liste der gültigen Standorte finden Sie unter Infrastructure Manager-Standorte.
DEPLOYMENT_ID: die von Ihnen angegebene Deployment-ID. Weitere Informationen zu Einschränkungen für die Bereitstellungs-ID finden Sie unter Bereitstellungsname.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)."]]