---
name: ContinuousDelivery-cd_delete
title: Deleting a Continuous Delivery service instance
description: You can delete resource group-based Continuous Delivery service instances.
last-updated: 2026-07-31
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/ContinuousDelivery?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

# Deleting a Continuous Delivery service instance
{: #delete_cd_service}
{: help}
{: support}

DevOps Insights will reach end of service and be discontinued on **August 31, 2026**. Continuous Delivery will be discontinued in the following regions on 12 February 2027: **au-syd**, **ca-mon**, **ca-tor**, **us-east**. Code Risk Analyzer will also be discontinued in all regions on that date. If a region has no active usage of these features, the features in that region may be discontinued earlier and stop accepting new instances. [Learn more](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-faq_region_feature_consolidation&format=markdown)
{: important}

You can delete resource group-based Continuous Delivery service instances.
{: shortdesc}

To delete a Continuous Delivery service instance, you must have either the Administrator or Editor user permissions.

Deleting an instance of the Continuous Delivery service impacts your ability to use tool integrations within toolchains that are contained in the same region and resource group as the deleted service instance. For more information about this limitation, see [Plan limitations and usage](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-limitations_usage&format=markdown).
{: important}

If you permanently delete an instance of Continuous Delivery in an enterprise account that has [consolidated billing](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-limitations_usage&format=markdown#consolidated_billing) enabled, all Continuous Delivery service instances in the enterprise hierarchy will revert to reporting their individual authorized user counts independently. The total number of authorized users being billed in your enterprise account may increase as a result.
{: important}

## Deleting a Continuous Delivery service instance by using the console
{: #deleting_rg_console}
{: ui}

1. Log in to [IBM Cloud](http://cloud.ibm.com){: external}.
1. Go to the [Resource list](https://cloud.ibm.com/resources){: external} for your IBM Cloud account.
1. In the **Services** section, locate the active Continuous Delivery service instance.
1. From the Continuous Delivery service instance's **Actions** ![Overflow icon](images/overflow-icon-2.svg) menu, click **Delete**.
1. Click **Delete** to confirm that you want to delete the Continuous Delivery service.

## Deleting a Continuous Delivery service instance from the CLI
{: #deleting_rg_cli}
{: cli}

1. Log in to IBM Cloud by using the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli&format=markdown).

   ```sh
   ibmcloud login
   ```
   {: pre}

   If the login fails, run the `ibmcloud login --sso` command to try again. The `--sso` parameter is required when you log in with a federated ID. If you use this option, go to the link that is listed in the CLI output to generate a one-time passcode.
   {: tip}

2. Optional. List all of the Continuous Delivery service instances in the targeted account to identify the instance that you want to delete.

   ```sh
   ibmcloud resource service-instances --all-resource-groups --service-name continuous-delivery
   ```
   {: pre}

3. Delete a service instance by running the [`ibmcloud resource service-instance-delete`](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_commands_resource&format=markdown#ibmcloud_resource_service_instance_delete) command.

   ```sh
   ibmcloud resource service-instance-delete SERVICE_NAME_OR_ID
   ```
   {: pre}

The following table lists and describes each of the variables that are used in the previous steps.

| Variable | Description |
|:---------|:------------|
| `SERVICE_NAME_OR_ID` | The name or ID of the Continuous Delivery service instance that you want to delete. |
{: caption="Variables for deleting the Continuous Delivery service from the CLI" caption-side="top"}

## Deleting a Continuous Delivery service instance with the API
{: #deleting_rg_api}
{: api}

1. [Obtain an IAM bearer token](https://cloud.ibm.com/apis/resource-controller#authentication){: external}. Alternatively, if you are using an SDK, [obtain an IAM API key](https://cloud.ibm.com/iam/apikeys){: external} and set the client options by using environment variables.

   ```bash
   export RESOURCE_CONTROLLER_APIKEY={iam_api_key}
   ```
   {: pre}

2. Delete the instance of the Continuous Delivery service instance that you want to remove.

   ```curl
   curl -X DELETE \
     https://resource-controller.cloud.ibm.com/v2/resource_instances/{instance_id} \
     -H 'Authorization: Bearer {token}'
   ```
   {: pre}
   {: curl}

   ```java
   import com.ibm.cloud.platform_services.resource_controller.v2.ResourceController;
   import com.ibm.cloud.platform_services.resource_controller.v2.model.*;
   ...
   ResourceController resourceControllerService = ResourceController.newInstance();
   DeleteResourceInstanceOptions deleteCdInstanceOptions = new DeleteResourceInstanceOptions.Builder()
      .id({instance_id})
      .recursive(false)
      .build();
   Response<Void> response = resourceControllerService.deleteResourceInstance(deleteCdInstanceOptions).execute();
   ```
   {: codeblock}
   {: java}

   ```javascript
   const ResourceControllerV2 = require('@ibm-cloud/platform-services/resource-controller/v2');
   const resourceControllerService = ResourceControllerV2.newInstance({});
   ...
   (async() => {
      const params = {
         id: {instance_id},
         recursive: false,
      };
      await resourceControllerService.deleteResourceInstance(params);
   })();
   ```
   {: codeblock}
   {: node}

   ```python
   from ibm_platform_services import ResourceControllerV2
   ...
   resource_controller_service = ResourceControllerV2.new_instance()
   response = resource_controller_service.delete_resource_instance(
      id={instance_id},
      recursive=False
   )
   ```
   {: codeblock}
   {: python}

   ```go
   import {
      "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2"
   }
   ...
   resourceControllerServiceOptions := &resourcecontrollerv2.ResourceControllerV2Options{}
   resourceControllerService, err := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(resourceControllerServiceOptions)
   deleteCdInstanceOptions := resourceControllerService.NewDeleteResourceInstanceOptions(
      {instance_id},
   )
   deleteCdInstanceOptions.SetRecursive(false)
   response, err := resourceControllerService.DeleteResourceInstance(deleteCdInstanceOptions)
   ```
   {: codeblock}
   {: go}

The following table lists and describes each of the variables that are used in the previous steps.

| Variable | Description |
|:---------|:------------|
| `{iam_api_key}` | Your IAM API key. |
| `{instance_id}` | The ID of the Continuous Delivery service instance that you want to delete. |
| `{token}` | A valid IAM bearer token. |
{: caption="Variables for deleting the Continuous Delivery service with the API" caption-side="top"}

For more information about deleting service instances, see [Deleting resource instances by using the API](https://cloud.ibm.com/docs/account?topic=account-manage_resource&interface=api&format=markdown#delete-resource-instance-api).

## Deleting a Continuous Delivery service instance with Terraform
{: #deleting_rg_terraform}
{: terraform}

1. Locate the Terraform file (for example, `main.tf`) that contains the `resource` block for the existing service instance. For more information about using Terraform with Continuous Delivery, see [Creating a Continuous Delivery service instance with Terraform](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-create_cd_service&interface=terraform&format=markdown#create_cd_service_terraform).

   The `resource` in the following example describes an existing Continuous Delivery service instance.

   ```terraform
   data "ibm_resource_group" "group" {
     name = "default"
   }

   resource "ibm_resource_instance" "cd_service_instance" {
     name              = "my CD service instance"
     service           = "continuous-delivery"
     plan              = "lite"
     location          = "us-south"
     resource_group_id = data.ibm_resource_group.group.id
   }
   ```
   {: codeblock}

2. Remove the `resource` block from your Terraform file.

3. Initialize the Terraform CLI.

   ```terraform
   terraform init
   ```
   {: pre}

4. Create a Terraform execution plan. This plan summarizes all of the actions that must be run to delete the Continuous Delivery service instance.

   ```terraform
   terraform plan
   ```
   {: pre}

5. Apply the Terraform execution plan. Terraform takes all of the required actions to delete the Continuous Delivery service instance.

   ```terraform
   terraform apply
   ```
   {: pre}

## Restoring a deleted service instance
{: #restoring_cd_instance}

After you delete an instance of the Continuous Delivery service, you can restore the deleted service instance within the data retention period of seven days. After the seven-day period expires, the service instance is permanently deleted.

To view which service instances are available for restoration and to restore a deleted service, see [Using resource reclamations](https://cloud.ibm.com/docs/account?topic=account-resource-reclamation&format=markdown). If you try to restore a deleted service and an active Continuous Delivery service instance exists, the restoration is blocked. For more information about how to view the details for a resource reclamation, see [Listing reclaimed resources by using the CLI](https://cloud.ibm.com/docs/account?topic=account-resource-reclamation&interface=cli&format=markdown) or [Listing reclaimed resources by using the API](https://cloud.ibm.com/docs/account?topic=account-resource-reclamation&interface=api&format=markdown).

You can have one active instance of Continuous Delivery only in a region and resource group. After you delete an instance of the Continuous Delivery service from a region and resource group, you can restore the deleted service instance to create a service instance again within the data retention period of seven days. Alternatively, you can permanently remove the deleted service instance by using the [`ibmcloud resource reclamation-delete`](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_commands_resource&format=markdown#ibmcloud_resource_reclamation_delete) command, and then [create a Continuous Delivery service](https://cloud.ibm.com/docs/ContinuousDelivery?topic=ContinuousDelivery-create_cd_service&format=markdown) instance again.