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

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

  • Example usage
  • Schema
  • Required
  • Optional
  • Read-Only
  • Nested Schema for auto_partitioning_settings
  • Nested Schema for auto_partitioning_settings.auto_partitioning_write_speed_strategy
  • Nested Schema for consumer
  • Nested Schema for timeouts
  • Import
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Managed Service for YDB
  4. Resources
  5. ydb_topic

yandex_ydb_topic (Resource)

Статья создана
Yandex Cloud
Обновлена 7 августа 2025 г.
  • Example usage
  • Schema
    • Required
    • Optional
    • Read-Only
    • Nested Schema for auto_partitioning_settings
    • Nested Schema for auto_partitioning_settings.auto_partitioning_write_speed_strategy
    • Nested Schema for consumer
    • Nested Schema for timeouts
  • Import

Manage a YDB Topic. For more information, see the official documentation.

Example usageExample usage

//
// Create a new YDB Topic.
//
resource "yandex_ydb_topic" "my_topic" {
  database_endpoint = yandex_ydb_database_serverless.database_name.ydb_full_endpoint
  name              = "topic-test"

  supported_codecs    = ["raw", "gzip"]
  partitions_count    = 1
  retention_period_ms = 2000000
  consumer {
    name                          = "consumer-name"
    supported_codecs              = ["raw", "gzip"]
    starting_message_timestamp_ms = 0
  }
}

resource "yandex_ydb_database_serverless" "database_name" {
  name        = "database-name"
  location_id = "ru-central1"
}

SchemaSchema

RequiredRequired

  • database_endpoint (String) YDB database endpoint.
  • name (String) Topic name.

OptionalOptional

  • auto_partitioning_settings (Block List, Max: 1) (see below for nested schema)
  • consumer (Block Set) Topic Readers. (see below for nested schema)
  • description (String) Topic description.
  • max_partitions_count (Number) Number of max active partitions. Default value 1.
  • metering_mode (String) Resource metering mode (reserved_capacity - based on the allocated resources or request_units - based on actual usage). This option applies to topics in serverless databases.
  • partition_write_speed_kbps (Number) Maximum allowed write speed per partition. If a write speed for a given partition exceeds this value, the write speed will be capped. Default value: 1024 (1MB).
  • partitions_count (Number) Number of min partitions. Default value 1.
  • retention_period_hours (Number) Data retention time. Default value 86400000.
  • retention_storage_mb (Number)
  • supported_codecs (Set of String) Supported data encodings. Can be one of gzip, raw or zstd.
  • timeouts (Block, Optional) (see below for nested schema)

Read-OnlyRead-Only

  • id (String) The ID of this resource.

Nested Schema for Nested Schema for auto_partitioning_settings

Optional:

  • auto_partitioning_strategy (String) The auto partitioning strategy to use
  • auto_partitioning_write_speed_strategy (Block List, Max: 1) (see below for nested schema)

Nested Schema for Nested Schema for auto_partitioning_settings.auto_partitioning_write_speed_strategy

Optional:

  • down_utilization_percent (Number) The down utilization percentage threshold
  • stabilization_window (Number) The stabilization window in seconds
  • up_utilization_percent (Number) The up utilization percentage threshold

Nested Schema for Nested Schema for consumer

Required:

  • name (String) Reader's name.

Optional:

  • important (Boolean) Defines an important consumer. No data will be deleted from the topic until all the important consumers read them. Default value false.
  • starting_message_timestamp_ms (Number) Timestamp in UNIX timestamp format from which the reader will start reading data. Default value 0.
  • supported_codecs (Set of String) Supported data encodings. Can be one of gzip, raw or zstd.

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).
  • default (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.
  • read (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). Read operations occur during any refresh or planning operation when refresh is enabled.
  • 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

The resource can be imported by using their resource ID. For getting the resource ID you can use Yandex Cloud Web Console or YC CLI.

# terraform import yandex_ydb_topic.<resource Name> <resource Id>
terraform import yandex_ydb_topic.my_topic ...

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

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