alibabacloud-dts-task-manager

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Alibaba Cloud DTS Task Manager

阿里云DTS任务管理器

Overview

概述

Manage Alibaba Cloud DTS (Data Transmission Service) tasks: create data migration/synchronization tasks, view task status/latency, stop/start/release tasks. All operations are guided interactively.
管理阿里云DTS(数据传输服务)任务:创建数据迁移/同步任务、查看任务状态/延迟、停止/启动/释放任务,所有操作均为交互式引导。

Parameter Parsing

参数解析

Determine the operation mode based on user input, and read the corresponding references file for detailed workflow:
User IntentKeywordsActionReference File
Create migration taskempty / "create" / "new" / "migration"Interactive creation
references/create-task.md
Create sync task"sync" / "synchronization"Interactive sync task creation
references/create-task.md
View task list"list" / "view" / "ls"List all tasks
references/list-tasks.md
View task status"status ID"View specified task details
references/task-status.md
Stop task"stop ID" / "suspend ID" / "pause ID"Suspend specified task
references/suspend-task.md
Start/Resume task"start ID" / "resume ID"Start or resume task
references/start-task.md
Release task"release ID" / "delete ID" / "remove ID"Release (delete) task
references/delete-task.md
Environment setup"setup" / "configure" / "init"Check and configure environment
references/setup.md
When no parameters are provided, ask the user to choose the desired operation.
根据用户输入判断操作模式,读取对应参考文件获取详细工作流:
用户意图关键词操作参考文件
创建迁移任务空 / "create" / "new" / "migration"交互式创建
references/create-task.md
创建同步任务"sync" / "synchronization"交互式创建同步任务
references/create-task.md
查看任务列表"list" / "view" / "ls"列出所有任务
references/list-tasks.md
查看任务状态"status ID"查看指定任务详情
references/task-status.md
停止任务"stop ID" / "suspend ID" / "pause ID"暂停指定任务
references/suspend-task.md
启动/恢复任务"start ID" / "resume ID"启动或恢复任务
references/start-task.md
释放任务"release ID" / "delete ID" / "remove ID"释放(删除)任务
references/delete-task.md
环境配置"setup" / "configure" / "init"检查并配置环境
references/setup.md
未提供参数时,询问用户选择需要执行的操作。

Step-by-Step Operation Workflows

分步操作工作流

Create Task (Migration / Sync)

创建任务(迁移/同步)

Steps (full details in
references/create-task.md
):
  1. Prerequisites check (CLI installed, auth configured)
  2. Select Region + Task type (MIGRATION or SYNC)
  3. Configure source: engine type, access method, connection info, optional SSL
  4. Configure destination: engine type, access method, connection info, optional SSL
  5. Define migration objects: full database or specific tables, with optional name mapping
  6. Select migration types: schema / full data / incremental (default: all)
  7. Select instance class: micro / small / medium / large
  8. Review summary (passwords shown as
    ******
    ) and confirm
  9. Execute: CreateDtsInstance -> ConfigureDtsJob -> StartDtsJob
  10. On failure at any step after instance creation, auto-release the instance
Example input: "Create a MySQL to Kafka sync task" Example output:
DTS task created successfully!
  Instance ID: <dts-instance-id>
  Job ID:      <job-id>
  Status:      Initializing

To check status:  aliyun dts DescribeDtsJobDetail --DtsJobId <job-id> --RegionId cn-hangzhou
步骤(完整详情见
references/create-task.md
):
  1. 前置检查(CLI已安装、身份认证已配置)
  2. 选择地域 + 任务类型(MIGRATION 或 SYNC)
  3. 配置源端:引擎类型、访问方式、连接信息、可选SSL
  4. 配置目标端:引擎类型、访问方式、连接信息、可选SSL
  5. 定义迁移对象:整库或指定表,支持可选名称映射
  6. 选择迁移类型:schema / 全量数据 / 增量(默认全选)
  7. 选择实例规格:micro / small / medium / large
  8. 查看汇总信息(密码显示为
    ******
    )并确认
  9. 执行流程:CreateDtsInstance -> ConfigureDtsJob -> StartDtsJob
  10. 实例创建后任意步骤失败,自动释放实例避免产生费用
