Tair DevToolset — Instance Creation and Public Network Configuration
Automate Tair Enterprise Edition cloud-native instance creation, public network access configuration, and IP whitelist setup using Aliyun CLI.
Architecture: VPC + VSwitch + Tair Enterprise Instance + Public Endpoint
1. Installation
Pre-check: Aliyun CLI >= 3.3.1 required
Run aliyun version to verify >= 3.3.1. If not installed or version too low,
see references/cli-installation-guide.md for installation instructions.
Then [MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.
CODEBLOCK0
If jq is not installed:
brew install jq # macOS
2. Authentication
Pre-check: Alibaba Cloud Credentials Required
All credential configurations follow existing aliyun CLI settings, no separate configuration needed in scripts.
Security Rules:
- - NEVER read, echo, or print AK/SK values (e.g.,
echo $ALIBABA_CLOUD_ACCESS_KEY_ID is FORBIDDEN) - NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use
aliyun configure set with literal credential values - ONLY use
aliyun configure list to check credential status
> aliyun configure list
>
Check the output for a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, STOP here.
- 1. Obtain credentials from Alibaba Cloud Console
- Configure credentials outside of this session (via
aliyun configure in terminal or environment variables in shell profile) - Return and re-run after
aliyun configure list shows a valid profile
3. RAM Policy
See references/ram-policies.md for RAM permissions required by this Skill.
Core permissions:
| RAM Action | Description |
|---|
| INLINECODE9 | Create Tair instance |
| INLINECODE10 |
Query instance status |
|
r-kvstore:ModifySecurityIps | Modify IP whitelist |
|
r-kvstore:AllocateInstancePublicConnection | Allocate public endpoint |
|
r-kvstore:DescribeDBInstanceNetInfo | Query network info |
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
- 1. Read
references/ram-policies.md to get the full list of permissions required by this SKILL - Use
ram-permission-diagnose skill to guide the user through requesting the necessary permissions - Pause and wait until the user confirms that the required permissions have been granted
4. Parameter Confirmation
IMPORTANT: Parameter Confirmation — Before executing any command or API call,
ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks,
passwords, domain names, resource specifications, etc.) MUST be confirmed with the
user. Do NOT assume or use default values without explicit user approval.
| Parameter | Required | Description | Default |
|---|
| VPCID | Yes | VPC ID, e.g. INLINECODE16 | — |
| VSWITCHID |
Yes | VSwitch ID, e.g.
vsw-bp1xxx | — |
| REGION_ID | No | Region ID |
cn-hangzhou |
| ZONE_ID | No | Zone ID |
cn-hangzhou-h |
| INSTANCE_TYPE | No | Instance series |
tair_rdb |
| INSTANCE_CLASS | No | Instance specification |
tair.rdb.1g |
| INSTANCE_NAME | No | Instance name |
tair-benchmark-<timestamp> |
Common Specifications
Standard Architecture
| InstanceClass | Memory | Bandwidth | Max Connections | QPS Reference |
|---|
| tair.rdb.1g | 1 GB | 768 Mbps | 30,000 | 300,000 |
| tair.rdb.2g |
2 GB | 768 Mbps | 30,000 | 300,000 |
| tair.rdb.4g | 4 GB | 768 Mbps | 40,000 | 300,000 |
| tair.rdb.8g | 8 GB | 768 Mbps | 40,000 | 300,000 |
| tair.rdb.16g | 16 GB | 768 Mbps | 40,000 | 300,000 |
| tair.rdb.24g | 24 GB | 768 Mbps | 50,000 | 300,000 |
| tair.rdb.32g | 32 GB | 768 Mbps | 50,000 | 300,000 |
| tair.rdb.64g | 64 GB | 768 Mbps | 50,000 | 300,000 |
5. Core Workflow
[MUST] Execution Constraints
- - MUST and ONLY use
scripts/create-and-connect-test.sh script to complete instance creation, whitelist configuration, public endpoint allocation, etc. - DO NOT bypass the script to directly call
aliyun r-kvstore CLI commands for the above operations - DO NOT write or concatenate aliyun CLI commands to replace script functionality
- Model's responsibility is: collect parameters → set environment variables → run script. No improvisation allowed.
Set environment variables with collected parameters and run the all-in-one script:
CODEBLOCK3
The script will automatically complete: Create instance → Wait for ready → Configure whitelist → Allocate public endpoint → Get public connection info.
6. Success Verification
See references/verification-method.md for detailed verification steps.
Quick instance status verification:
CODEBLOCK4
Confirm InstanceStatus is Normal and public endpoint is allocated.
7. Troubleshooting
| Issue | Solution |
|---|
| Connection timeout | Check if whitelist includes current public IP (must be IPv4) |
| Public endpoint empty |
Confirm
allocate-instance-public-connection executed successfully and wait for instance to recover to Normal |
8. Best Practices
- 1. Use pay-as-you-go (PostPaid) for testing
- Only add test machine's public IP to whitelist, follow least privilege principle
9. Reference Links
RAM Permission Policy Document |
|
references/related-commands.md | Related CLI Commands and Parameters |
|
references/verification-method.md | Success Verification Method |
|
references/acceptance-criteria.md | Acceptance Criteria |
Tair DevToolset — 实例创建与公网配置
使用阿里云CLI自动化创建Tair企业版云原生实例、配置公网访问和IP白名单。
架构: VPC + VSwitch + Tair企业版实例 + 公网端点
1. 安装
前置检查: 需要Aliyun CLI >= 3.3.1
运行 aliyun version 验证版本 >= 3.3.1。如果未安装或版本过低,
请参阅 references/cli-installation-guide.md 获取安装说明。
然后[必须]运行 aliyun configure set --auto-plugin-install true 启用自动插件安装。
bash
验证CLI版本
aliyun version
启用自动插件安装
aliyun configure set --auto-plugin-install true
验证jq
jq --version
如果未安装jq:
bash
brew install jq # macOS
2. 身份验证
前置检查: 需要阿里云凭证
所有凭证配置遵循现有aliyun CLI设置,脚本中无需单独配置。
安全规则:
- - 绝不读取、回显或打印AK/SK值(例如,echo $ALIBABACLOUDACCESSKEYID 是禁止的)
- 绝不要求用户在对话或命令行中直接输入AK/SK
- 绝不使用字面凭证值执行 aliyun configure set
- 仅使用 aliyun configure list 检查凭证状态
bash
aliyun configure list
检查输出中是否存在有效配置文件(AK、STS或OAuth身份)。
如果没有有效配置文件,在此停止。
- 1. 从阿里云控制台获取凭证
- 在此会话之外配置凭证(通过终端中的 aliyun configure 或shell配置文件中的环境变量)
- 在 aliyun configure list 显示有效配置文件后返回并重新运行
3. RAM策略
参见 references/ram-policies.md 了解此技能所需的RAM权限。
核心权限:
| RAM操作 | 描述 |
|---|
| r-kvstore:CreateTairInstance | 创建Tair实例 |
| r-kvstore:DescribeInstanceAttribute |
查询实例状态 |
| r-kvstore:ModifySecurityIps | 修改IP白名单 |
| r-kvstore:AllocateInstancePublicConnection | 分配公网端点 |
| r-kvstore:DescribeDBInstanceNetInfo | 查询网络信息 |
[必须] 权限失败处理: 当执行过程中任何命令或API调用因权限错误失败时,请遵循以下流程:
- 1. 阅读 references/ram-policies.md 获取此技能所需的完整权限列表
- 使用 ram-permission-diagnose 技能引导用户请求必要权限
- 暂停并等待用户确认所需权限已授予
4. 参数确认
重要: 参数确认 — 在执行任何命令或API调用之前,
所有用户可自定义参数(例如,RegionId、实例名称、CIDR块、
密码、域名、资源规格等)必须与用户确认。未经用户明确批准,
不得假设或使用默认值。
| 参数 | 必需 | 描述 | 默认值 |
|---|
| VPCID | 是 | VPC ID,例如 vpc-bp1xxx | — |
| VSWITCHID |
是 | VSwitch ID,例如 vsw-bp1xxx | — |
| REGION_ID | 否 | 区域ID | cn-hangzhou |
| ZONE_ID | 否 | 可用区ID | cn-hangzhou-h |
| INSTANCE
TYPE | 否 | 实例系列 | tairrdb |
| INSTANCE_CLASS | 否 | 实例规格 | tair.rdb.1g |
| INSTANCE_NAME | 否 | 实例名称 | tair-benchmark-
|
常见规格
标准架构
| InstanceClass | 内存 | 带宽 | 最大连接数 | QPS参考 |
|---|
| tair.rdb.1g | 1 GB | 768 Mbps | 30,000 | 300,000 |
| tair.rdb.2g |
2 GB | 768 Mbps | 30,000 | 300,000 |
| tair.rdb.4g | 4 GB | 768 Mbps | 40,000 | 300,000 |
| tair.rdb.8g | 8 GB | 768 Mbps | 40,000 | 300,000 |
| tair.rdb.16g | 16 GB | 768 Mbps | 40,000 | 300,000 |
| tair.rdb.24g | 24 GB | 768 Mbps | 50,000 | 300,000 |
| tair.rdb.32g | 32 GB | 768 Mbps | 50,000 | 300,000 |
| tair.rdb.64g | 64 GB | 768 Mbps | 50,000 | 300,000 |
5. 核心工作流
[必须] 执行约束
- - 必须且仅使用 scripts/create-and-connect-test.sh 脚本完成实例创建、白名单配置、公网端点分配等操作
- 不要绕过脚本直接调用 aliyun r-kvstore CLI命令执行上述操作
- 不要编写或拼接aliyun CLI命令来替代脚本功能
- 模型的责任是: 收集参数 → 设置环境变量 → 运行脚本。不允许即兴发挥。
使用收集的参数设置环境变量并运行一体化脚本:
bash
export VPCID=<用户确认的VPCID>
export VSWITCHID=<用户确认的VSWITCHID>
可选参数
export REGION_ID=cn-hangzhou
export ZONE_ID=cn-hangzhou-h
export INSTANCETYPE=tairrdb
export INSTANCE_CLASS=tair.rdb.1g
对于NAT环境,手动设置公网IP
export MYPUBLICIP=your-public-ip
bash scripts/create-and-connect-test.sh
脚本将自动完成: 创建实例 → 等待就绪 → 配置白名单 → 分配公网端点 → 获取公网连接信息。
6. 成功验证
参见 references/verification-method.md 了解详细的验证步骤。
快速实例状态验证:
bash
aliyun r-kvstore describe-instance-attribute \
--instance-id ${INSTANCE_ID} \
--user-agent AlibabaCloud-Agent-Skills
确认 InstanceStatus 为 Normal 且公网端点已分配。
7. 故障排除
| 问题 | 解决方案 |
|---|
| 连接超时 | 检查白名单是否包含当前公网IP(必须是IPv4) |
| 公网端点为空 |
确认 allocate-instance-public-connection 已成功执行并等待实例恢复到Normal状态 |
8. 最佳实践
- 1. 测试使用按量付费(PostPaid)
- 仅将测试机器的公网IP添加到白名单,遵循最小权限原则
9. 参考链接
RAM权限策略文档 |
| references/related-commands.md | 相关CLI命令和参数 |
| references/verification-method.md | 成功验证方法 |
| references/acceptance-criteria.md | 验收标准 |