alibabacloud-dataworks-infra-manage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DataWorks Infrastructure Management

DataWorks 基础设施管理

Unified management of Data Sources, Compute Resources, and Resource Groups in Alibaba Cloud DataWorks workspaces, supporting create and query operations.
统一管理阿里云 DataWorks 工作空间内的 数据源计算资源资源组,支持创建和查询操作。

Architecture

架构

DataWorks
├── Workspaces ─── Query and search workspaces
│   ├── Data Sources ─── 51 types: MySQL, Hologres, MaxCompute, ...
│   └── Compute Resources ─── Hologres, MaxCompute, Flink, Spark
└── Resource Groups ─── Serverless resource group management (cross-workspace)

Dependencies:
  Workspace ◀── Data Sources, Compute Resources (must belong to a workspace)
  Workspace ◀── Resource Groups (associated via binding; one resource group can bind to multiple workspaces)
  Connectivity Test ──depends on──▶ Resource Group (must be bound to the workspace of the data source)
  Standard Mode ──requires──▶ Dev (Development) + Prod (Production) dual data sources and compute resources

DataWorks
├── Workspaces ─── 查询和搜索工作空间
│   ├── Data Sources ─── 51种:MySQL、Hologres、MaxCompute、...
│   └── Compute Resources ─── Hologres、MaxCompute、Flink、Spark
└── Resource Groups ─── Serverless 资源组管理(跨工作空间)

依赖关系:
  工作空间 ◀── 数据源、计算资源(必须隶属于某个工作空间)
  工作空间 ◀── 资源组(通过绑定关联;一个资源组可绑定多个工作空间)
  连通性测试 ──依赖──▶ 资源组(必须绑定到数据源所属的工作空间)
  标准模式 ──要求──▶ 开发(Dev)+ 生产(Prod)双数据源和计算资源

Global Rules

全局规则

Prerequisites

前置条件

  1. Aliyun CLI >= 3.3.1:
    aliyun version
    (Installation guide: references/cli-installation-guide.md)
  2. First-time use:
    aliyun configure set --auto-plugin-install true
  3. jq (required for resource group operations):
    which jq
  4. Credential status:
    aliyun configure list
    , verify valid credentials exist
  5. DataWorks edition: Basic edition or above required
