Delete Cloud Deploy resources

This page describes how to delete Cloud Deploy resource, including thefollowing:

Delete a delivery pipeline

You can delete a delivery pipeline from the Google Cloud console or usingthe gcloud CLI.

Delete a delivery pipeline using the Google Cloud console

  1. In the Google Cloud console, navigate to the Cloud DeployDelivery pipelines page to find the delivery pipeline you want to delete.

    Open the Delivery pipelines page

  2. Click the name of the delivery pipeline you want to delete.

    TheDelivery pipeline details page is shown.

    targets in Google Cloud console, showing menu icon

  3. ClickDelete.

Delete a delivery pipeline using the gcloud CLI

If you have a delivery pipeline without any subresources (releases or rollouts),you can delete it by running the following command:

gclouddeploydelivery-pipelinesdeletePIPELINE_NAME

If the pipeline you want to delete has any releases or rollouts associated withit, you need to include the--force flag in order to delete the pipeline andthose subresources:

gclouddeploydelivery-pipelinesdeletePIPELINE_NAME--force

Cloud Deploy prevents you from deleting the pipeline if there's arelease or rollout in a state that would cause problems if deleted. For example,you can't delete a delivery pipeline if a rollout is in thePENDING state, butyoucan delete it if the rollout is in aPENDING_APPROVAL state. If youcan't delete the pipeline, you need to reject approval, or advance or cancel therollout to a terminal state (such asSUCCEEDED orFAILED).

Delete a target

You can delete a target from the Google Cloud console or using thegcloud CLI. These two methods are described in the sections thatfollow.

Delete a target using the gcloud CLI

When you delete a target using the gcloud CLI, that targets isdeleted whether or not it's in use by any delivery pipeline.

Use the following command to delete a target from the gcloud CLI:

gclouddeploytargetsdeleteTARGET_NAME--region=REGION

Where:

TARGET_NAME is the name of the target youwant to delete. This is the same as the value formetadata.name in thetarget configuration.

REGION_NAME is the name of the region in whichthe target was created, for exampleus-central1.

Cloud Deploy doesn't prevent you from deleting a target that'sactively used by other delivery pipelines.

Delete a target using the Google Cloud console

You can delete a target using the Google Cloud console, only if that targetisn't in use by an existing delivery pipeline resource. That is, if there is apipeline with a stage that points to the target, then you can't delete thetarget from the Google Cloud console.

Follow these steps to delete the target using the Google Cloud console:

  1. Navigate to the Cloud DeployTargets page.

    All available targets in your current project are displayed.

    targets in Google Cloud console, showing menu icon

  2. Click theThe more menumenu icon for the target you want to delete.

  3. ClickDelete target.

    If the target you're trying to delete is referenced by a delivery pipeline, you can't selectDelete target.

    If the targetisn't referenced by a delivery pipeline, theDelete target dialog is shown.

    The delete target dialog

  4. Type the target name in the text field provided, and clickConfirm.

Delete a custom target type

From a command shell, use the following command to delete acustom target type resource:

gclouddeploycustom-target-typesdeleteCUSTOM_TARGET_TYPE_NAME\--region=REGION_NAME

Where:

  • CUSTOM_TARGET_TYPE_NAME

    Is the name of the custom target type you want to delete. This is the same asthemetadata.name property in thecustom target type definition.

  • REGION_NAME

    Is the region in which you created the custom target type, for exampleus-central1.

Delete an automation

You can delete any automation resource created in your project. You can deletethe automation using the Google Cloud console or thegcloud CLI:

Delete an automation using the Google Cloud console

  1. In the Google Cloud console, navigate to the Cloud DeployDelivery pipelines page to find the delivery pipeline your automation isassociated with.

    Open the Delivery pipelines page

  2. Click the name of your delivery pipeline.

  3. UnderDelivery pipeline details, select theAutomations tab.

  4. Click the name of the automation you want to delete.

    TheAutomation details are shown.

    Automation in Google Cloud console, showing delete button

  5. Click theDelete button, and confirm the deletion by typing theautomation name and clickingConfirm.

Delete an automation using the gcloud CLI

From a command shell, use the following command to delete an automationresource:

gclouddeployautomationsdeleteAUTOMATION_NAME\--delivery-pipeline=PIPELINE_NAME\--region=REGION_NAME

Where:

  • AUTOMATION_NAME

    Is the name of the automation you want to delete. This is the same as themetadata.name property in theautomation definition.

  • PIPELINE_NAME

    Is the name of the delivery pipeline this automation is associated with. Allautomations exist only within the scope of one delivery pipeline.

  • REGION_NAME

    Is the region in which you created the automation, for exampleus-central1.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.