Skip to content

[dts_sync_config ] : column_mode field missing from tables block, causing API validation failure on PostgreSQL partial-table sync #4409

Description

@Rajendraladkat1919

Provider Version

1.83.20

Resource

tencentcloud_dts_sync_config

Terraform Configuration

resource "tencentcloud_dts_sync_config" "example" {
  ...
  objects {
    mode = "Partial"
    databases {
      db_name     = "product"
      db_mode     = "Partial"
      schema_name = "public"
      table_mode  = "Partial"

      tables {
        table_name = "bulk_upload_job"
        # column_mode cannot be set — field does not exist in provider schema
      }
    }
  }
}
Expected Behavior
The tables block should accept a column_mode field (value "All" or "Partial") so the Terraform
provider can forward it to the underlying DTS ConfigureSyncJob API call.

Actual Behavior
The column_mode field is absent from the tables block schema. The Tencent DTS API requires
ColumnMode to be set on every Tables object when TableMode = "Partial". Without it, the API
rejects the sync job configuration with a validation error.

Confirmed by Tencent Cloud DTS support: ColumnMode is a required parameter and must be set to "All"
for standard full-column synchronization.

Root Cause (code references)
The Table struct in the SDK already carries the field:


// vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/dts/v20211206/models.go
type Table struct {
    TableName       *string
    NewTableName    *string
    FilterCondition *string
    ColumnMode      *string  // present in SDK, NOT wired in provider
    Columns         []*Column
}
In tencentcloud/services/dts/resource_tc_dts_sync_config.go the tables schema block (around line 255)
defines only table_name, new_table_name, and filter_condition. column_mode is never added to the
schema, never read in the refresh path (~line 907), and never written in the create/update path (~line 1414).

**Suggested Fix** :
1. Schema — add the field:


"column_mode": {
    Type:     schema.TypeString,
    Optional: true,
    Description: "Column selection mode: All (sync all columns). Required by the API when table_mode is Partial.",
},

if tables.ColumnMode != nil {
    tablesMap["column_mode"] = tables.ColumnMode
}

if v, ok := tablesMap["column_mode"]; ok {
    table.ColumnMode = helper.String(v.(string))
}

**Workaround** :
None available through Terraform. The only current workaround is to configure the job manually via the
Tencent Cloud console or API outside of Terraform.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions