Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Terraform in Yandex Cloud
  • Getting started
  • Solution library
    • Overview
    • Release notes
          • ydb_database_dedicated
          • ydb_database_iam_binding
          • ydb_database_serverless
          • ydb_table
          • ydb_table_changefeed
          • ydb_table_index
          • ydb_topic

In this article:

  • Example Usage
  • Schema
  • Required
  • Optional
  • Read-Only
  • Nested Schema for consumer
  • Nested Schema for timeouts
  • Import
  1. Terraform reference
  2. Resources
  3. Managed Service for YDB
  4. Resources
  5. ydb_table_changefeed

yandex_ydb_table_changefeed (Resource)

Written by
Yandex Cloud
Updated at August 7, 2025
  • Example Usage
  • Schema
    • Required
    • Optional
    • Read-Only
    • Nested Schema for consumer
    • Nested Schema for timeouts
  • Import

Yandex Database table changefeed, or Change Data Capture (CDC) resource, keeps you informed about changes in a given table. When you add, update, or delete a table row, the CDC mechanism generates a change record where it specifies the primary key of the row and writes it to the topic partition corresponding to this key. A topic is an entity for storing unstructured messages and delivering them to multiple subscribers. Basically, a topic is a named set of messages.

Example UsageExample Usage

//
// Create a new YDB Table Change feed.
//
resource "yandex_ydb_table_changefeed" "ydb_changefeed" {
  table_id = yandex_ydb_table.test_table_2.id
  name     = "changefeed"
  mode     = "NEW_IMAGE"
  format   = "JSON"

  consumer {
    name = "test_consumer"
  }
}

SchemaSchema

RequiredRequired

  • format (String) Changefeed format.
  • mode (String) Changefeed mode.
  • name (String) Changefeed name.

OptionalOptional

  • connection_string (String) Connection string, conflicts with table_id.
  • consumer (Block List) Changefeed consumers - named entities for reading data from the topic. (see below for nested schema)
  • retention_period (String) Time of data retention in the topic, ISO 8601 format.
  • table_id (String) Terraform resource ID of the table.
  • table_path (String) Table path.
  • timeouts (Block, Optional) (see below for nested schema)
  • virtual_timestamps (Boolean) Use virtual timestamps.

Read-OnlyRead-Only

  • id (String) The ID of this resource.

Nested Schema for Nested Schema for consumer

Required:

  • name (String) Consumer name. It is used in the SDK or CLI to read data from the topic.

Optional:

  • important (Boolean)
  • starting_message_timestamp_ms (Number) Timestamp in the UNIX timestamp format, from which the consumer will start reading data.
  • supported_codecs (List of String) Supported data encodings.

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_table_changefeed.<resource Name> <resource Id>
terraform import yandex_ydb_table_changefeed.ydb_changefeed ...

Was the article helpful?

Previous
ydb_table
Next
ydb_table_index
© 2025 Direct Cursus Technology L.L.C.