yandex_datatransfer_transfer (Resource)
Статья создана
Обновлена 7 августа 2025 г.
- Example usage
- Schema
- Optional
- Read-Only
- Nested Schema for runtime
- Nested Schema for runtime.yc_runtime
- Nested Schema for runtime.yc_runtime.upload_shard_params
- Nested Schema for transformation
- Nested Schema for transformation.transformers
- Nested Schema for transformation.transformers.convert_to_string
- Nested Schema for transformation.transformers.convert_to_string.columns
- Nested Schema for transformation.transformers.convert_to_string.tables
- Nested Schema for transformation.transformers.filter_columns
- Nested Schema for transformation.transformers.filter_columns.columns
- Nested Schema for transformation.transformers.filter_columns.tables
- Nested Schema for transformation.transformers.filter_rows
- Nested Schema for transformation.transformers.filter_rows.tables
- Nested Schema for transformation.transformers.mask_field
- Nested Schema for transformation.transformers.mask_field.function
- Nested Schema for transformation.transformers.mask_field.function.mask_function_hash
- Nested Schema for transformation.transformers.mask_field.tables
- Nested Schema for transformation.transformers.rename_tables
- Nested Schema for transformation.transformers.rename_tables.rename_tables
- Nested Schema for transformation.transformers.rename_tables.rename_tables.new_name
- Nested Schema for transformation.transformers.rename_tables.rename_tables.original_name
- Nested Schema for transformation.transformers.replace_primary_key
- Nested Schema for transformation.transformers.replace_primary_key.tables
- Nested Schema for transformation.transformers.sharder_transformer
- Nested Schema for transformation.transformers.sharder_transformer.columns
- Nested Schema for transformation.transformers.sharder_transformer.tables
- Nested Schema for transformation.transformers.table_splitter_transformer
- Nested Schema for transformation.transformers.table_splitter_transformer.tables
- Import
Manages a Data Transfer transfer. For more information, see the official documentation.
Example usage
//
// Create a new pair of Data Transfer Endpoints Source & Target and Data Transfer.
//
// Create Data Transfer Endpoint "Source"
resource "yandex_datatransfer_endpoint" "pg_source" {
name = "pg-test-source"
settings {
postgres_source {
connection {
on_premise {
hosts = [
"example.org"
]
port = 5432
}
}
slot_gigabyte_lag_limit = 100
database = "db1"
user = "user1"
password {
raw = "123"
}
}
}
}
// Create Data Transfer Endpoint "Target"
resource "yandex_datatransfer_endpoint" "pg_target" {
folder_id = "some_folder_id"
name = "pg-test-target2"
settings {
postgres_target {
connection {
mdb_cluster_id = "some_cluster_id"
}
database = "db2"
user = "user2"
password {
raw = "321"
}
}
}
}
// Create Data Transfer from "Source" to "Target"
resource "yandex_datatransfer_transfer" "pgpg_transfer" {
folder_id = "some_folder_id"
name = "pgpg"
source_id = yandex_datatransfer_endpoint.pg_source.id
target_id = yandex_datatransfer_endpoint.pg_target.id
type = "SNAPSHOT_AND_INCREMENT"
runtime {
yc_runtime {
job_count = 1
upload_shard_params {
job_count = 4
process_count = 1
}
}
}
transformation {
transformers {
# one of transformer
}
transformers {
# one of transformer
}
# ...
}
}
Schema
Optional
description
(String) The resource description.folder_id
(String) The folder identifier that resource belongs to. If it is not provided, the default providerfolder-id
is used.labels
(Map of String) A set of key/value label pairs which assigned to resource.name
(String) The resource name.on_create_activate_mode
(String) Activation action on create a new incremental transfer. It is not part of the transfer parameter and is used only on create. One ofsync_activate
,async_activate
,dont_activate
. The default issync_activate
.runtime
(Block List, Max: 1) Runtime parameters for the transfer. (see below for nested schema)source_id
(String) ID of the source endpoint for the transfer.target_id
(String) ID of the target endpoint for the transfer.transformation
(Block List, Max: 1) Transformation for the transfer. (see below for nested schema)type
(String) Type of the transfer. One ofSNAPSHOT_ONLY
,INCREMENT_ONLY
,SNAPSHOT_AND_INCREMENT
Read-Only
id
(String) The ID of this resource.warning
(String) Error description if transfer has any errors.
runtime
Nested Schema for Optional:
yc_runtime
(Block List, Max: 1) YC Runtime parameters for the transfer. (see below for nested schema)
runtime.yc_runtime
Nested Schema for Optional:
job_count
(Number) Number of workers in parallel replication.upload_shard_params
(Block List, Max: 1) Parallel snapshot parameters. (see below for nested schema)
runtime.yc_runtime.upload_shard_params
Nested Schema for Optional:
job_count
(Number) Number of workers.process_count
(Number) Number of threads.
transformation
Nested Schema for Optional:
transformers
(Block List) A list of transformers. You can specify exactly 1 transformer in each element of list. (see below for nested schema)
transformation.transformers
Nested Schema for Optional:
convert_to_string
(Block List, Max: 1) Convert column values to strings. (see below for nested schema)filter_columns
(Block List, Max: 1) Set up a list of table columns to transfer. (see below for nested schema)filter_rows
(Block List, Max: 1) This filter only applies to transfers with queues (Apache Kafka®) as a data source. When running a transfer, only the strings meeting the specified criteria remain in a changefeed. (see below for nested schema)mask_field
(Block List, Max: 1) Mask field transformer allows you to hash data. (see below for nested schema)rename_tables
(Block List, Max: 1) Set rules for renaming tables by specifying the current names of the tables in the source and new names for these tables in the target. (see below for nested schema)replace_primary_key
(Block List, Max: 1) Override primary keys. (see below for nested schema)sharder_transformer
(Block List, Max: 1) Set the number of shards for particular tables and a list of columns whose values will be used for calculating a hash to determine a shard. (see below for nested schema)table_splitter_transformer
(Block List, Max: 1) Splits the X table into multiple tables (X_1, X_2, ..., X_n) based on data. (see below for nested schema)
transformation.transformers.convert_to_string
Nested Schema for Optional:
columns
(Block List, Max: 1) List of the columns to transfer to the target tables using lists of included and excluded columns. (see below for nested schema)tables
(Block List, Max: 1) Table filter. (see below for nested schema)
transformation.transformers.convert_to_string.columns
Nested Schema for Optional:
exclude_columns
(List of String) List of columns that will be excluded to transfer.include_columns
(List of String) List of columns that will be included to transfer.
transformation.transformers.convert_to_string.tables
Nested Schema for Optional:
exclude_tables
(List of String) List of tables that will be excluded to transfer.include_tables
(List of String) List of tables that will be included to transfer.
transformation.transformers.filter_columns
Nested Schema for Optional:
columns
(Block List, Max: 1) List of the columns to transfer to the target tables using lists of included and excluded columns. (see below for nested schema)tables
(Block List, Max: 1) Table filter. (see below for nested schema)
transformation.transformers.filter_columns.columns
Nested Schema for Optional:
exclude_columns
(List of String)include_columns
(List of String)
transformation.transformers.filter_columns.tables
Nested Schema for Optional:
exclude_tables
(List of String)include_tables
(List of String)
transformation.transformers.filter_rows
Nested Schema for Optional:
filter
(String) Filtering criterion. This can be comparison operators for numeric, string, and Boolean values, comparison to NULL, and checking whether a substring is part of a string. See details here.tables
(Block List, Max: 1) Table filter. (see below for nested schema)
transformation.transformers.filter_rows.tables
Nested Schema for Optional:
exclude_tables
(List of String)include_tables
(List of String)
transformation.transformers.mask_field
Nested Schema for Optional:
columns
(List of String) List of strings that specify the name of the column for data masking (a regular expression).function
(Block List, Max: 1) Mask function. (see below for nested schema)tables
(Block List, Max: 1) Table filter. (see below for nested schema)
transformation.transformers.mask_field.function
Nested Schema for Optional:
mask_function_hash
(Block List, Max: 1) Hash mask function. (see below for nested schema)
transformation.transformers.mask_field.function.mask_function_hash
Nested Schema for Optional:
user_defined_salt
(String) This string will be used in the HMAC(sha256, salt) function applied to the column data.
transformation.transformers.mask_field.tables
Nested Schema for Optional:
exclude_tables
(List of String)include_tables
(List of String)
transformation.transformers.rename_tables
Nested Schema for Optional:
rename_tables
(Block List) List of renaming rules. (see below for nested schema)
transformation.transformers.rename_tables.rename_tables
Nested Schema for Optional:
new_name
(Block List, Max: 1) Specify the new names for this table in the target. (see below for nested schema)original_name
(Block List, Max: 1) Specify the current names of the table in the source. (see below for nested schema)
transformation.transformers.rename_tables.rename_tables.new_name
Nested Schema for Optional:
name
(String)name_space
(String)
transformation.transformers.rename_tables.rename_tables.original_name
Nested Schema for Optional:
name
(String)name_space
(String)
transformation.transformers.replace_primary_key
Nested Schema for Optional:
keys
(List of String) List of columns to be used as primary keys.tables
(Block List, Max: 1) Table filter. (see below for nested schema)
transformation.transformers.replace_primary_key.tables
Nested Schema for Optional:
exclude_tables
(List of String)include_tables
(List of String)
transformation.transformers.sharder_transformer
Nested Schema for Optional:
columns
(Block List, Max: 1) List of the columns to transfer to the target tables using lists of included and excluded columns. (see below for nested schema)shards_count
(Number) Number of shards.tables
(Block List, Max: 1) Table filter. (see below for nested schema)
transformation.transformers.sharder_transformer.columns
Nested Schema for Optional:
exclude_columns
(List of String)include_columns
(List of String)
transformation.transformers.sharder_transformer.tables
Nested Schema for Optional:
exclude_tables
(List of String)include_tables
(List of String)
transformation.transformers.table_splitter_transformer
Nested Schema for Optional:
columns
(List of String) List of strings that specify the columns in the tables to be partitioned.splitter
(String) Specify the split string to be used for merging components in a new table name.tables
(Block List, Max: 1) Table filter. (see below for nested schema)
transformation.transformers.table_splitter_transformer.tables
Nested Schema for Optional:
exclude_tables
(List of String)include_tables
(List of String)
Import
The resource can be imported by using their resource ID
. For getting the resource ID you can use Yandex Cloud Web Console
# terraform import yandex_datatransfer_transfer.<resource Name> <resource Id>
terraform import yandex_datatransfer_endpoint.my_dt_transfer dttnc**********r3bkg