Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex API Gateway
  • Getting started
    • All guides
    • Creating an API gateway
      • Updating API gateways and their specifications
      • Adding a domain
      • Specifying a cloud network
      • Setting up variables
      • Setting up a canary release
      • Viewing monitoring charts
      • Removing a domain
      • Migration to the ru-central1-d availability zone
      • Deleting an API gateway
    • Viewing operations with service resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Managing an API gateway
  3. Deleting an API gateway

Deleting an API gateway

Written by
Yandex Cloud
Updated at April 22, 2025
Management console
CLI
Terraform
API
Yandex Cloud Toolkit

To delete an API gateway:

  1. In the management console, go to the folder where you want to delete an API gateway.
  2. In the list of services, select API Gateway.
  3. In the API gateway row, click and select Delete.
  4. In the window that opens, click Delete.

To delete an API gateway, run this command:

yc serverless api-gateway delete --id <API_gateway_ID>

Result:

done (18s)

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

To delete an API gateway created using Terraform:

  1. Open the Terraform configuration file and delete the fragment with the API gateway description.

    Example API gateway description in the Terraform configuration:

    ...
    resource "yandex_api_gateway" "test-api-gateway" {
      name        = "some_name"
      description = "any description"
      labels      = {
        label       = "label"
        empty-label = ""
      }
      spec = <<-EOT
        openapi: "3.0.0"
        info:
          version: 1.0.0
          title: Test API
        paths:
          /hello:
            get:
              summary: Say hello
              operationId: hello
              parameters:
                - name: user
                  in: query
                  description: User name to appear in greetings.
                  required: false
                  schema:
                    type: string
                    default: 'world'
              responses:
                '200':
                  description: Greeting.
                  content:
                    'text/plain':
                      schema:
                        type: "string"
              x-yc-apigateway-integration:
                type: dummy
                http_code: 200
                http_headers:
                  'Content-Type': "text/plain"
                content:
                  'text/plain': "Hello again, {user}!\n"
      EOT
    }
    ...
    
  2. In the command line, go to the directory with the Terraform configuration file.

  3. Check the configuration using this command:

    terraform validate
    

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

    Success! The configuration is valid.
    
  4. Run this command:

    terraform plan
    

    The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.

  5. Apply the configuration changes:

    terraform apply
    
  6. Confirm the changes: type yes into the terminal and press Enter.

    You can check the update using the management console or this CLI command:

    yc serverless api-gateway list
    

To delete an API gateway, use the delete REST API method for the ApiGateway resource or the ApiGatewayService/Delete gRPC API call.

You can delete an API gateway using the Yandex Cloud Toolkit plugin for the IDE family on the JetBrains IntelliJ platform.

Was the article helpful?

Previous
Migration to the ru-central1-d availability zone
Next
Getting a list of triggers
© 2025 Direct Cursus Technology L.L.C.