输入示例:"Create a MySQL to Kafka sync task" 输出示例
DTS task created successfully!
  Instance ID: <dts-instance-id>
  Job ID:      <job-id>
  Status:      Initializing

To check status:  aliyun dts DescribeDtsJobDetail --DtsJobId <job-id> --RegionId cn-hangzhou

List Tasks

列出任务

Steps (full details in
references/list-tasks.md
):
  1. Prerequisites check
  2. Query tasks by each JobType (MIGRATION, SYNC, SUBSCRIBE) separately
  3. Display consolidated results in table format
Example input: "List my DTS tasks" Example output:
| Task ID        | Name                         | Type      | Status         | Source       | Destination  | Delay  |
|----------------|------------------------------|-----------|----------------|--------------|--------------|--------|
| <job-id-1>     | migration-mysql-mysql-0401   | MIGRATION | Migrating      | RDS MySQL    | RDS MySQL    | -      |
| <job-id-2>     | sync-mysql-kafka-0401        | SYNC      | Synchronizing  | RDS MySQL    | Kafka        | 128ms  |
步骤(完整详情见
references/list-tasks.md
):
  1. 前置检查
  2. 按每个任务类型(MIGRATION、SYNC、SUBSCRIBE)分别查询任务
  3. 以表格格式展示合并后的结果
输入示例:"List my DTS tasks" 输出示例
| Task ID        | Name                         | Type      | Status         | Source       | Destination  | Delay  |
|----------------|------------------------------|-----------|----------------|--------------|--------------|--------|
| <job-id-1>     | migration-mysql-mysql-0401   | MIGRATION | Migrating      | RDS MySQL    | RDS MySQL    | -      |
| <job-id-2>     | sync-mysql-kafka-0401        | SYNC      | Synchronizing  | RDS MySQL    | Kafka        | 128ms  |

View Task Status

查看任务状态

Steps (full details in
references/task-status.md
):
  1. Prerequisites check
  2. Resolve ID: if only one ID given, look up via DescribeDtsJobs first
  3. Call DescribeDtsJobDetail
  4. Display status, progress, delay (convert ms to readable format)
Example input: "Check status of <job-id>" Example output:
Task: <job-id> (migration-mysql-mysql-0401)
Type:   MIGRATION
Status: Migrating
Progress:
  Schema migration:    Finished
  Full data migration: Finished (1,234,567 rows)
  Incremental:         Running, delay 236ms
Source:      RDS MySQL <source-instance-id> (cn-hangzhou)
Destination: RDS MySQL <dest-instance-id> (cn-hangzhou)
步骤(完整详情见
references/task-status.md
):
  1. 前置检查
  2. 解析ID:如果仅提供一个ID,先通过DescribeDtsJobs查询
  3. 调用DescribeDtsJobDetail接口
  4. 展示状态、进度、延迟(将毫秒转换为易读格式)
输入示例:"Check status of <job-id>" 输出示例
Task: <job-id> (migration-mysql-mysql-0401)
Type:   MIGRATION
Status: Migrating
Progress:
  Schema migration:    Finished
  Full data migration: Finished (1,234,567 rows)
  Incremental:         Running, delay 236ms
Source:      RDS MySQL <source-instance-id> (cn-hangzhou)
Destination: RDS MySQL <dest-instance-id> (cn-hangzhou)

Stop / Start / Release Task

停止/启动/释放任务

Stop (full details in
references/suspend-task.md
):
  1. Resolve ID, display task info, confirm, then call SuspendDtsJob
Start/Resume (full details in
references/start-task.md
):
  1. Resolve ID, then call StartDtsJob
