Cloud Deployment Manager akan mencapai akhir dukungan pada 31 Desember 2025. Jika saat ini Anda menggunakan Deployment Manager, migrasikan ke Infrastructure Manager atau teknologi deployment alternatif paling lambat 31 Desember 2025 untuk memastikan layanan Anda berlanjut tanpa gangguan.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Saat Anda menghapus deployment, semua resource yang merupakan bagian dari deployment tersebut juga akan dihapus.
Jika Anda ingin menghapus resource tertentu dari deployment dan mempertahankan sisanya,
hapus resource tersebut dari file konfigurasi, lalu
perbarui deployment
sebagai gantinya.
Sebelum memulai
Jika Anda ingin menggunakan contoh command line dalam panduan ini, instal alat command line`gcloud`.
Jika Anda ingin menggunakan contoh API dalam panduan ini, siapkan akses API.
Menghapus deployment
Jika ingin menghapus deployment, tetapi tetap mempertahankan semua resource yang mendasarinya, Anda
harus menggunakan Google Cloud CLI atau API.
Ganti myproject dengan nama project Anda, example-deployment dengan nama deployment, dan policy dengan kebijakan penghapusan, yang dijelaskan di bawah.
Pilih kebijakan penghapusan
Kebijakan penghapusan yang Anda gunakan menentukan cara penanganan resource dalam deployment. Anda dapat menggunakan salah satu kebijakan berikut:
DELETE[Default]: Menghapus resource pokok. Tindakan ini bersifat permanen dan tidak dapat diurungkan.
ABANDON: Tindakan ini akan menghapus deployment, tetapi tidak menghapus
resource yang mendasarinya. Misalnya, jika Anda memiliki instance VM dalam deployment, instance tersebut akan tetap tersedia untuk Anda gunakan setelah deployment dihapus.
Jika perlu membuat ulang deployment yang telah dihapus, Anda dapat menggunakan file konfigurasi asli. Namun, deployment dianggap sebagai deployment baru, dengan resource baru.
[[["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-09-03 UTC."],[[["\u003cp\u003eDeleting a deployment will also delete all resources associated with that deployment, unless an alternative policy is specified.\u003c/p\u003e\n"],["\u003cp\u003eTo delete specific resources while keeping others, modify the configuration file and update the deployment instead of deleting it entirely.\u003c/p\u003e\n"],["\u003cp\u003eIf you want to delete a deployment but keep its underlying resources, you must use the Google Cloud CLI or the API, and use the \u003ccode\u003eABANDON\u003c/code\u003e policy.\u003c/p\u003e\n"],["\u003cp\u003eThe default delete policy, \u003ccode\u003eDELETE\u003c/code\u003e, permanently removes the underlying resources when a deployment is deleted, and this action cannot be reversed.\u003c/p\u003e\n"],["\u003cp\u003eWhile a deleted deployment's configuration can be reused, it will create an entirely new deployment with new resources.\u003c/p\u003e\n"]]],[],null,["# Deleting deployments\n\nWhen you delete a deployment, all resources that are part of the deployment are\nalso deleted.\n\nIf you want to delete specific resources from your deployment and keep the rest,\ndelete those resources from your configuration file, and\n[update the deployment](/deployment-manager/docs/deployments/updating-deployments)\ninstead.\n\nBefore you begin\n----------------\n\n- If you want to use the command-line examples in this guide, install the [\\`gcloud\\` command-line tool](/sdk).\n- If you want to use the API examples in this guide, set up [API access](/deployment-manager/docs/reference/latest).\n\nDeleting deployments\n--------------------\n\n| **Warning:** You cannot undo this operation.\n\nIf you want to delete a deployment, but keep all the underlying resources, you\nmust use the Google Cloud CLI or the API. \n\n### Console\n\n1. In the Google Cloud console, open the Deployments page. \n [Go to the Deployments page](https://console.cloud.google.com/project/_/deployments)\n2. In the list of deployments, select the check boxes for the deployments that you want to delete.\n3. On the top of the page, click **Delete**.\n\n### gcloud\n\nWith `gcloud`, use the `deployments delete` command:\n\n\u003cbr /\u003e\n\n```\n gcloud deployment-manager deployments delete example-deployment --delete-policy=POLICY\n \n```\n\n\u003cbr /\u003e\n\nWhere \u003cvar translate=\"no\"\u003ePOLICY\u003c/var\u003e is the [delete policy](#delete-policy).\n\n`gcloud` returns a response similar to the following: \n\n```\nWaiting for delete operation operation-1415233139561-2d5dd654-f438-4d15-87e3-4b5b8ca68c5d to complete...done.\nDelete operation operation-1415233139561-2d5dd654-f438-4d15-87e3-4b5b8ca68c5d completed successfully.\nendTime: '2014-11-05T16:19:03.253-08:00'\nid: '5642095755656583573'\nname: operation-1415233139561-2d5dd654-f438-4d15-87e3-4b5b8ca68c5d\noperationType: delete\nstartTime: '2014-11-05T16:19:02.669-08:00'\nstatus: DONE\ntargetLink: https://www.googleapis.com/deploymentmanager/v2beta1/projects/myproject/global/deployments/example-deployment\n```\n\n### API\n\nIn the API, provide an empty `DELETE` request to the following URL: \n\n```\nDELETE https://www.googleapis.com/deploymentmanager/v2beta1/projects/myproject/global/deployments/example-deployment?deletePolicy=policy\n```\n\nReplace `myproject` with the name of your project, `example-deployment`\nwith the name of the deployment, and `policy` with the delete policy,\ndescribed below.\n\nSelect a delete policy\n----------------------\n\nThe delete policy you use determines how the resources in the deployment\nare handled. You can use one of these policies:\n\n- `DELETE` **\\[Default\\]**: Deletes the underlying resource. This is\n permanent and cannot be undone.\n\n- `ABANDON`: This deletes the deployment, but does not delete the\n underlying resources. For example, if you have a VM instance in the\n deployment, it will still be available for you to use after the\n deployment is deleted.\n\nIf you need to re-create a deployment that you deleted, you can use the original\nconfiguration file. However, the deployment is considered a new deployment, with new resources."]]