/alibabacloud-ecs-ops:alibabacloud-ecs-instance-opsfrom alibabacloud-ecs-ops
Manages Alibaba Cloud ECS instance lifecycle: create, start, stop, restart, release, and query instances. Includes cost estimation pre-checks and credential validation.
Ships in alibabacloud-ecs-ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Manage the full lifecycle of Alibaba Cloud ECS instances: create, start, stop, restart, release, and query.
Pre-check: Alibaba Cloud CLI must be installed and at least version 3.3.3.
aliyun version # must be >= 3.3.3; if not installed:
/bin/bash -c "$(curl -fsSL --connect-timeout 10 --max-time 120 https://aliyuncli.alicdn.com/setup.sh)"
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values
- NEVER ask the user to input AK/SK directly
- NEVER use
aliyun configure setwith literal credential values- ONLY use
aliyun configure listto check credential statusaliyun configure listIf no valid profile exists, STOP and guide user to configure credentials.
Pre-check: Aliyun CLI plugin update required
aliyun configure set --auto-plugin-install true aliyun plugin update
Upon loading this skill, generate a random session ID (32-char lowercase hex string) once for the entire session. Use it as {session-id} below.
Rule: Every aliyun CLI command that calls a cloud API MUST include the --user-agent flag.
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
Before executing any chargeable instance operation (run-instances, modify-instance-spec, modify-instance-charge-type), you MUST follow the alibabacloud-cli-cost-estimation skill to evaluate the cost impact at the user task level:
--estimate-cost to the exact command before execution, present the quoted amount, and wait for user confirmation.--estimate-cost and --estimate-cost-context as needed, present one consolidated cost plan, then ask for a single confirmation of the whole task before executing step 1.The cost evaluation output must include a clearly labelled cost summary section so the user can identify it before confirming.
See the alibabacloud-cli-cost-estimation SKILL.md for the full cost plan format, quote JSON parsing, and multi-step workflow quoting rules.
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.
List instances in a region with optional filters:
# List all instances in a region
aliyun ecs describe-instances --biz-region-id <RegionId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Query specific instance by ID
aliyun ecs describe-instances --biz-region-id <RegionId> \
--instance-ids '["<InstanceId>"]' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Filter by status (Running, Stopped, Starting, Stopping, Pending)
aliyun ecs describe-instances --biz-region-id <RegionId> \
--status Running \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Filter by instance name
aliyun ecs describe-instances --biz-region-id <RegionId> \
--instance-name "<InstanceName>" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
Cost estimation: Before executing
run-instances, run with--estimate-costto get a quote. Present the cost to the user (e.g. "Estimated instance cost: ¥X/month (PostPaid) or ¥X (PrePaid). Proceed?").
# Create and start instance (RunInstances)
aliyun ecs run-instances \
--biz-region-id <RegionId> \
--security-group-id <SecurityGroupId> \
--v-switch-id <VSwitchId> \
--image-id <ImageId> \
--instance-type <InstanceType> \
--instance-name <InstanceName> \
--system-disk.category cloud_essd \
--system-disk.size 40 \
--instance-charge-type PostPaid \
--internet-max-bandwidth-out 0 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Start instance
aliyun ecs start-instance --instance-id <InstanceId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Stop instance (graceful)
aliyun ecs stop-instance --instance-id <InstanceId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Stop instance (force)
aliyun ecs stop-instance --instance-id <InstanceId> \
--force-stop true \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Restart instance
aliyun ecs reboot-instance --instance-id <InstanceId> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Release a Pay-As-You-Go instance
aliyun ecs delete-instance --instance-id <InstanceId> --force true \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
WARNING: Instance release is irreversible. Always confirm with the user before executing.
Cost estimation: Before executing
modify-instance-spec, run with--estimate-costto get a quote for the spec change delta. Present the cost to the user (e.g. "Estimated spec change delta: ¥X. Proceed?").
# Modify instance name
aliyun ecs modify-instance-attribute --instance-id <InstanceId> \
--instance-name "<NewName>" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Modify instance type (requires stop first)
aliyun ecs modify-instance-spec --instance-id <InstanceId> \
--instance-type <NewInstanceType> \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
| Action | Resource |
|---|---|
ecs:DescribeInstances | * |
ecs:RunInstances | * |
ecs:StartInstance | acs:ecs:*:*:instance/<InstanceId> |
ecs:StopInstance | acs:ecs:*:*:instance/<InstanceId> |
ecs:RebootInstance | acs:ecs:*:*:instance/<InstanceId> |
ecs:DeleteInstance | acs:ecs:*:*:instance/<InstanceId> |
ecs:ModifyInstanceAttribute | acs:ecs:*:*:instance/<InstanceId> |
ecs:ModifyInstanceSpec | acs:ecs:*:*:instance/<InstanceId> |
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
- Read
references/ram-policies.mdto get the full list of permissions required by this SKILL- Use
ram-permission-diagnoseskill to guide the user through requesting the necessary permissions- Pause and wait until the user confirms that the required permissions have been granted
# Verify instance status after operations
aliyun ecs describe-instances --biz-region-id <RegionId> \
--instance-ids '["<InstanceId>"]' \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ecs-instance-ops/{session-id}
# Check Status field: Running, Stopped, Starting, Stopping
See references/related-commands.md for the complete ECS instance CLI command reference.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aliyun/alibabacloud-agent-toolkit --plugin alibabacloud-ecs-ops9 skills in this plugin
/alibabacloud-cli-cost-estimationPre-execution cost estimation for Alibaba Cloud CLI operations. Use this skill whenever a user asks "how much will this cost", before executing any chargeable operation (create / resize / renew / bandwidth change), or when planning a multi-step workflow whose total cost should be known up front. Covers the --estimate-cost flag (quote without executing), --estimate-cost-context (usage assumptions and future-state overrides for multi-step workflows), reading the quote JSON correctly (pricingMode, pricingUnit, delta amounts), and reconciling quotes against actual bills.
/alibabacloud-cli-guidanceGuide for Alibaba Cloud CLI (aliyun) command syntax, plugin system, parameter naming, and best practices. Use this skill to generate correct CLI commands, understand plugin vs built-in command differences, structured parameter syntax, output filtering, pagination, and error troubleshooting. This skill is a CLI knowledge reference — when MCP tools (AlibabaCloud___CallCLI, etc.) are available, always prefer MCP tools for execution rather than running aliyun commands locally in the shell.
/alibabacloud-ecs-diagnoseAlibaba Cloud ECS instance diagnostics and troubleshooting. Use for diagnosing instance
connection issues, performance problems, system status checks, and health monitoring.
Covers SSH/RDP connectivity, system events, instance health, and performance analysis.
Triggers: "ecs diagnose", "ecs troubleshoot", "instance connection issue",
"ssh cannot connect", "ecs performance", "instance health", "ecs monitoring",
"system event", "instance unreachable".
/alibabacloud-ecs-disk-opsAlibaba Cloud ECS disk and snapshot operations. Use for managing cloud disks (attach,
detach, expand, create data disk), snapshots (create, restore, delete, policy), and
disk category management. Covers system disk and data disk lifecycle.
Triggers: "ecs disk", "cloud disk", "attach disk", "detach disk", "expand disk",
"data disk", "snapshot", "create snapshot", "restore snapshot", "disk resize",
"disk capacity", "auto snapshot policy".
/alibabacloud-ecs-scenario-opsAlibaba Cloud ECS scenario-based operations. Use for end-to-end operational scenarios
that combine multiple ECS operations into complete workflows: full-stack instance
provisioning (VPC + SecurityGroup + Instance), disk expansion with OS resize, adding
data disks with formatting, instance migration, and batch operations.
Triggers: "create full instance", "provision ecs", "expand disk and resize partition",
"add data disk", "format disk", "ecs migration", "batch ecs operations",
"ecs scenario", "full stack ecs", "instance with network".
/alibabacloud-ecs-security-groupAlibaba Cloud ECS security group and network management. Use for creating and managing
security groups, configuring inbound/outbound rules, managing network interfaces, and
troubleshooting network connectivity. Covers security group CRUD, rule management,
ENI operations, and VPC network checks.
Triggers: "security group", "ecs network", "firewall rule", "security group rule",
"inbound rule", "outbound rule", "network interface", "ENI", "port access",
"open port", "security group management".
Other plugins' skills for the same job