Release/Delete (full details in
references/delete-task.md
):
  1. Resolve ID
  2. Pre-check: call DescribeDtsJobDetail to check current status
  3. If task is active (Synchronizing/Migrating/InitializingDataLoad), warn user and require explicit confirmation
  4. Double confirmation required before calling DeleteDtsJob
停止(完整详情见
references/suspend-task.md
):
  1. 解析ID、展示任务信息、确认后调用SuspendDtsJob接口
启动/恢复(完整详情见
references/start-task.md
):
  1. 解析ID后调用StartDtsJob接口
释放/删除(完整详情见
references/delete-task.md
):
  1. 解析ID
  2. 前置检查:调用DescribeDtsJobDetail检查当前状态
  3. 如果任务处于活跃状态(同步中/迁移中/初始化数据加载中),警告用户并要求显式确认
  4. 调用DeleteDtsJob前需要二次确认

Environment Setup

环境配置

Steps (full details in
references/setup.md
):
  1. Check aliyun CLI installation
  2. Check authentication configuration
  3. Test connectivity with a DescribeDtsJobs call
步骤(完整详情见
references/setup.md
):
  1. 检查aliyun CLI安装情况
  2. 检查身份认证配置
  3. 调用DescribeDtsJobs测试连通性

Edge Cases

边缘场景处理

  • User provides only one ID: Try it as DtsJobId first; look up DtsInstanceId via DescribeDtsJobs. If DtsInstanceID field is empty on the task, pass only DtsJobId.
  • API parameter case inconsistency:
    DescribeDtsJobDetail
    uses
    --DtsInstanceID
    (uppercase D), while
    DeleteDtsJob
    /
    ConfigureDtsJob
    use
    --DtsInstanceId
    (lowercase d). Always verify with
    aliyun dts <API> help
    before calling.
  • Ambiguous ID format: If the ID doesn't clearly match DtsJobId or DtsInstanceId pattern, fuzzy search via DescribeDtsJobs.
  • Delete active task: Never delete a running task without pre-check. Query status first; if Synchronizing/Migrating, prompt user to suspend first or explicitly confirm forced deletion.
  • Creation failure mid-flow: If CreateDtsInstance succeeds but ConfigureDtsJob or StartDtsJob fails, auto-release the created instance to avoid ongoing charges.
  • Timeout / retry: All API calls use
    --read-timeout 30 --connect-timeout 10
    . CreateDtsInstance includes
    --ClientToken
    (UUID) for idempotent retries.
  • Multi-region queries: When listing tasks, query MIGRATION/SYNC/SUBSCRIBE separately per region. The
    --JobType
    parameter defaults to MIGRATION; omitting it silently drops sync/subscribe tasks. Never use
    --Type
    (causes InvalidParameter).
  • MongoDB specifics: MongoDB endpoints require
    --SourceEndpointDatabaseName
    in ConfigureDtsJob.
  • 用户仅提供一个ID:先尝试作为DtsJobId查询,通过DescribeDtsJobs查找DtsInstanceId。如果任务的DtsInstanceID字段为空,仅传递DtsJobId即可。
  • API参数大小写不一致
    DescribeDtsJobDetail
    使用
    --DtsInstanceID
    (D大写),而
    DeleteDtsJob
    /
    ConfigureDtsJob
    使用
    --DtsInstanceId
    (d小写)。调用前始终通过
    aliyun dts <API> help
    验证参数格式。
  • ID格式不明确:如果ID无法明确匹配DtsJobId或DtsInstanceId格式,通过DescribeDtsJobs进行模糊搜索。
  • 删除活跃任务:未做前置检查时绝对不要删除运行中的任务。先查询状态,如果处于同步/迁移中,提示用户先暂停或显式确认强制删除。
  • 创建流程中途失败:如果CreateDtsInstance成功但ConfigureDtsJob或StartDtsJob失败,自动释放已创建的实例避免持续扣费。
  • 超时/重试:所有API调用使用
    --read-timeout 30 --connect-timeout 10
    。CreateDtsInstance包含
    --ClientToken
    (UUID)实现幂等重试。
  • 多地域查询:列出任务时,按地域分别查询MIGRATION/SYNC/SUBSCRIBE类型任务。
    --JobType
    参数默认为MIGRATION,省略该参数会静默过滤同步/订阅任务。绝对不要使用
    --Type
    (会触发InvalidParameter错误)。
  • MongoDB专属规则:MongoDB端点在ConfigureDtsJob中需要配置
    --SourceEndpointDatabaseName
    参数。

