Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird beschrieben, wie Sie eine Infrastructure Manager-Bereitstellung löschen.
Auf dieser Seite wird davon ausgegangen, dass Sie mit Terraform vertraut sind. Weitere Informationen finden Sie unter Terraform und Infrastructure Manager.
Sie benötigen die IAM-Berechtigungen zum Erstellen von Bereitstellungen: roles/config.admin.
Prüfen Sie, ob das Dienstkonto, das zuletzt zum Erstellen oder Aktualisieren der Bereitstellung verwendet wurde, noch gültig ist. Infra Manager verwendet dieses Dienstkonto, um die Bereitstellung zu löschen.
Weitere Informationen zum Konfigurieren des Dienstkontos, einschließlich der Einrichtung der erforderlichen Berechtigungen, finden Sie unter Dienstkonto konfigurieren.
Wie Sie das Dienstkonto ermitteln, das zuletzt für die Bereitstellung verwendet wurde, erfahren Sie unter Status einer Version ansehen.
Prüfen Sie, ob die Terraform-Konfiguration, mit der Infra Manager die Bereitstellung erstellt oder aktualisiert hat, noch gültig ist. Infra Manager verwendet diese Konfiguration, um die Bereitstellung zu löschen.
Geben Sie die Infra Manager-Bereitstellung an, die Sie löschen möchten.
Das Dienstkonto muss die IAM-Berechtigungen haben, die zum Löschen von Ressourcen in den angegebenen Projekten und Speicherorten erforderlich sind.
Konfigurationsspezifische Berechtigungen erteilen
Wenn Sie Google Cloud -Ressourcen in einer bestimmten Bereitstellung löschen möchten, benötigt das Dienstkonto, mit dem Sie Infra Manager aufrufen, Berechtigungen, die für die zu löschenden Ressourcen spezifisch sind.
Diese Berechtigungen sind zusätzlich zu den Berechtigungen erforderlich, die für die Nutzung des Infra Manager-Dienstes erforderlich sind.
Weitere Informationen zum Gewähren von Berechtigungen für die Google Cloud Ressourcen und zum Zugriff auf die erforderlichen Projekte finden Sie unter Dienstkonto konfigurieren.
Deployment löschen
Wenn eine Infra Manager-Bereitstellung erstellt wird, speichert Infra Manager Metadaten zur Bereitstellung, zur bereitgestellten Terraform-Konfiguration und zur Zustandsdatei.
Wenn Sie eine Bereitstellung löschen, werden auch diese Metadaten und Dateien gelöscht. Sie können die von der Bereitstellung bereitgestellten Ressourcen auch löschen oder beibehalten.
Bereitgestellte Ressourcen löschen
So löschen Sie die Deployment-Metadaten und die bereitgestellten Ressourcen:
Optional können Sie die durch die Bereitstellung bereitgestellten Ressourcen auflisten:
PROJECT_ID: die Projekt-ID, unter der Infrastructure Manager ausgeführt wird.
LOCATION: Der Speicherort, 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 Bereitstellungs-ID. Weitere Informationen zu Einschränkungen für die Bereitstellungs-ID finden Sie unter Bereitstellungsname.
REVISION_ID: Die Revision-ID, die eine bestimmte Version einer Bereitstellung darstellt. Weitere Informationen zu Einschränkungen für die Revisionskennung finden Sie unter Bereitstellungsname.
PROJECT_ID: die Projekt-ID, unter der Infrastructure Manager ausgeführt wird.
LOCATION: Der Speicherort, 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 Bereitstellungs-ID. Weitere Informationen zu Einschränkungen für die Bereitstellungs-ID finden Sie unter Bereitstellungsname.
Bereitstatte Ressourcen beibehalten
Sie können die Bereitstellung löschen und die Google Cloud Ressourcen behalten, die durch die Bereitstellung bereitgestellt wurden.
Sie stellen beispielsweise eine Konfiguration aus den Terraform-Blueprints und ‑Modulen für Google Cloud bereit. Nach der Bereitstellung sollten Sie die Ressourcen über die Console verwalten und nicht Infrastructure as Code (IaC) verwenden. In diesem Fall können 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 Speicherort, 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 Bereitstellungs-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-08-19 (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)."]]