[Yandex Cloud documentation](../../index.md) > [Yandex Application Load Balancer](../index.md) > [Step-by-step guides](index.md) > HTTP routers > Deleting an HTTP router

# Deleting an HTTP router

{% note warning %}

You cannot delete an HTTP router used in a load balancer. First, you need to [remove](application-load-balancer-update.md) it from all load balancers.

{% endnote %}

To delete an HTTP router:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder with your HTTP router.
  1. Navigate to **Application Load Balancer**.
  1. Select your router and click ![image](../../_assets/console-icons/ellipsis.svg).
  1. In the menu that opens, select **Delete**.

     To do this with multiple HTTP routers, select the routers to delete from the list and click **Delete** at the bottom of the screen.
  1. In the window that opens, click **Delete**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI command for deleting an HTTP router:

     ```bash
     yc alb http-router delete --help
     ```

  1. Run this command with your HTTP router name specified:

     ```bash
     yc alb http-router delete --name <HTTP_router_name>
     ```

     To check whether your router has been deleted, get a list of HTTP routers by running the command:

     ```bash
     yc alb http-router list
     ```

- Terraform {#tf}

  If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
  
  
  To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../terraform/authentication.md) using the appropriate method.

  To delete an HTTP router or virtual host created with Terraform:
  1. Open the Terraform configuration file and delete the fragment describing the HTTP router or virtual host, i.e., `yandex_alb_http_router` or `yandex_alb_virtual_host` resource, respectively.

     {% cut "Sample HTTP router and virtual host description in the Terraform configuration" %}

     ```hcl
     ...
     resource "yandex_alb_http_router" "tf-router" {
       name   = "my-http-router"
       labels = {
         tf-label    = "tf-label-value"
         empty-label = ""
       }
     }

     resource "yandex_alb_virtual_host" "my-virtual-host" {
       name           = "my-virtual-host"
       http_router_id = "${yandex_alb_http_router.tf-router.id}"
       route {
         name = "my-route"
         http_route {
           http_route_action {
             backend_group_id = "${yandex_alb_backend_group.backend-group.id}"
             timeout          = "3s"
           }
         }
       }
     }
     ...
     ```

     {% endcut %}

  1. In the command line, navigate to the directory with the Terraform configuration file.
  1. Check the configuration using this command:

     ```bash
     terraform validate
     ```

     If the configuration is valid, you will get this message:

     ```text
     Success! The configuration is valid.
     ```

  1. Run this command:

     ```bash
     terraform plan
     ```

     You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
  1. Apply the configuration changes:

     ```bash
     terraform apply
     ```

  1. Type `yes` and press **Enter** to confirm changes.

     You can check updates in the [management console](https://console.yandex.cloud) or using this [CLI](../../cli/quickstart.md) command:

     ```bash
     yc alb http-router list
     ```

  {% note warning "Timeouts" %}
  
  The Terraform provider limits the execution time for operations with Application Load Balancer HTTP routers and virtual hosts to 10 minutes.
  
  Operations in excess of this time will be interrupted.
  
  {% cut "How do I modify these limits?" %}
  
  Add the `timeouts` section to the descriptions of the HTTP router and virtual host (the `yandex_alb_http_router` and `yandex_alb_virtual_host` resources, respectively).
  
  Here is an example:
  
  ```hcl
  resource "yandex_alb_http_router" "<router_name>" {
    ...
    timeouts {
      create = "60m"
      update = "60m"
      delete = "60m"
    }
  }
  ```
  
  {% endcut %}
  
  {% endnote %}

- API {#api}

  Use the [delete](../api-ref/HttpRouter/delete.md) REST API method for the [HttpRouter](../api-ref/HttpRouter/index.md) resource or the [HttpRouter/Delete](../api-ref/grpc/HttpRouter/delete.md) gRPC API call.

{% endlist %}