Visualizzare l'anteprima dell'eliminazione di un deployment
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come utilizzare Infrastructure Manager per visualizzare l'anteprima dell'eliminazione di un deployment esistente.
Un'anteprima descrive le azioni per attivare una configurazione Terraform specifica.
Prima di eliminare un deployment, puoi utilizzare un'anteprima per verificare le risorse che è previsto eliminare.
Un'anteprima non elimina le risorse di cui è stato eseguito il provisioning. Per eliminare un deployment,
inclusa l'eliminazione delle risorse di cui è stato eseguito il provisioning, consulta
Eliminare i deployment.
Un'anteprima esegue il comando Terraform plan. Questa pagina presuppone che tu abbia familiarità con Terraform. Per maggiori dettagli, consulta
Terraform e Infrastructure Manager.
Assicurati di disporre delle autorizzazioni IAM necessarie per creare le anteprime: roles/config.admin.
Assicurati di disporre di un account di servizio con le autorizzazioni necessarie. Per maggiori dettagli, consulta Configurare l'account di servizio.
Identifica la configurazione Terraform di cui vuoi visualizzare l'anteprima. Assicurati che questa configurazione Terraform sia conforme ai vincoli, inclusa la verifica che non contenga dati sensibili.
Se vuoi archiviare la configurazione di Terraform in un bucket di archiviazione, assicurati che sia caricata in un bucket Cloud Storage. Per ulteriori dettagli, consulta Caricare una configurazione in un bucket di archiviazione.
Un bucket di archiviazione ti consente di controllare l'accesso alla configurazione. Puoi anche eseguire il deployment di una configurazione Terraform archiviata in un repository Git pubblico o sul tuo computer locale.
Visualizzare l'anteprima dell'eliminazione di un deployment
Prima di eliminare un deployment, puoi visualizzarne l'anteprima e rivedere l'eliminazione.
Per visualizzare l'anteprima dell'eliminazione di un deployment:
PROJECT_ID è l'ID progetto in cui viene eseguito Infrastructure Manager.
LOCATION è la posizione in cui viene eseguito Infra Manager. Consulta Località di Infrastructure Manager per l'elenco delle località valide.
PREVIEW_ID è l'identificatore dell'anteprima specificato. Consulta
Nome dell'anteprima
per informazioni dettagliate sui vincoli dell'identificatore dell'anteprima.
SERVICE_ACCOUNT è il nome dell'account di servizio che utilizzi per chiamare Infra Manager.
SERVICE_ACCOUNT_PROJECT_ID è l'ID progetto dell'account di servizio. In genere si tratta dello stesso progetto in cui viene eseguito Infra Manager.
DEPLOYMENT_ID è l'identificatore del deployment che vuoi aggiornare.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[[["\u003cp\u003eThis page guides users on how to use Infrastructure Manager to preview the deletion of an existing deployment, using a process that does not delete any provisioned resources.\u003c/p\u003e\n"],["\u003cp\u003ePreviews utilize the \u003ccode\u003eTerraform plan\u003c/code\u003e command, requiring users to have prior familiarity with Terraform and its configuration, in order to see the actions necessary to actuate it.\u003c/p\u003e\n"],["\u003cp\u003eBefore initiating a preview, you must have the correct IAM permissions (\u003ccode\u003eroles/config.admin\u003c/code\u003e) and a service account properly configured with the necessary permissions.\u003c/p\u003e\n"],["\u003cp\u003eTo preview the deletion of a deployment, use the gcloud command \u003ccode\u003einfra-manager previews create\u003c/code\u003e with the \u003ccode\u003e--preview-mode DELETE\u003c/code\u003e flag, specifying the relevant project, location, deployment, and service account details.\u003c/p\u003e\n"],["\u003cp\u003eAfter a preview is created, you can export and view the results, allowing you to review the plan for the deployment before proceeding with an actual deletion, which is covered in a separate document.\u003c/p\u003e\n"]]],[],null,["# Preview a deletion of a deployment\n\nThis page describes how to use Infrastructure Manager to preview the deletion of an\nexisting deployment.\n\nA preview describes the actions to actuate a specific Terraform configuration.\nBefore you delete a deployment, you can use a preview to verify the resources\nthat are planned to be deleted.\n\nA preview does not delete any provisioned resources. To delete a deployment,\nincluding deleting provisioned resources, see\n[Delete deployments](/infrastructure-manager/docs/delete-deployments).\n\nA preview executes the `Terraform plan` command. This page assumes you are\nfamiliar with Terraform. For details, see\n[Terraform and Infrastructure Manager](/infrastructure-manager/docs/terraform).\n\nBefore you begin\n----------------\n\n1. [Enable Infra Manager](/infrastructure-manager/docs/enable-service).\n2. Ensure that you have the IAM permissions needed to create previews: `roles/config.admin`.\n3. Ensure you have a service account with the needed permissions. For details, see [Configure the service account](/infrastructure-manager/docs/configure-service-account).\n4. Identify the Terraform configuration to preview. Ensure this Terraform configuration complies with the [constraints](/infrastructure-manager/docs/terraform#constraints), including that the configuration does not contain sensitive data.\n5. If you want to store the Terraform configuration in a storage bucket, ensure\n the Terraform configuration is uploaded to a Cloud Storage bucket. See\n [Upload a configuration to a storage bucket](/infrastructure-manager/docs/upload-terraform-configuration)\n for more details.\n\n A storage bucket lets you control access to the configuration. You\n can also deploy a Terraform configuration that is stored in a\n public Git repository, or stored on your\n local machine.\n\nPreview the deletion of a deployment\n------------------------------------\n\nBefore you delete a deployment, you can preview and review the deletion.\n\nTo preview the deletion of a deployment: \n\n gcloud infra-manager previews create --preview-mode DELETE --deployment=projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/previews/\u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e \\\n --service-account projects/\u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_PROJECT_ID\u003c/var\u003e/serviceAccounts/\u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT\u003c/var\u003e \\\n\nReplace:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the project ID where Infrastructure Manager runs.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e is the location where Infra Manager runs. See [Infrastructure Manager locations](/infrastructure-manager/docs/locations) for the list of valid locations.\n- \u003cvar translate=\"no\"\u003ePREVIEW_ID\u003c/var\u003e is the preview identifier that you specify. See [Preview name](/infrastructure-manager/docs/deployments-revisions#preview_name) for details about constraints on the preview identifier.\n- \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT\u003c/var\u003e is the name of the service account you use to call Infra Manager.\n- \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_PROJECT_ID\u003c/var\u003e is the project ID of the service account. It's common for this to be the same project where Infra Manager runs.\n- \u003cvar translate=\"no\"\u003eDEPLOYMENT_ID\u003c/var\u003e is the deployment identifier of the deployment you want to update.\n\nNow that you have created a preview, you can\n[export and view the results](/infrastructure-manager/docs/export-view-preview-results)\nto review the plan for the deployment.\n\nFor more information about deleting deployments, see\n[Delete a deployment](/infrastructure-manager/docs/delete-deployments).\n\nWhat's next\n-----------\n\n- [Export and view preview results](/infrastructure-manager/docs/export-view-preview-results)\n- [Delete a deployment](/infrastructure-manager/docs/delete-deployments).\n- [Create a new preview](/infrastructure-manager/docs/preview-deployment).\n- [Automate deployments](/infrastructure-manager/docs/automate-git).\n- Learn more about [Terraform with Infra Manager](/infrastructure-manager/docs/terraform)."]]