Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Esta página descreve como usar o Gerenciador de infraestrutura para visualizar a exclusão de uma implantação existente.
Uma prévia descreve as ações para acionar uma configuração específica do Terraform.
Antes de excluir uma implantação, use uma prévia para verificar os recursos
que serão excluídos.
Uma visualização não exclui recursos provisionados. Para excluir uma implantação,
incluindo a exclusão de recursos provisionados, consulte
Excluir implantações.
Uma visualização executa o comando Terraform plan. Nesta página, presumimos que você já conhece o Terraform. Para mais detalhes, consulte
Terraform e Infrastructure Manager.
Verifique se você tem as permissões do IAM necessárias para criar visualizações: roles/config.admin.
Verifique se você tem uma conta de serviço com as permissões necessárias. Para
detalhes, consulte
Configurar a conta de serviço.
Identifique a configuração do Terraform para visualização. Verifique se essa configuração do Terraform
está em conformidade com as restrições,
incluindo se ela não contém dados sensíveis.
Um bucket de armazenamento permite controlar o acesso à configuração. Também é possível implantar uma configuração do Terraform armazenada em um repositório público do Git ou na máquina local.
Visualizar a exclusão de uma implantação
Antes de excluir uma implantação, você pode visualizar e revisar a exclusão.
PREVIEW_ID é o identificador de visualização especificado. Consulte
Nome da visualização
para saber mais sobre as restrições do identificador de visualização.
SERVICE_ACCOUNT é o nome da conta de serviço usada para chamar o Infra Manager.
SERVICE_ACCOUNT_PROJECT_ID é o ID do projeto da conta de serviço. É comum que esse seja o mesmo projeto em que
o Infra Manager é executado.
DEPLOYMENT_ID é o identificador da implantação que você quer atualizar.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-19 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)."]]