Managing YDB topic configurations
Written by
Updated at November 26, 2024
For operations with topicsyandex_ydb_topic
resource.
Note
We recommend creating a topic in a separate folder. A topic in the database root visually breaks the database structure.
yandex_ydb_topic
resource
Description of the Usage example for yandex_ydb_topic
:
resource "yandex_ydb_topic" "ydb_topic" {
database_endpoint = yandex_ydb_database_serverless.database1.ydb_full_endpoint # DB connection example
name = "test_dir/test_topic"
supported_codecs = ["zstd"]
consumer {
name = "test-consumer1"
starting_message_timestamp_ms = 0
supported_codecs = ["zstd","raw"]
}
consumer {
name = "test-consumer2"
starting_message_timestamp_ms = 2000
supported_codecs = ["zstd"]
}
consumer {
name = "test-consumer3"
starting_message_timestamp_ms = 0
supported_codecs = ["zstd"]
}
}
The following fields are supported:
Field name | Type | Description |
---|---|---|
name |
string required |
Topic name |
database_endpoint |
string required |
Full database path |
retention_period_ms |
number optional |
Data retention period, in ms. Default value: 86400000 (full day) |
partitions_count |
number optional |
Number of partitions; default: 2 |
supported_codecs |
list(string) optional |
Supported data compression codecs; default: "gzip", "raw", "zstd" .Can be combined as needed. |
consumer |
consumer |
Topic consumers |
Note
You can create but cannot delete a consumer using Terraform. You can delete a consumer using the management console
Data consumer
Field name | Type | Description |
---|---|---|
name |
string required |
Reader name |
supported_codecs |
list(string) optional |
Supported data compression codecs; default: "gzip", "raw", "zstd" . Can be combined as needed. |
starting_message_timestamp_ms |
number optional |
UNIX timestamp0 , i.e., from start of delivery. |