腾讯云跨账号资源迁移

v1.0.0

腾讯云跨账号资源迁移工具。将源账号(账号A)的 VPC、CLB、NAT、CVM、安全组等资源迁移到目标账号(账号B),通过 CCN 云联网实现跨账号网络互通。支持自动扫描、配置生成、Terraform 部署。

0· 133·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for awaili/tc-migrate.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "腾讯云跨账号资源迁移" (awaili/tc-migrate) from ClawHub.
Skill page: https://clawhub.ai/awaili/tc-migrate
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required binaries: python3, terraform
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install tc-migrate

ClawHub CLI

Package manager switcher

npx clawhub@latest install tc-migrate
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Skill 名称、描述及命令(config/scan/generate/run/destroy)与源代码一致:使用 tencentcloud-sdk 查询源账号资源、生成迁移配置并用 Terraform 在目标账号创建资源。所需二进制(python3, terraform)和 Python 依赖与功能相符。
Instruction Scope
SKILL.md 与代码指示用户通过 account.yaml 提供 SecretId/SecretKey,并允许全自动扫描、生成 terraform.tfvars 及一键执行 terraform apply。指令范围与目的对齐,但会把密钥从 account.yaml 合并并写入 terraform.tfvars(以及生成 terraform.tfstate),这会导致敏感凭据以文件形式存在磁盘,务必谨慎处理。
Install Mechanism
这是一个 instruction+源码包,没有自动的远程下载或可疑安装步骤。文档建议通过 pip 安装 requirements.txt(从 PyPI),以及手动/系统方式安装 Terraform(HashiCorp 官方)。这些是常见、可审计的来源,风险为中等可管理。
Credentials
Skill 不要求平台环境变量或云平台凭据作为 declared env,但实现通过本地 account.yaml 提供腾讯云 SecretId/SecretKey。把这些凭据写入 terraform.tfvars 和最终的 terraform.tfstate(工具行为明确)是合理以完成 Terraform 部署,但对凭据暴露/长期存储构成实质风险——数量与类型与任务相称但需要最小权限与良好密钥管理。
Persistence & Privilege
skill metadata 不设置 always: true,且默认允许模型调用(平台默认)。代码不会修改其他 skills 或系统级 agent 配置;其持久性体现在生成/写入配置与 Terraform 状态文件(本地 filesystem),这是合理且与用途一致。
Assessment
这个 Skill 看起来确实在做它声称的迁移工作,但会要求你提供腾讯云 SecretId/SecretKey(通过本地 account.yaml),并会把这些凭据合并写入生成的 terraform.tfvars,执行 apply 后还会生成 terraform.tfstate(包含敏感信息)。在安装/使用前请注意: - 不要在聊天或公开渠道粘贴密钥。按照 README/SKILL.md 将 account.yaml 与 terraform.tfvars、terraform.tfstate 加入 .gitignore。 - 为迁移创建专用、权限最小的 API 密钥(只授予必要的 Describe/Create/CCN 权限),并优先使用短期/临时凭据(如支持时)。 - 在运行前手动审查生成的 terraform.tfvars 内容(tc-migrate generate --preview)并确认不含不必要的凭据或敏感字段;考虑将 Terraform provider 改为通过环境变量或临时凭据传递以避免把长期密钥写入文件。 - 在受控环境(干净的工作目录、限制网络访问的机器)执行 terraform apply,并确保 terraform.tfstate 的安全存储(加密、受限访问)。 - 如果可能,先在非生产账号或最小环境做一次完整演练并核对 CCN 路由/隔离策略是否按预期工作。 如果你需要我更深入审查特定文件(例如查看生成 tfvars 的具体代码片段、确认是否有外部/隐藏网络端点),请指出要检查的文件或片段。

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

OSLinux
Binspython3, terraform
latestvk97c6pnn7z4bgpnnmbtq4jrdzd83jvcymigrationvk97c6pnn7z4bgpnnmbtq4jrdzd83jvcytencent-cloudvk97c6pnn7z4bgpnnmbtq4jrdzd83jvcyterraformvk97c6pnn7z4bgpnnmbtq4jrdzd83jvcy
133downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0
Linux

tc-migrate 跨账号迁移 Skill

腾讯云跨账号资源迁移工具,将源账号的云资源迁移到目标账号,通过 CCN 云联网实现网络互通。

核心流程 — 4 步

① 配置 → ② 扫描 → ③ 生成 → ④ 部署

支持的资源类型

资源类型Key
VPCvpc
Subnetsubnet
Security Groupsg
CLBclb
NAT Gatewaynat
CVMcvm
CCN(自动创建)ccn

前提条件

  1. 安装依赖

    pip install -r {baseDir}/requirements.txt
    
  2. 安装 Terraform(>= 1.0):

    # CentOS/RHEL
    sudo yum install -y yum-utils
    sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
    sudo yum -y install terraform
    
    # 验证
    terraform --version
    
  3. 准备 account.yaml(在工作目录下):

    account_a:  # 源账号
      secret_id: "AKID..."
      secret_key: "..."
    account_b:  # 目标账号
      secret_id: "AKID..."
      secret_key: "..."
    region_a: "ap-beijing"
    region_b: "ap-guangzhou"
    

⚠️ 安全提醒:绝不要在对话中显示或记录密钥值!


Step 1: 全自动配置

# 基本用法(推荐)
python3 {baseDir}/main.py config auto --skip-empty-vpc

# 生成密钥模板(如果没有 account.yaml)
python3 {baseDir}/main.py config account-init

生成文件tc-migrate.yaml


Step 2: 资源扫描

# 扫描并保存(推荐)
python3 {baseDir}/main.py scan --save --skip-empty-vpc

# 仅预览
python3 {baseDir}/main.py scan

更新文件tc-migrate.yaml(追加 resources 配置)

💡 config auto 默认自动扫描,可跳过此步。


Step 3: 生成 Terraform 变量文件

# 生成 tfvars(推荐)
python3 {baseDir}/main.py generate --force

# 仅预览
python3 {baseDir}/main.py generate --preview

生成文件{baseDir}/terraform/terraform.tfvars


Step 4: 执行迁移

# 执行迁移(会在 apply 前确认)
python3 {baseDir}/main.py run

# 跳过确认
python3 {baseDir}/main.py run -y

内部流程:generate → init → plan → apply


常见场景

场景 1:完整首次迁移

python3 {baseDir}/main.py config account-init     # 1. 生成密钥模板
# 编辑 account.yaml 填入密钥
python3 {baseDir}/main.py config auto --skip-empty-vpc  # 2. 配置 + 扫描
python3 {baseDir}/main.py generate                # 3. 生成 tfvars
python3 {baseDir}/main.py run                     # 4. 执行迁移

场景 2:增量变更

# 修改 tc-migrate.yaml 后
python3 {baseDir}/main.py generate
python3 {baseDir}/main.py plan
python3 {baseDir}/main.py apply

场景 3:销毁资源

python3 {baseDir}/main.py destroy

重要提醒

  1. 绝不显示或记录密钥值
  2. 执行 apply 前务必确认 plan 输出
  3. CCN 安全配置已通过 Terraform 自动实现
  4. 妥善保管 terraform.tfstate(包含敏感信息)

参考文档

详细信息请查阅 {baseDir}/reference/ 目录:

文档内容
installation.md安装指南
commands.md完整命令参考
file-structure.md文件结构和配置示例
ccn-security.mdCCN 安全配置详解
troubleshooting.md故障排查指南

Comments

Loading comments...