Skip to content

Configuration

ddb-data-check.toml:

toml
# ddb-data-check 配置文件示例
# 启动方式: ./ddb-data-check ddb-data-check.toml

check_mode = "source"                     # 以源端数据为基准校验

[source]
access_key_id = ""                        # 可通过 SOURCE_ACCESS_KEY_ID 传入
secret_access_key = ""                    # 可通过 SOURCE_SECRET_ACCESS_KEY 传入
region = "us-east-1"                     # endpoint_url 为空时必填
endpoint_url = ""                        # AWS 官方端点留空;自定义 endpoint 默认跳过 TLS 验证
table = "source_table"

[target]
access_key_id = "username:password"        # Tair 使用“账号:密码”格式
secret_access_key = "dummy"               # 固定占位值
region = "us-east-1"                     # 自定义 endpoint 可省略,默认 us-east-1
endpoint_url = "http://your-endpoint:80"  # 自定义 endpoint 默认跳过 TLS 验证
table = "target_table"

AWS credentials can be stored in the configuration file or supplied through SOURCE_ACCESS_KEY_ID, SOURCE_SECRET_ACCESS_KEY, TARGET_ACCESS_KEY_ID, and TARGET_SECRET_ACCESS_KEY. When both AK and SK are empty, the AWS default credential chain is used.

When endpoint_url is empty, region is required. With a custom endpoint, region can be omitted and the default signing Region is us-east-1.

For a Tair target, set access_key_id to account:password and set secret_access_key to the fixed value dummy.

shell
./ddb-data-check ddb-data-check.toml

The command creates ddb-data-check-diff/report.json. Generate the HTML report with:

shell
python3 analyze_report.py ddb-data-check-diff/report.json

check_mode = "source" detects source items that are missing or different on target. Run again with check_mode = "target" to detect target-only items.

Released under the MIT License.