Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • ИИ для бизнеса
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Истории успеха
  • Документация
  • Блог
Проект Яндекса
© 2025 ООО «Яндекс.Облако»
Terraform в Yandex Cloud
  • Начало работы
  • Библиотека решений
    • Обзор
    • История изменений (англ.)
          • api_gateway

В этой статье:

  • Example usage
  • Schema
  • Required
  • Optional
  • Read-Only
  • Nested Schema for canary
  • Nested Schema for connectivity
  • Nested Schema for custom_domains
  • Nested Schema for log_options
  • Nested Schema for timeouts
  • Import
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Yandex API Gateway
  4. Resources
  5. api_gateway

yandex_api_gateway (Resource)

Статья создана
Yandex Cloud
Обновлена 11 сентября 2025 г.
  • Example usage
  • Schema
    • Required
    • Optional
    • Read-Only
    • Nested Schema for canary
    • Nested Schema for connectivity
    • Nested Schema for custom_domains
    • Nested Schema for log_options
    • Nested Schema for timeouts
  • Import

Allows management of Yandex Cloud API Gateway.

Example usageExample usage

//
// Create a new API Gateway
//
resource "yandex_api_gateway" "test-api-gateway" {
  name        = "some_name"
  description = "any description"
  labels = {
    label       = "label"
    empty-label = ""
  }
  custom_domains {
    fqdn           = "test.example.com"
    certificate_id = "<certificate_id_from_cert_manager>"
  }
  connectivity {
    network_id = "<dynamic network id>"
  }
  variables = {
    installation = "prod"
  }
  canary {
    weight = 20
    variables = {
      installation = "dev"
    }
  }
  log_options {
    log_group_id = "<log group id>"
    min_level    = "ERROR"
  }
  execution_timeout = "300"
  spec              = <<-EOT
openapi: "3.0.0"
info:
  version: 1.0.0
  title: Test API
x-yc-apigateway:
  variables:
    installation:
      default: "prod"
      enum:
       - "prod"
       - "dev"
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} from ${apigw.installation} release!\n"
EOT
}

SchemaSchema

RequiredRequired

  • name (String) The resource name.
  • spec (String) The OpenAPI specification for Yandex Cloud API Gateway.

OptionalOptional

  • canary (Block List, Max: 1) Canary release settings of gateway. (see below for nested schema)
  • connectivity (Block List, Max: 1) Gateway connectivity. If specified the gateway will be attached to specified network. (see below for nested schema)
  • custom_domains (Block Set) Set of custom domains to be attached to Yandex Cloud API Gateway. (see below for nested schema)
  • description (String) The resource description.
  • execution_timeout (String) Execution timeout in seconds for the Yandex Cloud API Gateway.
  • folder_id (String) The folder identifier that resource belongs to. If it is not provided, the default provider folder-id is used.
  • labels (Map of String) A set of key/value label pairs which assigned to resource.
  • log_options (Block List, Max: 1) Options for logging from Yandex Cloud API Gateway. (see below for nested schema)
  • timeouts (Block, Optional) (see below for nested schema)
  • variables (Map of String) A set of values for variables in gateway specification.

Read-OnlyRead-Only

  • created_at (String) The creation timestamp of the resource.

  • domain (String) Default domain for the Yandex Cloud API Gateway. Generated at creation time.

  • id (String) The ID of this resource.

  • log_group_id (String) ID of the log group for the Yandex Cloud API Gateway.

  • status (String) Status of the Yandex Cloud API Gateway.

  • user_domains (Set of String, Deprecated)

    Важно

    DEPRECATED Use custom_domains instead. Set of user domains attached to Yandex Cloud API Gateway.

Nested Schema for Nested Schema for canary

Optional:

  • variables (Map of String) A list of values for variables in gateway specification of canary release.
  • weight (Number) Percentage of requests, which will be processed by canary release.

Nested Schema for Nested Schema for connectivity

Required:

  • network_id (String) Network the gateway will have access to. It's essential to specify network with subnets in all availability zones.

Nested Schema for Nested Schema for custom_domains

Required:

  • certificate_id (String)
  • fqdn (String)

Optional:

  • domain_id (String)

Nested Schema for Nested Schema for log_options

Optional:

  • disabled (Boolean) Is logging from Yandex Cloud API Gateway disabled.
  • folder_id (String) Log entries are written to default log group for specified folder.
  • log_group_id (String) Log entries are written to specified log group.
  • min_level (String) Minimum log entry level.

Nested Schema for Nested Schema for timeouts

Optional:

  • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
  • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
  • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

ImportImport

Важно

Import for this resource is not implemented yet.

Была ли статья полезна?

Предыдущая
api_gateway
Следующая
yq_monitoring_connection
Проект Яндекса
© 2025 ООО «Яндекс.Облако»