Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara menggunakan Infrastructure Manager untuk melihat pratinjau penghapusan deployment yang ada.
Pratinjau menjelaskan tindakan untuk mengaktifkan konfigurasi Terraform tertentu.
Sebelum menghapus deployment, Anda dapat menggunakan pratinjau untuk memverifikasi resource
yang direncanakan untuk dihapus.
Pratinjau tidak menghapus resource yang disediakan. Untuk menghapus deployment,
termasuk menghapus resource yang disediakan, lihat
Menghapus deployment.
Pratinjau mengeksekusi perintah Terraform plan. Halaman ini mengasumsikan bahwa Anda sudah memahami Terraform. Untuk mengetahui detailnya, lihat
Terraform dan Infrastructure Manager.
Pastikan Anda memiliki izin IAM yang diperlukan untuk membuat pratinjau: roles/config.admin.
Pastikan Anda memiliki akun layanan dengan izin yang diperlukan. Untuk mengetahui detailnya, lihat Mengonfigurasi akun layanan.
Identifikasi konfigurasi Terraform yang akan dilihat pratinjaunya. Pastikan konfigurasi Terraform ini
mematuhi batasan,
termasuk bahwa konfigurasi tidak berisi data sensitif.
Jika Anda ingin menyimpan konfigurasi Terraform di bucket penyimpanan, pastikan konfigurasi Terraform diupload ke bucket Cloud Storage. Lihat
Mengupload konfigurasi ke bucket penyimpanan
untuk mengetahui detail selengkapnya.
Bucket penyimpanan memungkinkan Anda mengontrol akses ke konfigurasi. Anda juga dapat men-deploy konfigurasi Terraform yang disimpan di repositori Git publik, atau disimpan di komputer lokal Anda.
Melihat pratinjau penghapusan deployment
Sebelum menghapus deployment, Anda dapat melihat pratinjau dan meninjau penghapusan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]