Interaction Rules

交互规则

Important: All information gathering must use interactive selections to avoid workflow interruption from free-text questions.
重要:所有信息收集必须使用交互式选择,避免自由文本问题打断工作流。

Selection-type information: Provide fixed options

选择类信息:提供固定选项

Applicable to scenarios with fixed choices: task type, engine type, access method, instance selection, migration type, specification selection, etc.
适用于有固定选择的场景:任务类型、引擎类型、访问方式、实例选择、迁移类型、规格选择等。

Free-input information: Provide common defaults + custom input

自由输入类信息:提供通用默认值 + 自定义输入

Applicable to scenarios requiring user free input: IP address, port, username, password, database name, table name, etc. Provide common default values as options; users can select or enter custom values. Consolidate related input items into as few interaction rounds as possible.
适用于需要用户自由输入的场景:IP地址、端口、用户名、密码、数据库名、表名等。 提供通用默认值作为选项,用户可以选择或输入自定义值。 尽可能将相关输入项合并到最少的交互轮次中。

Sensitive information: Never display in plaintext

敏感信息:绝对不要明文展示

CRITICAL: Passwords, AccessKey Secrets, certificates, and private keys must NEVER appear in plaintext anywhere in the conversation — this applies to ALL stages:
  • During collection: When the user provides a password or secret in a message (e.g., "password: MyPass123"), you MUST immediately treat it as sensitive. Do NOT quote, repeat, summarize, or reference the plaintext value in your response. Simply acknowledge receipt, e.g., "Source database password received." Then internally store it for later CLI execution. Even if the user typed the password in plain text, your reply must NEVER contain it.
  • When summarizing user input: If the user provides multiple fields including a password in one message (e.g., "username: dts, password: abc123"), your acknowledgment must mask the password: "Username: dts, Password: ******". Never reproduce the password portion of the user's message.
  • In confirmation summaries: Always show
    ******
    for password fields.
  • In CLI commands displayed to the user: Show passwords as
    '******'
    , never the actual value. The real value is only used internally when executing the command.
  • In error messages / logs: If an API error response contains sensitive fields, redact them before displaying.
  • In stored variables or references: Never repeat the plaintext value in follow-up messages.
  • In local files: Never write passwords or secrets to any local file (scripts, configs, logs, temp files, etc.). All sensitive values must only exist in memory during CLI execution.
Use single quotes around passwords in actual CLI execution to prevent shell expansion.
关键要求:密码、AccessKey Secret、证书、私钥在对话的任何阶段都绝对不能明文出现,适用于所有环节:
  • 收集阶段:当用户在消息中提供密码或密钥时(例如:"password: MyPass123"),必须立即将其标记为敏感信息。不要在回复中引用、重复、总结或提及明文值,仅确认收到即可,例如:"源数据库密码已收到。",之后内部存储用于后续CLI执行。即使用户明文输入了密码,你的回复中也绝对不能包含该明文。
  • 汇总用户输入时:如果用户在一条消息中提供了包含密码在内的多个字段(例如:"username: dts, password: abc123"),你的确认信息必须掩码处理密码:"用户名:dts,密码:******",绝对不要复现用户消息中的密码部分。
  • 确认汇总信息中:密码字段始终显示为
    ******
  • 展示给用户的CLI命令中:密码显示为
    '******'
    ,绝对不要展示实际值,真实值仅在内部执行命令时使用。
  • 错误信息/日志中:如果API错误响应包含敏感字段,展示前先做脱敏处理。
  • 存储变量或引用中:后续消息中绝对不要重复明文值。
  • 本地文件中:绝对不要将密码或密钥写入任何本地文件(脚本、配置、日志、临时文件等),所有敏感值仅在CLI执行时存在于内存中。
