Yandex Cloud
Поиск
Связаться с намиПопробовать бесплатно
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
  • Marketplace
    • Доступны в регионе
    • Инфраструктура и сеть
    • Платформа данных
    • Искусственный интеллект
    • Безопасность
    • Инструменты DevOps
    • Бессерверные вычисления
    • Управление ресурсами
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Партнёрская программа
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Калькулятор цен
    • Тарифы
    • Акции и free tier
  • Истории успеха
  • Документация
  • Блог
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ТОО «Облачные Сервисы Казахстан»
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
  • Arguments & Attributes Reference
  • Import
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Managed Service for YDB
  4. Resources
  5. ydb_table

yandex_ydb_table (Resource)

Статья создана
Yandex Cloud
Обновлена 9 февраля 2026 г.
  • Example usage
  • Arguments & Attributes Reference
  • Import

Yandex Database table.

Example usageExample usage

//
// Create a new row-oriented YDB Table.
//
resource "yandex_ydb_table" "test_table" {
  path              = "test_dir/test_table_3_col"
  connection_string = yandex_ydb_database_serverless.database1.ydb_full_endpoint

  column {
    name     = "a"
    type     = "Utf8"
    not_null = true
  }
  column {
    name     = "b"
    type     = "Uint32"
    not_null = true
  }
  column {
    name     = "c"
    type     = "Int32"
    not_null = false
  }
  column {
    name = "d"
    type = "Timestamp"
  }

  primary_key = ["a", "b"]
}
//
// Create a new column-oriented YDB Table.
//
resource "yandex_ydb_table" "test_table" {
  path              = "test_dir/test_table_3_col"
  connection_string = yandex_ydb_database_serverless.database1.ydb_full_endpoint

  column {
    name     = "a"
    type     = "Utf8"
    not_null = true
  }
  column {
    name     = "b"
    type     = "Uint32"
    not_null = true
  }
  column {
    name     = "c"
    type     = "Int32"
    not_null = false
  }
  column {
    name = "d"
    type = "Timestamp"
  }

  primary_key = ["a", "b"]

  store = "column"

  partitioning_settings {
    partition_by = ["b", "a"]
  }
}

Arguments & Attributes ReferenceArguments & Attributes Reference

  • attributes (Map Of String). A map of table attributes.
  • connection_string (Required)(String). Connection string for database.
  • id (String).
  • key_bloom_filter (Bool). Use the Bloom filter for the primary key.
  • path (Required)(String). Table path.
  • primary_key (Required)(List Of String). A list of table columns to be used as primary key.
  • read_replicas_settings (String). Read replication settings.
  • store (String). Table storage type. Set to column for column-oriented tables. Omit for row-oriented tables (default).
  • column [Block]. A list of column configuration options.
    • family (String). Column group.
    • name (Required)(String). Column name.
    • not_null (Bool). A column cannot have the NULL data type. Default: false.
    • type (Required)(String). Column data type. YQL data types are used.
  • family [Block]. A list of column group configuration options. The family block may be used to group columns into families to set shared parameters for them.
    • compression (Required)(String). Data codec (acceptable values: off, lz4).
    • data (Required)(String). Type of storage device for column data in this group (acceptable values: ssd, rot (from HDD spindle rotation)).
    • name (Required)(String). Column family name.
  • partitioning_settings [Block]. Table partitioning settings.
    • auto_partitioning_by_load (Bool).
    • auto_partitioning_by_size_enabled (Bool).
    • auto_partitioning_max_partitions_count (Number).
    • auto_partitioning_min_partitions_count (Number).
    • auto_partitioning_partition_size_mb (Number).
    • partition_by (List Of String). Partitioning keys constitute a subset of the table's primary keys. If not set, primary keys will be used.
    • uniform_partitions (Number).
    • partition_at_keys [Block].
      • keys (Required)(List Of String).
  • ttl [Block]. The TTL block supports allow you to create a special column type, TTL column, whose values determine the time-to-live for rows.
    • column_name (Required)(String). Column name for TTL.
    • expire_interval (Required)(String). Interval in the ISO 8601 format.
    • unit (String).

ImportImport

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

# terraform import yandex_ydb_table.<resource Name> <resource Id>
terraform import yandex_ydb_table.test_table ...

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

Предыдущая
ydb_database_serverless
Следующая
ydb_table_changefeed
Создавайте контент и получайте гранты!Готовы написать своё руководство? Участвуйте в контент-программе и получайте гранты на работу с облачными сервисами!
Подробнее о программе
Проект Яндекса
© 2026 ТОО «Облачные Сервисы Казахстан»