Il supporto di Cloud Deployment Manager terminerà il 31 dicembre 2025. Se al momento utilizzi Deployment Manager, esegui la migrazione a Infrastructure Manager o a una tecnologia di deployment alternativa entro il 31 dicembre 2025 per assicurarti che i tuoi servizi continuino senza interruzioni.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Quando elimini un deployment, vengono eliminate anche tutte le risorse che ne fanno parte.
Se vuoi eliminare risorse specifiche dalla tua implementazione e conservare il resto,
elimina queste risorse dal file di configurazione e
aggiorna l'implementazione
invece.
Sostituisci myproject con il nome del progetto, example-deployment con il nome del deployment e policy con la norma di eliminazione descritta di seguito.
Seleziona una norma di eliminazione
La policy di eliminazione che utilizzi determina la modalità di gestione delle risorse nel deployment. Puoi utilizzare uno di questi criteri:
DELETE[Predefinito]: elimina la risorsa sottostante. Questa azione è
permanente e non può essere annullata.
ABANDON: questa operazione elimina il deployment, ma non le risorse
sottostanti. Ad esempio, se hai un'istanza VM nel deployment, potrai comunque utilizzarla dopo l'eliminazione del deployment.
Se devi ricreare un deployment che hai eliminato, puoi utilizzare il file di configurazione originale. Tuttavia, il deployment viene considerato un nuovo deployment, con nuove risorse.
[[["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-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."]]