实际执行CLI命令时用单引号包裹密码,避免shell解析转义。

Prerequisites

前置条件

Before executing any operation, the following checks must be performed:
执行任何操作前,必须完成以下检查:

1. Check aliyun CLI installation

1. 检查aliyun CLI安装情况

bash
which aliyun
If not installed, prompt the user:
bash
which aliyun
如果未安装,提示用户:

2. Check authentication configuration

2. 检查身份认证配置

bash
aliyun configure list
If not configured, guide the user through setup:
bash
aliyun configure --mode AK
Requires: AccessKey ID, AccessKey Secret, Region Id
Important: Never display the user's AccessKey Secret in the conversation. Protect sensitive information.
bash
aliyun configure list
如果未配置,引导用户完成设置:
bash
aliyun configure --mode AK
需要:AccessKey ID、AccessKey Secret、地域ID
重要:对话中绝对不要展示用户的AccessKey Secret,保护敏感信息。

3. Select Region

3. 选择地域

Let the user select a Region using interactive choices, not text input.
Supported Region list:
Mainland China:
Region IDName
cn-beijingChina North 2 (Beijing)
cn-hangzhouChina East 1 (Hangzhou)
cn-shanghaiChina East 2 (Shanghai)
cn-shenzhenChina South 1 (Shenzhen)
cn-guangzhouChina South 3 (Guangzhou)
cn-qingdaoChina North 1 (Qingdao)
cn-zhangjiakouChina North 3 (Zhangjiakou)
cn-huhehaoteChina North 5 (Hohhot)
cn-wulanchabuChina North 6 (Ulanqab)
cn-heyuanChina South 2 (Heyuan)
cn-chengduChina Southwest 1 (Chengdu)
cn-nanjingChina East 5 (Nanjing - Local Region)
cn-fuzhouChina East 6 (Fuzhou - Local Region)
cn-wuhan-lrChina Central 1 (Wuhan - Local Region)
Hong Kong (China) and International:
Region IDName
cn-hongkongChina (Hong Kong)
ap-southeast-1Singapore
ap-southeast-3Malaysia (Kuala Lumpur)
ap-southeast-5Indonesia (Jakarta)
ap-southeast-6Philippines (Manila)
ap-southeast-7Thailand (Bangkok)
ap-northeast-1Japan (Tokyo)
ap-northeast-2South Korea (Seoul)
eu-central-1Germany (Frankfurt)
eu-west-1UK (London)
us-east-1US (Virginia)
us-west-1US (Silicon Valley)
me-east-1UAE (Dubai)
na-south-1Mexico
Interactive pagination:
  • First screen (common): cn-beijing (China North 2 - Beijing), cn-hangzhou (China East 1 - Hangzhou), cn-shanghai (China East 2 - Shanghai), cn-shenzhen (China South 1 - Shenzhen)
  • After selecting Other: cn-guangzhou, cn-qingdao, cn-chengdu, cn-hongkong
  • Continue Other: Show remaining Regions or let user input Region ID directly