Security Rules: DO NOT read/print/echo AK/SK values, DO NOT let users input AK/SK directly, ONLY use
aliyun configure list
to check credential status.
  1. Aliyun CLI >= 3.3.1:执行
    aliyun version
    查看(安装指南:references/cli-installation-guide.md
  2. 首次使用配置:执行
    aliyun configure set --auto-plugin-install true
  3. jq(资源组操作必需):执行
    which jq
    确认已安装
  4. 凭证状态:执行
    aliyun configure list
    验证存在有效凭证
  5. DataWorks 版本:需要基础版及以上版本
安全规则严禁 读取/打印/输出 AK/SK 数值,严禁 让用户直接输入 AK/SK,仅可 使用
aliyun configure list
检查凭证状态。

Command Formatting

命令格式化要求

  • User-Agent (mandatory): All
    aliyun
    CLI commands must include the
    --user-agent AlibabaCloud-Agent-Skills
    parameter to identify the source.
  • Single-line commands: When executing Bash commands, must construct as a single-line string; do not use
    \
    for line breaks.
  • jq step-by-step execution: First execute the
    aliyun
    command to get JSON, then format with
    jq
    (to avoid multi-line security prompts).
  • Endpoint mandatory: When specifying the
    --region
    parameter, you must also add
    --endpoint dataworks.<REGION_ID>.aliyuncs.com
    . Not needed when
    --region
    is not specified.
  • User-Agent(必填):所有
    aliyun
    CLI 命令 必须 携带
    --user-agent AlibabaCloud-Agent-Skills
    参数标识请求来源。
  • 单行命令要求:执行 Bash 命令时 必须 构造为 单行字符串,不可使用
    \
    换行。
  • jq 分步执行:先执行
    aliyun
    命令获取 JSON,再用
    jq
    格式化(避免多行安全提示)。
  • Endpoint 要求:指定
    --region
    参数时 必须 同时添加
    --endpoint dataworks.<REGION_ID>.aliyuncs.com
    ,未指定
    --region
    时无需添加。

Parameter Confirmation

参数确认规则

Before executing any command, all user-customizable parameters must be confirmed by the user. Do not assume or use default values. Exception: When the user has explicitly specified parameter values in the conversation, use them directly without re-confirmation.
Resource group related parameters (mandatory user selection): VPC, VSwitch, Resource Group ID (for binding/connectivity testing) — involve networking and billing, DO NOT auto-select; must display a list for the user to explicitly choose. Confirm even if there is only one option.
执行任何命令前,所有用户可自定义参数 必须 经用户确认,不可假设或使用默认值。 例外:当用户在对话中 明确指定 参数值时,可直接使用无需二次确认。
资源组相关参数(必须由用户选择):VPC、VSwitch、资源组 ID(用于绑定/连通性测试)——涉及网络和计费,严禁自动选择,必须展示列表供用户明确选择,即便只有一个选项也需要确认。

RAM Permissions

RAM 权限要求

All operations require
dataworks:<APIAction>
permissions. Creating resource groups additionally requires
AliyunBSSOrderAccess
and
vpc:DescribeVpcs
,
vpc:DescribeVSwitches
.
Full permission matrix: references/ram-policies.md

所有操作都需要
dataworks:<APIAction>
权限。创建资源组额外需要
AliyunBSSOrderAccess
vpc:DescribeVpcs
vpc:DescribeVSwitches
权限。
完整权限矩阵:references/ram-policies.md

Quick Start: New Workspace Infrastructure Initialization

快速入门:新工作空间基础设施初始化

When the user is unsure about specific operations or has vague requirements, guide them through the following process:
  1. Environment check — Check CLI and credentials per Prerequisites
  2. Confirm workspace — Use
    ListProjects
    to locate the workspace,
    GetProject
    to confirm the mode (Simple/Standard)
  3. Create compute resources — Guide engine type selection; the system will automatically create corresponding data sources. Standard Mode requires Dev+Prod pairs. Only pure storage-type data sources (MySQL, Kafka, etc.) need separate data source creation
  4. Create/bind resource groups — Query existing resource groups → let user select → bind. Guide creation when no resource groups are available
  5. Test connectivity — Test with bound resource groups; when all pass, inform "Infrastructure configuration complete"
After each step, proactively suggest the next action.

当用户 不确定具体操作 或需求模糊时,引导用户按照以下流程操作:
  1. 环境检查 —— 按照前置条件要求检查 CLI 和凭证状态
  2. 确认工作空间 —— 使用
    ListProjects
    定位工作空间,调用
    GetProject
    确认模式(简单/标准模式)
  3. 创建计算资源 —— 引导用户选择引擎类型;系统会 自动创建对应的数据源。标准模式需要创建开发+生产成对资源,仅纯存储类数据源(MySQL、Kafka 等)需要单独创建数据源
  4. 创建/绑定资源组 —— 查询现有资源组 → 供用户选择 → 完成绑定。无可用资源组时引导用户创建
  5. 连通性测试 —— 使用绑定的资源组进行测试;全部测试通过后告知用户「基础设施配置完成」
每一步完成后,主动向用户建议下一步操作。

Next Step Guidance

后续步骤指引

After each write operation is completed and verified, proactively suggest follow-up actions:
Completed OperationRecommended Next Step
Create compute resourceStandard Mode: "Create the corresponding Dev resource?"; "Test connectivity?"
Create data source separately"Test connectivity?"; Standard Mode: "Create Dev/Prod environment data sources?"
Create resource group"Bind to a workspace?"
Bind resource group"Test data source connectivity?"
Connectivity test passed"Infrastructure is ready."
Connectivity test failedAnalyze the error cause, guide the fix
Unbind resource group"Bind to another workspace?"

每一个写操作完成并验证通过后,主动建议 后续操作:
已完成操作推荐下一步操作
创建计算资源标准模式:「是否创建对应的开发环境资源?」;「是否测试连通性?」
单独创建数据源「是否测试连通性?」;标准模式:「是否创建开发/生产环境数据源?」
创建资源组「是否绑定到工作空间?」
绑定资源组「是否测试数据源连通性?」
连通性测试通过「基础设施已就绪。」
连通性测试失败分析错误原因,引导用户修复
解绑资源组「是否绑定到其他工作空间?」

Trigger Rules

触发规则

Trigger scenarios: Data source create/query, compute resource create/query, resource group management, infrastructure initialization, colloquial aliases (DW database connection failure, configure holo/mc resources, create rg)
Not triggered: Data development tasks, scheduling configuration, MaxCompute table management, data integration tasks, ECS/RDS/OSS, workspace member management, data quality/lineage/preview. Standalone workspace queries are handled by the
alibabacloud-dataworks-workspace-manage
skill.
触发场景:数据源创建/查询、计算资源创建/查询、资源组管理、基础设施初始化、口语化别名(DW 数据库连接失败、配置 holo/mc 资源、创建 rg)
不触发场景:数据开发任务、调度配置、MaxCompute 表管理、数据集成任务、ECS/RDS/OSS 操作、工作空间成员管理、数据质量/血缘/预览。独立工作空间查询由
alibabacloud-dataworks-workspace-manage
技能处理。

Interaction Flow

交互流程

All operations follow: Identify module → Environment check → Collect parameters → Execute command → Verify result → Guide next step
Common aliases: DW=DataWorks, holo=Hologres, mc/MC/odps=MaxCompute, pg=PostgreSQL, rg=Resource Group, ds=Data Source, RDS=InstanceMode MySQL/PG/SQLServer, ADB=AnalyticDB
Naming suggestions: Data source
{type}_{business}_{purpose}
, Compute resource
{type}_{business}
, Resource group
dw_{purpose}_rg_{env}

所有操作遵循:识别模块 → 环境检查 → 收集参数 → 执行命令 → 验证结果 → 引导下一步
常用别名:DW=DataWorks、holo=Hologres、mc/MC/odps=MaxCompute、pg=PostgreSQL、rg=资源组、ds=数据源、RDS=实例模式 MySQL/PG/SQLServer、ADB=AnalyticDB
命名建议:数据源
{类型}_{业务}_{用途}
、计算资源
{类型}_{业务}
、资源组
dw_{用途}_rg_{环境}

Module 0: Workspace Query

模块 0:工作空间查询

If the
alibabacloud-dataworks-workspace-manage
skill is available, prefer using it for workspace queries. The following is only a fallback.
bash
aliyun dataworks-public ListProjects --user-agent AlibabaCloud-Agent-Skills --Status Available --PageSize 100
When searching by name, first get the full list then filter
.PagingInfo.Projects[]
by Name/DisplayName using
jq
.

如果有可用的
alibabacloud-dataworks-workspace-manage
技能,优先使用该技能进行工作空间查询,以下内容仅作为降级方案。
bash
aliyun dataworks-public ListProjects --user-agent AlibabaCloud-Agent-Skills --Status Available --PageSize 100
按名称搜索时,先获取完整列表,再使用
jq
按 Name/DisplayName 过滤
.PagingInfo.Projects[]

Module 1: Data Source Management

模块 1:数据源管理

Supports 51 data source types. See references/data-sources/README.md for details.
When do you need to create a data source separately? Creating a compute resource (Module 2) will automatically create the corresponding data source. Only pure storage-type databases (MySQL, PostgreSQL, Kafka, MongoDB, etc.) need separate creation.
Some types do not currently support OpenAPI:
polardb-o
,
polardb-x-2-0
,
oceanbase
,
oss-hdfs
,
graph-database
,
bigquery
,
dlf
,
hdfs
,
ssh
,
redis
,
salesforce
,
elasticsearch
,
httpfile
Connection modes: UrlMode (self-hosted databases, requires host/port) or InstanceMode (Alibaba Cloud managed instances, requires instanceId). When unsure, proactively ask the user. InstanceMode is preferred.
Instance query APIs: references/data-sources/instance-apis.md
支持 51 种数据源类型,详情见 references/data-sources/README.md
什么时候需要单独创建数据源? 创建计算资源(模块 2)会 自动创建对应的数据源,仅纯存储类数据库(MySQL、PostgreSQL、Kafka、MongoDB 等)需要单独创建。
部分类型当前暂不支持 OpenAPI:
polardb-o
polardb-x-2-0
oceanbase
oss-hdfs
graph-database
bigquery
dlf
hdfs
ssh
redis
salesforce
elasticsearch
httpfile
连接模式:UrlMode(自建数据库,需要 host/port)或 InstanceMode(阿里云托管实例,需要 instanceId)。不确定时主动询问用户,优先推荐 InstanceMode。
实例查询 API:references/data-sources/instance-apis.md

⚠️ Security Restriction

⚠️ 安全限制

IMPORTANT: For security reasons, this skill does NOT support modifying or deleting data sources. These operations are disabled to prevent:
  • Accidental data loss or service interruption
  • Exposure of sensitive credentials (passwords, connection strings)
  • Disruption of running data integration tasks
  • Unintended changes to production data source configurations
If you need to modify or delete a data source, please use the DataWorks console directly or contact your administrator.
重要提示:出于安全考虑,本技能 不支持 修改或删除数据源,禁用此类操作是为了避免:
  • 意外数据丢失或服务中断
  • 敏感凭证(密码、连接串)泄露
  • 影响运行中的数据集成任务
  • 意外修改生产数据源配置
如需修改或删除数据源,请直接使用 DataWorks 控制台或联系管理员。

Workspace Mode

工作空间模式说明

Environment note: Prod (Production) is for production data processing; Dev (Development) is for development and debugging, physically isolated from production.
aliyun dataworks-public GetProject --user-agent AlibabaCloud-Agent-Skills --Id <PROJECT_ID>
— check
DevEnvironmentEnabled
:
  • false
    → Simple Mode (1 data source, envType=Prod)
  • true
    → Standard Mode (2 data sources, Dev + Prod, physically isolated)
Full mode comparison: references/data-sources/README.md
环境说明Prod(生产) 用于生产数据处理;Dev(开发) 用于开发调试,与生产环境物理隔离。
aliyun dataworks-public GetProject --user-agent AlibabaCloud-Agent-Skills --Id <PROJECT_ID>
—— 检查
DevEnvironmentEnabled
字段:
  • false
    → 简单模式(仅1个数据源,envType=Prod)
  • true
    → 标准模式(2个数据源,Dev + Prod,物理隔离)
完整模式对比:references/data-sources/README.md

Task 1.1: Create Data Source (CreateDataSource)

任务 1.1:创建数据源(CreateDataSource)

bash
aliyun dataworks-public CreateDataSource --user-agent AlibabaCloud-Agent-Skills [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com] --ProjectId <PROJECT_ID> --Name <NAME> --Type <TYPE> --ConnectionPropertiesMode <UrlMode|InstanceMode> --ConnectionProperties '<JSON>' --Description "<DESC>"
ConnectionProperties common structure:
  • UrlMode:
    {"envType":"Prod","address":[{"host":"<IP>","port":<PORT>}],"database":"<DB>","username":"<USER>","password":"<PWD>"}
  • InstanceMode:
    {"envType":"Prod","instanceId":"<ID>","regionId":"<REGION>","database":"<DB>","username":"<USER>","password":"<PWD>"}
Special type structures (Oracle, MaxCompute, HBase, etc.): see references/data-sources/ per-type docs
Cross-account data source configuration: references/cross-account-datasources.md
bash
aliyun dataworks-public CreateDataSource --user-agent AlibabaCloud-Agent-Skills [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com] --ProjectId <PROJECT_ID> --Name <NAME> --Type <TYPE> --ConnectionPropertiesMode <UrlMode|InstanceMode> --ConnectionProperties '<JSON>' --Description "<DESC>"
ConnectionProperties 通用结构
  • UrlMode
    {"envType":"Prod","address":[{"host":"<IP>","port":<PORT>}],"database":"<DB>","username":"<USER>","password":"<PWD>"}
  • InstanceMode
    {"envType":"Prod","instanceId":"<ID>","regionId":"<REGION>","database":"<DB>","username":"<USER>","password":"<PWD>"}
特殊类型结构(Oracle、MaxCompute、HBase 等):见 references/data-sources/ 下各类型文档
跨账号数据源配置:references/cross-account-datasources.md

Task 1.2: Get Data Source (GetDataSource)

任务 1.2:查询数据源详情(GetDataSource)

bash
aliyun dataworks-public GetDataSource --user-agent AlibabaCloud-Agent-Skills --Id <DATASOURCE_ID> [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com]
bash
aliyun dataworks-public GetDataSource --user-agent AlibabaCloud-Agent-Skills --Id <DATASOURCE_ID> [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com]

Task 1.3: List Data Sources (ListDataSources)

任务 1.3:查询数据源列表(ListDataSources)

bash
aliyun dataworks-public ListDataSources --user-agent AlibabaCloud-Agent-Skills --ProjectId <PROJECT_ID> [--Types '["mysql"]'] [--EnvType <Dev|Prod>] [--PageNumber 1] [--PageSize 20]
Returns nested structure
DataSources[].DataSource[]
; Name/Type are in the outer layer, Id/Description in the inner layer.
bash
aliyun dataworks-public ListDataSources --user-agent AlibabaCloud-Agent-Skills --ProjectId <PROJECT_ID> [--Types '["mysql"]'] [--EnvType <Dev|Prod>] [--PageNumber 1] [--PageSize 20]
返回嵌套结构
DataSources[].DataSource[]
;Name/Type 在外层,Id/Description 在内层。

Task 1.4: Test Connectivity (TestDataSourceConnectivity)

任务 1.4:测试连通性(TestDataSourceConnectivity)

Process: Query resource group list → Let user select a resource group → Execute test.
bash
undefined
流程:查询资源组列表 → 让用户选择 资源组 → 执行测试。
bash
undefined

Step 1: Query project resource groups

步骤1:查询项目关联的资源组

aliyun dataworks-public ListResourceGroups --user-agent AlibabaCloud-Agent-Skills --ProjectId <PROJECT_ID>
aliyun dataworks-public ListResourceGroups --user-agent AlibabaCloud-Agent-Skills --ProjectId <PROJECT_ID>

Step 2: Execute test after user selects a resource group

步骤2:用户选择资源组后执行测试

aliyun dataworks-public TestDataSourceConnectivity --user-agent AlibabaCloud-Agent-Skills --DataSourceId <ID> --ProjectId <PROJECT_ID> --ResourceGroupId "<RG_ID>"

> If error `"resourceGroupId is not in the project"`, the resource group needs to be bound first (confirm with user, then execute `AssociateProjectToResourceGroup`).

---
aliyun dataworks-public TestDataSourceConnectivity --user-agent AlibabaCloud-Agent-Skills --DataSourceId <ID> --ProjectId <PROJECT_ID> --ResourceGroupId "<RG_ID>"

> 如果报错 `"resourceGroupId is not in the project"`,需要先绑定资源组(经用户确认后执行 `AssociateProjectToResourceGroup`)。

---

Module 2: Compute Resource Management

模块 2:计算资源管理

Supports Hologres, MaxCompute, Flink, Spark, and other types. The system will automatically create corresponding data sources upon creation.
支持 Hologres、MaxCompute、Flink、Spark 等类型,创建时系统会 自动创建对应的数据源

⚠️ Security Restriction

⚠️ 安全限制

IMPORTANT: For security reasons, this skill does NOT support modifying or deleting compute resources. These operations are disabled to prevent:
  • Accidental data loss or service interruption
  • Disruption of running data development and scheduling tasks
  • Unintended changes to production compute resource configurations
If you need to modify or delete a compute resource, please use the DataWorks console directly or contact your administrator.
重要提示:出于安全考虑,本技能 不支持 修改或删除计算资源,禁用此类操作是为了避免:
  • 意外数据丢失或服务中断
  • 影响运行中的数据开发和调度任务
  • 意外修改生产计算资源配置
如需修改或删除计算资源,请直接使用 DataWorks 控制台或联系管理员。

authType Rules

authType 规则

  • Dev environment:
    authType
    is fixed as
    Executor
  • Prod environment: Options are
    PrimaryAccount
    (recommended),
    TaskOwner
    ,
    SubAccount
    ,
    RamRole
    . Default recommendation is
    PrimaryAccount
    unless user has special requirements
authType details and guidance: references/compute-resources/README.md
  • 开发环境
    authType
    固定为
    Executor
  • 生产环境:可选值为
    PrimaryAccount
    (推荐)、
    TaskOwner
    SubAccount
    RamRole
    ,无特殊需求时默认推荐
    PrimaryAccount
authType 详情和指引:references/compute-resources/README.md

Type-Specific Notes

类型专属说明

  • Hologres: Only supports InstanceMode, requires
    instanceId
    ,
    securityProtocol
  • MaxCompute: Only supports UrlMode, requires
    project
    ,
    endpointMode
Full ConnectionProperties examples: references/compute-resources/README.md
  • Hologres:仅支持 InstanceMode,需要
    instanceId
    securityProtocol
  • MaxCompute:仅支持 UrlMode,需要
    project
    endpointMode
完整 ConnectionProperties 示例:references/compute-resources/README.md

Task 2.1: Create Compute Resource (CreateComputeResource)

任务 2.1:创建计算资源(CreateComputeResource)

bash
aliyun dataworks-public CreateComputeResource --user-agent AlibabaCloud-Agent-Skills [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com] --ProjectId <PROJECT_ID> --Name <NAME> --Type <TYPE> --ConnectionPropertiesMode <InstanceMode|UrlMode> --ConnectionProperties '<JSON>' [--Description "<DESC>"]
After creation, use
ListDataSources
to verify the corresponding data source was auto-generated.
bash
aliyun dataworks-public CreateComputeResource --user-agent AlibabaCloud-Agent-Skills [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com] --ProjectId <PROJECT_ID> --Name <NAME> --Type <TYPE> --ConnectionPropertiesMode <InstanceMode|UrlMode> --ConnectionProperties '<JSON>' [--Description "<DESC>"]
创建完成后,使用
ListDataSources
验证对应的数据源已自动生成。

Task 2.2: Get Compute Resource (GetComputeResource)

任务 2.2:查询计算资源详情(GetComputeResource)

bash
aliyun dataworks-public GetComputeResource --user-agent AlibabaCloud-Agent-Skills --Id <ID> --ProjectId <PROJECT_ID>
bash
aliyun dataworks-public GetComputeResource --user-agent AlibabaCloud-Agent-Skills --Id <ID> --ProjectId <PROJECT_ID>

Task 2.3: List Compute Resources (ListComputeResources)

任务 2.3:查询计算资源列表(ListComputeResources)

bash
aliyun dataworks-public ListComputeResources --user-agent AlibabaCloud-Agent-Skills --ProjectId <PROJECT_ID> [--Name <FILTER>] [--EnvType <Dev|Prod>] [--PageSize 20] [--SortBy CreateTime] [--Order Desc]
Returns nested structure
ComputeResources[].ComputeResource[]
; Name/Type are in the outer layer, Id in the inner layer.

bash
aliyun dataworks-public ListComputeResources --user-agent AlibabaCloud-Agent-Skills --ProjectId <PROJECT_ID> [--Name <FILTER>] [--EnvType <Dev|Prod>] [--PageSize 20] [--SortBy CreateTime] [--Order Desc]
返回嵌套结构
ComputeResources[].ComputeResource[]
;Name/Type 在外层,Id 在内层。

Module 3: Resource Group Management

模块 3:资源组管理

Manages the full lifecycle of Serverless resource groups.
管理 Serverless 资源组的全生命周期。

Task 3.1: Create Resource Group (CreateResourceGroup)

任务 3.1:创建资源组(CreateResourceGroup)

Requires
AliyunBSSOrderAccess
permission.
Interaction flow (let user choose at each step, DO NOT auto-select):
  1. Query and select VPC:
bash
aliyun vpc DescribeVpcs --user-agent AlibabaCloud-Agent-Skills --RegionId "<REGION_ID>" --PageSize 50
If the list is empty, guide the user to create a VPC; DO NOT auto-create.
  1. Query and select VSwitch:
bash
aliyun vpc DescribeVSwitches --user-agent AlibabaCloud-Agent-Skills --RegionId "<REGION_ID>" --VpcId "<VPC_ID>" --PageSize 50
  1. Confirm name and specification → Execute creation:
bash
aliyun dataworks-public CreateResourceGroup --user-agent AlibabaCloud-Agent-Skills [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com] --Name "<NAME>" --PaymentType PostPaid --VpcId "<VPC_ID>" --VswitchId "<VSWITCH_ID>" --ClientToken "$(uuidgen 2>/dev/null || echo "token-$(date +%s)")" --Remark "Created by Agent"
After creation, poll
GetResourceGroup
until status becomes
Normal
(every 10 seconds, up to 10 minutes).
需要
AliyunBSSOrderAccess
权限。
交互流程(每一步都让用户选择,严禁自动选择):
  1. 查询并选择 VPC
bash
aliyun vpc DescribeVpcs --user-agent AlibabaCloud-Agent-Skills --RegionId "<REGION_ID>" --PageSize 50
如果列表为空,引导用户创建 VPC;严禁 自动创建。
  1. 查询并选择 VSwitch
bash
aliyun vpc DescribeVSwitches --user-agent AlibabaCloud-Agent-Skills --RegionId "<REGION_ID>" --VpcId "<VPC_ID>" --PageSize 50
  1. 确认名称和规格 → 执行创建:
bash
aliyun dataworks-public CreateResourceGroup --user-agent AlibabaCloud-Agent-Skills [--region <REGION_ID> --endpoint dataworks.<REGION_ID>.aliyuncs.com] --Name "<NAME>" --PaymentType PostPaid --VpcId "<VPC_ID>" --VswitchId "<VSWITCH_ID>" --ClientToken "$(uuidgen 2>/dev/null || echo "token-$(date +%s)")" --Remark "Created by Agent"
创建完成后,轮询
GetResourceGroup
直到状态变为
Normal
(每10秒轮询一次,最长等待10分钟)。

Task 3.2: Get Resource Group (GetResourceGroup)

任务 3.2:查询资源组详情(GetResourceGroup)

bash
aliyun dataworks-public GetResourceGroup --user-agent AlibabaCloud-Agent-Skills --Id "<ID>"
bash
aliyun dataworks-public GetResourceGroup --user-agent AlibabaCloud-Agent-Skills --Id "<ID>"

Task 3.3: List Resource Groups (ListResourceGroups)

任务 3.3:查询资源组列表(ListResourceGroups)

bash
aliyun dataworks-public ListResourceGroups --user-agent AlibabaCloud-Agent-Skills [--ProjectId <PROJECT_ID>] [--Statuses '["Normal"]'] --PageSize 100
bash
aliyun dataworks-public ListResourceGroups --user-agent AlibabaCloud-Agent-Skills [--ProjectId <PROJECT_ID>] [--Statuses '["Normal"]'] --PageSize 100

Task 3.4: Bind Resource Group (AssociateProjectToResourceGroup)

任务 3.4:绑定资源组(AssociateProjectToResourceGroup)

Process: Query available resource groups → Display list for user to select → Bind after user confirms.
bash
aliyun dataworks-public AssociateProjectToResourceGroup --user-agent AlibabaCloud-Agent-Skills --ResourceGroupId "<RG_ID>" --ProjectId "<PROJECT_ID>"
流程:查询可用资源组 → 展示列表供用户选择 → 用户确认后执行绑定。
bash
aliyun dataworks-public AssociateProjectToResourceGroup --user-agent AlibabaCloud-Agent-Skills --ResourceGroupId "<RG_ID>" --ProjectId "<PROJECT_ID>"

Task 3.5: Query Binding Relationships

任务 3.5:查询绑定关系

bash
aliyun dataworks-public ListResourceGroupAssociateProjects --user-agent AlibabaCloud-Agent-Skills --ResourceGroupId "<RG_ID>"
bash
aliyun dataworks-public ListResourceGroupAssociateProjects --user-agent AlibabaCloud-Agent-Skills --ResourceGroupId "<RG_ID>"

Task 3.6: Unbind Resource Group (DissociateProjectFromResourceGroup)

任务 3.6:解绑资源组(DissociateProjectFromResourceGroup)

bash
aliyun dataworks-public DissociateProjectFromResourceGroup --user-agent AlibabaCloud-Agent-Skills --ResourceGroupId "<RG_ID>" --ProjectId "<PROJECT_ID>"

bash
aliyun dataworks-public DissociateProjectFromResourceGroup --user-agent AlibabaCloud-Agent-Skills --ResourceGroupId "<RG_ID>" --ProjectId "<PROJECT_ID>"

Success Verification

成功验证

After all write operations, use the corresponding Get/List command to verify the result.
所有写操作完成后,使用对应的 Get/List 命令验证操作结果。

Common Errors

常见错误

Error CodeSolution
Forbidden.Access / PermissionDeniedCheck RAM permissions, see references/ram-policies.md
InvalidParameterCheck ConnectionProperties JSON and required parameters
EntityNotExistsVerify the ID and Region are correct
QuotaExceededDelete unused resources or request a quota increase
Duplicate*Use a different name
错误码解决方案
Forbidden.Access / PermissionDenied检查 RAM 权限,参考 references/ram-policies.md
InvalidParameter检查 ConnectionProperties JSON 格式和必填参数
EntityNotExists验证 ID 和 Region 是否正确
QuotaExceeded删除闲置资源或申请提升配额
Duplicate*更换名称重试

Region

Region 说明

Common:
cn-hangzhou
,
cn-shanghai
,
cn-beijing
,
cn-shenzhen
. Endpoint:
dataworks.<region-id>.aliyuncs.com
Full list: references/related-apis.md
常用 Region:
cn-hangzhou
cn-shanghai
cn-beijing
cn-shenzhen
。Endpoint 格式:
dataworks.<region-id>.aliyuncs.com
完整列表:references/related-apis.md

Best Practices

最佳实践

  1. Query before action — Confirm current state before create operations
  2. Manage by environment — Manage Dev and Prod resources separately
  3. Verify operations — Use Get/List to verify after each write operation
  4. Proactive guidance — Suggest the next step after each step completes
  5. Protect data sources and compute resources — Never modify or delete data sources or compute resources via this skill; use the DataWorks console for such operations
  1. 操作前先查询 —— 执行创建操作前先确认当前状态
  2. 按环境隔离管理 —— 分别管理开发和生产环境资源
  3. 操作后验证 —— 每次写操作后使用 Get/List 接口验证结果
  4. 主动引导 —— 每一步完成后主动建议下一步操作
  5. 保护数据源和计算资源 —— 禁止通过本技能修改或删除数据源、计算资源,此类操作请使用 DataWorks 控制台

Reference Links

参考链接

ReferenceDescription
references/data-sources/README.mdData source type list and ConnectionProperties examples
references/data-sources/Detailed configuration docs for each data source type (51 files)
references/cross-account-datasources.mdCross-account data source configuration guide
references/compute-resources/README.mdCompute resource ConnectionProperties examples
references/cli-installation-guide.mdAliyun CLI installation guide
references/ram-policies.mdRAM permission configuration and policy examples
references/related-apis.mdAPI parameter details and Region Endpoints
参考文档说明
references/data-sources/README.md数据源类型列表和 ConnectionProperties 示例
references/data-sources/各数据源类型详细配置文档(共51个文件)
references/cross-account-datasources.md跨账号数据源配置指南
references/compute-resources/README.md计算资源 ConnectionProperties 示例
references/cli-installation-guide.mdAliyun CLI 安装指南
references/ram-policies.mdRAM 权限配置和策略示例
references/related-apis.mdAPI 参数详情和 Region Endpoint 列表