Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Истории успеха
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • ML Services
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Тарифы Yandex Cloud
    • Промоакции и 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 column
  • Nested Schema for family
  • Nested Schema for partitioning_settings
  • Nested Schema for partitioning_settings.partition_at_keys
  • Nested Schema for timeouts
  • Nested Schema for ttl
  • Import
  1. Справочник Terraform
  2. Ресурсы (англ.)
  3. Managed Service for YDB
  4. Resources
  5. ydb_table

yandex_ydb_table (Resource)

Статья создана
Yandex Cloud
Обновлена 18 сентября 2025 г.
  • Example usage
  • Schema
    • Required
    • Optional
    • Read-Only
    • Nested Schema for column
    • Nested Schema for family
    • Nested Schema for partitioning_settings
    • Nested Schema for partitioning_settings.partition_at_keys
    • Nested Schema for timeouts
    • Nested Schema for ttl
  • 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"]
  }
}

SchemaSchema

RequiredRequired

  • column (Block Set, Min: 1) A list of column configuration options. (see below for nested schema)
  • connection_string (String) Connection string for database.
  • path (String) Table path.
  • primary_key (List of String) A list of table columns to be used as primary key.

OptionalOptional

  • attributes (Map of String) A map of table attributes.
  • family (Block List) A list of column group configuration options. The family block may be used to group columns into families to set shared parameters for them. (see below for nested schema)
  • key_bloom_filter (Boolean) Use the Bloom filter for the primary key.
  • partitioning_settings (Block List, Max: 1) Table partitioning settings. (see below for nested schema)
  • 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).
  • timeouts (Block, Optional) (see below for nested schema)
  • ttl (Block Set, Max: 1) The TTL block supports allow you to create a special column type, TTL column, whose values determine the time-to-live for rows. (see below for nested schema)

Read-OnlyRead-Only

  • id (String) The ID of this resource.

Nested Schema for Nested Schema for column

Required:

  • name (String) Column name.
  • type (String) Column data type. YQL data types are used.

Optional:

  • family (String) Column group.
  • not_null (Boolean) A column cannot have the NULL data type. Default: false.

Nested Schema for Nested Schema for family

Required:

  • compression (String) Data codec (acceptable values: off, lz4).
  • data (String) Type of storage device for column data in this group (acceptable values: ssd, rot (from HDD spindle rotation)).
  • name (String) Column family name.

Nested Schema for Nested Schema for partitioning_settings

Optional:

  • auto_partitioning_by_load (Boolean)
  • auto_partitioning_by_size_enabled (Boolean)
  • auto_partitioning_max_partitions_count (Number)
  • auto_partitioning_min_partitions_count (Number)
  • auto_partitioning_partition_size_mb (Number)
  • partition_at_keys (Block List) (see below for nested schema)
  • 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)

Nested Schema for Nested Schema for partitioning_settings.partition_at_keys

Required:

  • keys (List of String)

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).

Nested Schema for Nested Schema for ttl

Required:

  • column_name (String) Column name for TTL.
  • expire_interval (String) Interval in the ISO 8601 format.

Optional:

  • unit (String)

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_table.<resource Name> <resource Id>
terraform import yandex_ydb_table.test_table ...

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

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