This step can be combined with Step 1 (task type) to reduce interaction rounds.
让用户通过交互式选择确定地域,不要使用文本输入。
支持的地域列表:
中国内地
地域ID名称
cn-beijing华北2(北京)
cn-hangzhou华东1(杭州)
cn-shanghai华东2(上海)
cn-shenzhen华南1(深圳)
cn-guangzhou华南3(广州)
cn-qingdao华北1(青岛)
cn-zhangjiakou华北3(张家口)
cn-huhehaote华北5(呼和浩特)
cn-wulanchabu华北6(乌兰察布)
cn-heyuan华南2(河源)
cn-chengdu西南1(成都)
cn-nanjing华东5(南京-本地地域)
cn-fuzhou华东6(福州-本地地域)
cn-wuhan-lr华中1(武汉-本地地域)
中国香港及海外地域
地域ID名称
cn-hongkong中国香港
ap-southeast-1新加坡
ap-southeast-3马来西亚(吉隆坡)
ap-southeast-5印度尼西亚(雅加达)
ap-southeast-6菲律宾(马尼拉)
ap-southeast-7泰国(曼谷)
ap-northeast-1日本(东京)
ap-northeast-2韩国(首尔)
eu-central-1德国(法兰克福)
eu-west-1英国(伦敦)
us-east-1美国(弗吉尼亚)
us-west-1美国(硅谷)
me-east-1阿联酋(迪拜)
na-south-1墨西哥
交互式分页
  • 第一屏(常用地域):cn-beijing(华北2 - 北京)、cn-hangzhou(华东1 - 杭州)、cn-shanghai(华东2 - 上海)、cn-shenzhen(华南1 - 深圳)
  • 选择「其他」后展示:cn-guangzhou、cn-qingdao、cn-chengdu、cn-hongkong
  • 继续选择「其他」:展示剩余地域或让用户直接输入地域ID
该步骤可以和步骤1(任务类型)合并,减少交互轮次。

Error Handling

错误处理

  • When API calls fail, parse error messages and provide actionable suggestions
  • If instance creation succeeds but subsequent steps fail, automatically release the created instance to avoid charges
  • Common errors:
    • InvalidAccessKeyId.NotFound
      - Invalid AccessKey, check configuration
    • Forbidden.RAM
      - Insufficient RAM permissions, requires AliyunDTSFullAccess policy
    • InvalidParameter
      - Parameter error, check input
    • UnSupportedTaskType
      - Unsupported link combination, suggest changing engine or access method
    • OperationDenied
      - Operation denied, task status may not allow this operation
    • Network timeout - Check network connection
  • API调用失败时,解析错误信息并提供可执行的解决方案
  • 如果实例创建成功但后续步骤失败,自动释放已创建的实例避免产生费用
  • 常见错误:
    • InvalidAccessKeyId.NotFound
      - AccessKey无效,请检查配置
    • Forbidden.RAM
      - RAM权限不足,需要AliyunDTSFullAccess权限策略
    • InvalidParameter
      - 参数错误,请检查输入
    • UnSupportedTaskType
      - 不支持的链路组合,建议更换引擎或访问方式
    • OperationDenied
      - 操作被拒绝,任务当前状态可能不允许该操作
    • 网络超时 - 检查网络连接

CLI Call Standards

CLI调用规范

  • All aliyun CLI commands must include
    --user-agent AlibabaCloud-Agent-Skills
    parameter (except local configuration commands like
    aliyun configure
    )
  • All aliyun CLI API calls must set timeouts:
    --read-timeout 30 --connect-timeout 10
  • All aliyun CLI command responses are JSON; parse JSON to extract key information for display
  • 所有aliyun CLI命令必须包含
    --user-agent AlibabaCloud-Agent-Skills
    参数(
    aliyun configure
    等本地配置命令除外)
  • 所有aliyun CLI API调用必须设置超时:
    --read-timeout 30 --connect-timeout 10
  • 所有aliyun CLI命令响应为JSON格式,解析JSON提取关键信息展示

Input Validation and Injection Prevention

输入验证与注入防护

