> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/guideline-for-enterprise/cloudeka-api-list/command-reference/cldkctl-flexi/network/subnet/delete.md).

# delete

Delete a specific subnet network in your project. This command allows you to remove a subnet.

## Usage

```
cldkctl flexi network subnet delete [flags]
```

## Aliases

```
delete, del
```

## Steps

Follow the steps below to run and view the result of this command:

#### Interactive Mode

1. Run the following command in your terminal:

```
cldkctl flexi network subnet delete -i true
```

2. The terminal displays a list of available **VPCs**. Select the VPC where the subnet is located.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FN9O4TrdDGHyWGSuxoVHE%2F1.png?alt=media&amp;token=577289cc-13db-48cc-b134-0d0d23ae77f4" alt=""><figcaption></figcaption></figure>

3. The terminal displays a list of available **Subnets** in the selected VPC. Select the subnet that you want to delete.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FllUJ7bKt3b7xPlyT9GO4%2F2.png?alt=media&amp;token=2d3b2042-5ce3-4fa4-9159-0ca83040eeba" alt=""><figcaption></figcaption></figure>

4. When prompted, confirm the action by selecting **Confirm**, or cancel the process by selecting **Cancel**.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FOXR3xbI64rLRGkO9bRcs%2F3.png?alt=media&amp;token=5ac7a7c8-6c75-434b-9a56-af54bcf6bea9" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Before deleting a subnet, ensure that no ports are using IP addresses allocated from the subnet. Otherwise, the deletion will fail.
{% endhint %}

5. Once completed successfully, the terminal displays the success message.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FCSmUvQ7cYpLrSdGPDA8h%2Fimage.png?alt=media&amp;token=f302e4a2-eb4d-48c1-9006-0d547ca4dd0b" alt=""><figcaption></figcaption></figure>

#### Non-Interactive Mode

1. Provide the **VPC ID** and **Subnet ID** using command flags.
2. Add `--auto-confirm true` or `-y` to skip confirmation prompts in non-interactive mode.
3. Run the command in your terminal.
4. Once completed successfully, the terminal displays the success message.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FPk1ieLN2lHJDqm63Dbwd%2Fimage.png?alt=media&amp;token=1afaaa44-e159-4324-b085-d5b32f1dd525" alt=""><figcaption></figcaption></figure>

## Flags

{% hint style="info" %}
This command supports [global flags](/guideline-for-enterprise/cloudeka-api-list/global-flags.md). Refer to the Global Flags section for details
{% endhint %}

| Flag           | Shorthand | Default | Description                                           |
| -------------- | --------- | ------- | ----------------------------------------------------- |
| --auto-confirm | -y        | false   | Skip confirmation prompt in non-interactive mode      |
| -h, --help     | -h        |         | Help for the delete command.                          |
| --interactive  | -i        | false   | Run in interactive/TUI mode.                          |
| --subnet-id    |           |         | Subnet ID or name (required in non-interactive mode). |
| --vpc-id       |           |         | VPC ID or name (required in non-interactive mode).    |
