Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment utiliser Infrastructure Manager pour prévisualiser la suppression d'un déploiement existant.
Un aperçu décrit les actions à effectuer pour déclencher une configuration Terraform spécifique.
Avant de supprimer un déploiement, vous pouvez utiliser un aperçu pour vérifier les ressources qui doivent être supprimées.
Un aperçu ne supprime aucune ressource provisionnée. Pour supprimer un déploiement, y compris les ressources provisionnées, consultez la section Supprimer des déploiements.
Un aperçu exécute la commande Terraform plan. Dans cette page, nous partons du principe que vous connaissez Terraform. Pour en savoir plus, consultez la section Terraform et Infrastructure Manager.
Assurez-vous de disposer des autorisations IAM nécessaires pour créer des aperçus: roles/config.admin.
Assurez-vous de disposer d'un compte de service disposant des autorisations nécessaires. Pour en savoir plus, consultez la section Configurer le compte de service.
Identifiez la configuration Terraform à prévisualiser. Assurez-vous que cette configuration Terraform respecte les contraintes, y compris que la configuration ne contient pas de données sensibles.
Si vous souhaitez stocker la configuration Terraform dans un bucket de stockage, assurez-vous qu'elle est importée dans un bucket Cloud Storage. Pour en savoir plus, consultez la section Importer une configuration dans un bucket de stockage.
Un bucket de stockage vous permet de contrôler l'accès à la configuration. Vous pouvez également déployer une configuration Terraform stockée dans un dépôt Git public ou sur votre machine locale.
Prévisualiser la suppression d'un déploiement
Avant de supprimer un déploiement, vous pouvez prévisualiser et examiner la suppression.
Pour prévisualiser la suppression d'un déploiement:
PROJECT_ID correspond à l'ID du projet dans lequel Infrastructure Manager s'exécute.
LOCATION correspond à l'emplacement où Infra Manager s'exécute. Pour obtenir la liste des emplacements valides, consultez la section Emplacements Infrastructure Manager.
PREVIEW_ID est l'identifiant d'aperçu que vous spécifiez. Pour en savoir plus sur les contraintes liées à l'identifiant d'aperçu, consultez la section Nom de l'aperçu.
SERVICE_ACCOUNT correspond au nom du compte de service que vous utilisez pour appeler Infra Manager.
SERVICE_ACCOUNT_PROJECT_ID correspond à l'ID du projet du compte de service. Il s'agit généralement du même projet que celui dans lequel Infra Manager s'exécute.
DEPLOYMENT_ID est l'identifiant du déploiement que vous souhaitez mettre à jour.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 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)."]]