CRITICAL: Before constructing any CLI command, ALL user-provided input parameters must be validated and sanitized to prevent command injection.
Validation rules by parameter type:
ParameterValidation Rule
IP addressMust match IPv4 pattern (
^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$
), each octet 0-255
PortInteger only, range 1-65535
Instance IDAlphanumeric, hyphens, and underscores only (
^[a-zA-Z0-9_-]+$
)
Database nameAlphanumeric, underscores, hyphens only (
^[a-zA-Z0-9_-]+$
)
Table nameAlphanumeric, underscores, hyphens, dots only (
^[a-zA-Z0-9_.\-]+$
)
UsernameAlphanumeric, underscores, hyphens, dots only (
^[a-zA-Z0-9_.\-]+$
)
Region IDMust match known Region ID list or pattern
^[a-z]{2}-[a-z]+-?\d*$
DtsJobNameAlphanumeric, hyphens, underscores, dots only, max 128 chars
Shell injection prevention:
  • All user-provided parameter values must be wrapped in single quotes (
    '...'
    ) when passed to CLI commands, not just passwords
  • Before quoting, reject any input containing single quotes (
    '
    ), or escape them properly (
    '\''
    )
  • Reject any input containing shell metacharacters (
    ; | & $ ` ( ) { } \n
    ) for parameters where they are never valid (IP, port, instance ID, username, database name)
  • DbList JSON must be validated as syntactically correct JSON before passing to
    --DbList
  • If validation fails, display a clear error message and ask the user to re-enter the value; never pass unvalidated input to the shell
关键要求:构造任何CLI命令前,所有用户提供的输入参数必须经过验证和清理,防止命令注入。
按参数类型的验证规则
参数验证规则
IP地址必须匹配IPv4格式(
^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$
),每段取值0-255
端口仅整数,取值范围1-65535
实例ID仅允许字母、数字、连字符、下划线(
^[a-zA-Z0-9_-]+$
数据库名仅允许字母、数字、下划线、连字符(
^[a-zA-Z0-9_-]+$
表名仅允许字母、数字、下划线、连字符、点(
^[a-zA-Z0-9_.\-]+$
用户名仅允许字母、数字、下划线、连字符、点(
^[a-zA-Z0-9_.\-]+$
地域ID必须匹配已知地域ID列表或格式
^[a-z]{2}-[a-z]+-?\d*$
DtsJobName仅允许字母、数字、连字符、下划线、点,最长128字符
Shell注入防护
  • 所有用户提供的参数值传递给CLI命令时必须用单引号(
    '...'
    )包裹,不只是密码
  • 加引号前,拒绝任何包含单引号(
    '
    )的输入,或正确转义(
    '\''
  • 对于IP、端口、实例ID、用户名、数据库名等不允许特殊字符的参数,拒绝任何包含shell元字符(
    ; | & $ ` ( ) { } \n
    )的输入
  • DbList JSON参数传递给
    --DbList
    前必须验证JSON语法正确性
  • 验证失败时,展示清晰的错误信息并要求用户重新输入,绝对不要将未验证的输入传递给shell

Notes

注意事项

  • Never display passwords, certificates, keys, or other sensitive information in any output; show as
    ******
    in confirmation summaries
  • Releasing a task is an irreversible operation; always require double confirmation
  • Creating tasks incurs charges (pay-as-you-go); remind users
  • If the ID format is ambiguous, attempt fuzzy search matching via DescribeDtsJobs
  • Use the Region from the configuration file by default, unless the user specifies a different Region
  • All information gathering must use interactive methods to avoid workflow interruption
  • Consolidate related input items into the same interaction round to minimize rounds
  • 任何输出中绝对不要展示密码、证书、密钥或其他敏感信息,确认汇总中展示为
    ******
  • 释放任务是不可逆操作,始终要求二次确认
  • 创建任务会产生费用(按量付费),需要提醒用户
  • ID格式不明确时,通过DescribeDtsJobs尝试模糊搜索匹配
  • 默认使用配置文件中的地域,除非用户指定其他地域
  • 所有信息收集必须使用交互式方式,避免打断工作流
  • 将相关输入项合并到同一交互轮次,减少交互次数