huaweicloud-devkit 0.1.21 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.agents/plugins/marketplace.json +20 -20
  2. package/LICENSE +201 -201
  3. package/README.md +169 -169
  4. package/bin/setup.cjs +7 -7
  5. package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
  6. package/integrations/opencode/opencode.json +14 -14
  7. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +30 -30
  8. package/package.json +43 -43
  9. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +43 -43
  10. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +42 -42
  11. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +43 -43
  12. package/plugins/huaweicloud-core/.mcp.json +13 -13
  13. package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
  14. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +88 -88
  15. package/plugins/huaweicloud-core/safety/policy.json +85 -85
  16. package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +144 -144
  17. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
  18. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
  19. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
  20. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +73 -73
  21. package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
  22. package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
  23. package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
  24. package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
  25. package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
  26. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +131 -131
  27. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +96 -96
  28. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
  29. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +28 -28
  30. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
  31. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -132
  32. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
  33. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
  34. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
  35. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
  36. package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
  37. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
  38. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
  39. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
  40. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +118 -118
  41. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
  42. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
  43. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +181 -181
  44. package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
  45. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +78 -78
  46. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
  47. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
  48. package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
  49. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
  50. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +47 -47
  51. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
  52. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +127 -127
  53. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
  54. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +93 -93
  55. package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
  56. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
  57. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
  58. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +46 -46
  59. package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
  60. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
  61. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
  62. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
  63. package/plugins/huaweicloud-core/src/mcp-server.mjs +93 -93
  64. package/plugins/huaweicloud-core/src/safety-policy.mjs +289 -289
  65. package/plugins/huaweicloud-core/src/setup-cli.mjs +874 -869
  66. package/plugins/huaweicloud-core/src/tools.mjs +677 -677
@@ -1,97 +1,97 @@
1
- ---
2
- name: huawei-dew
3
- description: "Use when managing secrets, credentials, encryption keys, certificates, or any sensitive data on Huawei Cloud. Covers CSMS (Cloud Secret Management Service) for secrets, KMS for encryption keys, and credential rotation. Triggers on: secret, credential, API key, token, password, encrypt, decrypt, KMS, CSMS, DEW, certificate, CSR, rotation. Activates for ANY task involving secrets or credentials — load this skill first before touching secrets."
4
- version: 1
5
- ---
6
-
7
- # Huawei Cloud DEW (Data Encryption Workshop)
8
-
9
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
-
11
- Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
-
13
- ## Overview
14
-
15
- Domain expertise for Huawei Cloud Data Encryption Workshop (DEW). Covers CSMS for secret lifecycle management, KMS for encryption key management, credential rotation, and secure application integration patterns.
16
-
17
- ## Critical Warnings
18
-
19
- | Trap | Why |
20
- |------|-----|
21
- | NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection |
22
- | NEVER echo credentials in conversation | AK/SK, passwords, tokens must never appear in chat |
23
- | KMS key deletion is irreversible | 7-30 day pending deletion window. Once gone, data is unrecoverable |
24
- | Secret rotation requires automation | Manual rotation risks stale credentials |
25
- | Cross-account KMS needs grants | KMS keys are regional. Cross-region data needs grant setup |
26
-
27
- ## CSMS Operations
28
-
29
- ### Read-only (safe — metadata only)
30
- | Operation | Description |
31
- |-----------|-------------|
32
- | ListSecrets | List all secrets (names only, no values) |
33
- | DescribeSecret | Get secret metadata (rotation config, KMS key, status) |
34
- | ListSecretVersions | List version IDs and stages (no values) |
35
-
36
- ### Secret Value (blocked by policy — use runtime injection)
37
- | Operation | Safe Alternative |
38
- |-----------|-----------------|
39
- | DownloadSecret | Use {{resolve:csms:secret-id}} in IaC or SDK |
40
- | ShowSecretVersion | Use runtime injection, never in agent context |
41
- | GetSecretValue | Blocked. Use MCP proxy resolve pattern |
42
-
43
- ## KMS Operations
44
-
45
- | Task | Command | Notes |
46
- |------|---------|-------|
47
- | List keys | hcloud KMS ListKeys | Read-only |
48
- | Create key | hcloud KMS CreateKey --key_alias=<name> | Requires write approval |
49
- | Encrypt | hcloud KMS EncryptData --key_id=<id> --plaintext=<b64> | Prefer SDK offline encrypt |
50
- | Decrypt | hcloud KMS DecryptData (**BLOCKED**) | Use runtime injection |
51
-
52
- ## Runtime Injection Pattern
53
-
54
- `ash
55
- # Terraform / IaC
56
- resource "huaweicloud_csms_secret" "db_password" {
57
- secret_string = var.db_password # NEVER hardcode
58
- }
59
-
60
- # SDK
61
- secret_value = client.get_secret(secret_id="my-secret")
62
- # Use immediately, never print or store in context
63
-
64
- # hcloud (for approved automation only)
65
- hcloud CSMS DownloadSecret --secret_name=<name>
66
- # WARNING: Output goes to stdout. Pipe directly, never capture in agent.
67
- `
68
-
69
- ## Troubleshooting
70
-
71
- | Error | Root Cause -> Fix |
72
- |-------|------------------|
73
- | Secret not found | Wrong region or project -> Verify secret ARN includes region/project |
74
- | AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt |
75
- | KMS key disabled | Key scheduled for deletion or manually disabled -> Enable or create new key |
76
- | Rotation stuck | Lambda/Python function error -> Check rotation function logs |
77
-
78
- ## Security Considerations
79
-
80
- - MUST use runtime injection. NEVER fetch secrets into agent context
81
- - MUST rotate credentials every 90 days
82
- - MUST enable automatic rotation for CSMS secrets
83
- - MUST audit KMS key usage via CTS
84
- - SHOULD use customer-managed keys (CMK) for sensitive data
85
- - MUST NOT use default KMS keys for production workloads
86
-
87
- ## MCP Tools
88
-
89
- - huaweicloud_list_operations service=DEW or CSMS or KMS
90
- - huaweicloud_run_readonly_command for ListSecrets/ListKeys (metadata only)
91
- - huaweicloud_safety policy blocks all secret value reads
92
-
93
- ## References
94
-
95
- - DEW Docs: https://support.huaweicloud.com/dew/
96
- - CSMS usage: references/csms-usage.md
97
- - KMS usage: references/kms-usage.md
1
+ ---
2
+ name: huawei-dew
3
+ description: "Use when managing secrets, credentials, encryption keys, certificates, or any sensitive data on Huawei Cloud. Covers CSMS (Cloud Secret Management Service) for secrets, KMS for encryption keys, and credential rotation. Triggers on: secret, credential, API key, token, password, encrypt, decrypt, KMS, CSMS, DEW, certificate, CSR, rotation. Activates for ANY task involving secrets or credentials — load this skill first before touching secrets."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud DEW (Data Encryption Workshop)
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for Huawei Cloud Data Encryption Workshop (DEW). Covers CSMS for secret lifecycle management, KMS for encryption key management, credential rotation, and secure application integration patterns.
16
+
17
+ ## Critical Warnings
18
+
19
+ | Trap | Why |
20
+ |------|-----|
21
+ | NEVER fetch secret values into agent context | Use {{resolve:csms:secret-id:SecretString:key}} runtime injection |
22
+ | NEVER echo credentials in conversation | AK/SK, passwords, tokens must never appear in chat |
23
+ | KMS key deletion is irreversible | 7-30 day pending deletion window. Once gone, data is unrecoverable |
24
+ | Secret rotation requires automation | Manual rotation risks stale credentials |
25
+ | Cross-account KMS needs grants | KMS keys are regional. Cross-region data needs grant setup |
26
+
27
+ ## CSMS Operations
28
+
29
+ ### Read-only (safe — metadata only)
30
+ | Operation | Description |
31
+ |-----------|-------------|
32
+ | ListSecrets | List all secrets (names only, no values) |
33
+ | DescribeSecret | Get secret metadata (rotation config, KMS key, status) |
34
+ | ListSecretVersions | List version IDs and stages (no values) |
35
+
36
+ ### Secret Value (blocked by policy — use runtime injection)
37
+ | Operation | Safe Alternative |
38
+ |-----------|-----------------|
39
+ | DownloadSecret | Use {{resolve:csms:secret-id}} in IaC or SDK |
40
+ | ShowSecretVersion | Use runtime injection, never in agent context |
41
+ | GetSecretValue | Blocked. Use MCP proxy resolve pattern |
42
+
43
+ ## KMS Operations
44
+
45
+ | Task | Command | Notes |
46
+ |------|---------|-------|
47
+ | List keys | hcloud KMS ListKeys | Read-only |
48
+ | Create key | hcloud KMS CreateKey --key_alias=<name> | Requires write approval |
49
+ | Encrypt | hcloud KMS EncryptData --key_id=<id> --plaintext=<b64> | Prefer SDK offline encrypt |
50
+ | Decrypt | hcloud KMS DecryptData (**BLOCKED**) | Use runtime injection |
51
+
52
+ ## Runtime Injection Pattern
53
+
54
+ `ash
55
+ # Terraform / IaC
56
+ resource "huaweicloud_csms_secret" "db_password" {
57
+ secret_string = var.db_password # NEVER hardcode
58
+ }
59
+
60
+ # SDK
61
+ secret_value = client.get_secret(secret_id="my-secret")
62
+ # Use immediately, never print or store in context
63
+
64
+ # hcloud (for approved automation only)
65
+ hcloud CSMS DownloadSecret --secret_name=<name>
66
+ # WARNING: Output goes to stdout. Pipe directly, never capture in agent.
67
+ `
68
+
69
+ ## Troubleshooting
70
+
71
+ | Error | Root Cause -> Fix |
72
+ |-------|------------------|
73
+ | Secret not found | Wrong region or project -> Verify secret ARN includes region/project |
74
+ | AccessDenied on CSMS | Missing IAM CSMS policy -> Add csms:DescribeSecret + kms:Decrypt |
75
+ | KMS key disabled | Key scheduled for deletion or manually disabled -> Enable or create new key |
76
+ | Rotation stuck | Lambda/Python function error -> Check rotation function logs |
77
+
78
+ ## Security Considerations
79
+
80
+ - MUST use runtime injection. NEVER fetch secrets into agent context
81
+ - MUST rotate credentials every 90 days
82
+ - MUST enable automatic rotation for CSMS secrets
83
+ - MUST audit KMS key usage via CTS
84
+ - SHOULD use customer-managed keys (CMK) for sensitive data
85
+ - MUST NOT use default KMS keys for production workloads
86
+
87
+ ## MCP Tools
88
+
89
+ - huaweicloud_list_operations service=DEW or CSMS or KMS
90
+ - huaweicloud_run_readonly_command for ListSecrets/ListKeys (metadata only)
91
+ - huaweicloud_safety policy blocks all secret value reads
92
+
93
+ ## References
94
+
95
+ - DEW Docs: https://support.huaweicloud.com/dew/
96
+ - CSMS usage: references/csms-usage.md
97
+ - KMS usage: references/kms-usage.md
@@ -1,29 +1,29 @@
1
- # CSMS Usage Guide
2
-
3
- ## Create Secret
4
- hcloud CSMS CreateSecret --secret_name=prod-db-password --secret_string='{"password":"CHANGE_ME"}'
5
-
6
- ## List Secrets (metadata only)
7
- hcloud CSMS ListSecrets
8
-
9
- ## Describe Secret
10
- hcloud CSMS DescribeSecret --secret_name=prod-db-password
11
-
12
- ## List Versions
13
- hcloud CSMS ListSecretVersions --secret_name=prod-db-password
14
-
15
- ## Runtime Injection (Terraform)
16
- data "huaweicloud_csms_secret" "db" {
17
- secret_name = "prod-db-password"
18
- }
19
- Use: data.huaweicloud_csms_secret.db.secret_string
20
-
21
- ## Rotation
22
- - Enable auto-rotation: hcloud CSMS EnableSecretRotation --secret_name=<name> --rotation_interval=30
23
- - Rotation function ARN: provide Lambda to generate new secret value
24
-
25
- ## Policy Rules
26
- - hcloud CSMS DownloadSecret -> BLOCKED (use runtime injection)
27
- - hcloud CSMS ShowSecretVersion -> BLOCKED
28
- - hcloud CSMS ListSecrets -> ALLOWED (metadata only)
29
- - hcloud CSMS DescribeSecret -> ALLOWED (metadata only)
1
+ # CSMS Usage Guide
2
+
3
+ ## Create Secret
4
+ hcloud CSMS CreateSecret --secret_name=prod-db-password --secret_string='{"password":"CHANGE_ME"}'
5
+
6
+ ## List Secrets (metadata only)
7
+ hcloud CSMS ListSecrets
8
+
9
+ ## Describe Secret
10
+ hcloud CSMS DescribeSecret --secret_name=prod-db-password
11
+
12
+ ## List Versions
13
+ hcloud CSMS ListSecretVersions --secret_name=prod-db-password
14
+
15
+ ## Runtime Injection (Terraform)
16
+ data "huaweicloud_csms_secret" "db" {
17
+ secret_name = "prod-db-password"
18
+ }
19
+ Use: data.huaweicloud_csms_secret.db.secret_string
20
+
21
+ ## Rotation
22
+ - Enable auto-rotation: hcloud CSMS EnableSecretRotation --secret_name=<name> --rotation_interval=30
23
+ - Rotation function ARN: provide Lambda to generate new secret value
24
+
25
+ ## Policy Rules
26
+ - hcloud CSMS DownloadSecret -> BLOCKED (use runtime injection)
27
+ - hcloud CSMS ShowSecretVersion -> BLOCKED
28
+ - hcloud CSMS ListSecrets -> ALLOWED (metadata only)
29
+ - hcloud CSMS DescribeSecret -> ALLOWED (metadata only)
@@ -1,23 +1,23 @@
1
- # KMS Usage Guide
2
-
3
- ## Create Key
4
- hcloud KMS CreateKey --key_alias=app-encryption-key --key_description="Application data encryption"
5
-
6
- ## List Keys (metadata only)
7
- hcloud KMS ListKeys
8
-
9
- ## Encrypt (offline preferred)
10
- hcloud KMS EncryptData --key_id=<key-id> --plaintext=<base64-data>
11
-
12
- ## Decrypt (BLOCKED - use runtime)
13
- DO NOT use hcloud KMS DecryptData directly.
14
- Use SDK with KMS client in application runtime.
15
-
16
- ## Key Rotation
17
- - Enable: hcloud KMS EnableKeyRotation --key_id=<key-id>
18
- - Rotation period: 365 days (default)
19
-
20
- ## Key Deletion
21
- - Schedule: hcloud KMS ScheduleKeyDeletion --key_id=<key-id> --pending_days=7
22
- - Cancel during pending window: hcloud KMS CancelKeyDeletion --key_id=<key-id>
23
- - WARNING: After deletion window passes, data encrypted with this key is UNRECOVERABLE
1
+ # KMS Usage Guide
2
+
3
+ ## Create Key
4
+ hcloud KMS CreateKey --key_alias=app-encryption-key --key_description="Application data encryption"
5
+
6
+ ## List Keys (metadata only)
7
+ hcloud KMS ListKeys
8
+
9
+ ## Encrypt (offline preferred)
10
+ hcloud KMS EncryptData --key_id=<key-id> --plaintext=<base64-data>
11
+
12
+ ## Decrypt (BLOCKED - use runtime)
13
+ DO NOT use hcloud KMS DecryptData directly.
14
+ Use SDK with KMS client in application runtime.
15
+
16
+ ## Key Rotation
17
+ - Enable: hcloud KMS EnableKeyRotation --key_id=<key-id>
18
+ - Rotation period: 365 days (default)
19
+
20
+ ## Key Deletion
21
+ - Schedule: hcloud KMS ScheduleKeyDeletion --key_id=<key-id> --pending_days=7
22
+ - Cancel during pending window: hcloud KMS CancelKeyDeletion --key_id=<key-id>
23
+ - WARNING: After deletion window passes, data encrypted with this key is UNRECOVERABLE
@@ -1,131 +1,131 @@
1
- ---
2
- name: huawei-ecs
3
- description: "Use when creating, configuring, managing, or troubleshooting ECS instances on Huawei Cloud. Covers instance creation (hcloud ECS CreateServers), flavor selection, image management, security groups, EIP binding, disk attachment, auto-scaling (AS), and troubleshooting. Triggers on: ECS, instance, flavor, image, security group, EIP, EVS, auto-scaling. NOT for: CCE container workloads (use huawei-cce), BMS bare metal servers."
4
- version: 1
5
- ---
6
-
7
- # Huawei Cloud ECS
8
-
9
- **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
-
11
- Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
-
13
- ## Overview
14
-
15
- Domain expertise for Huawei Cloud Elastic Cloud Server (ECS). Covers instance lifecycle, flavor selection, image management, networking, storage attachment, auto-scaling, and troubleshooting.
16
-
17
- ## Prerequisites
18
-
19
- Before creating an ECS instance from scratch, you MUST have:
20
- - A VPC (see `huawei-vpc`)
21
- - A subnet with DNS configured (see `huawei-vpc`)
22
- - A security group with application ports open (see `huawei-vpc`)
23
-
24
- If these do not exist, load the `huawei-vpc` skill first and create them before returning here.
25
-
26
- ## Critical Warnings
27
-
28
- | Trap | Why |
29
- |------|-----|
30
- | Flavor not in region | Not all flavors available everywhere. Check with ECS ListFlavors first |
31
- | Security group denies all | New SGs deny ALL inbound. Must explicitly add rules |
32
- | EIP bills when idle | Unattached EIP still incurs charges |
33
- | Stopped instance still bills | Pay-per-use instances bill when stopped (unless shutdown-no-billing flavor) |
34
- | Disk survives instance delete | Deleting instance does NOT delete system disk by default |
35
-
36
- ## Flavor Selection Guide
37
-
38
- Flavor families are **region-dependent**. Always run `hcloud ECS ListFlavors --cli-region=<r>` to discover available flavors before recommending.
39
-
40
- | Scenario | Family | What to look for |
41
- |----------|--------|-----------------|
42
- | Web app / microservices | General-purpose (ac, s, sn, c) | 2-4 vCPU, 4-8 GB RAM |
43
- | Database / big data | Memory-optimized (m, r) | 4-8 vCPU, 16-64 GB RAM |
44
- | AI inference | GPU (g, p) | 8+ vCPU, 64+ GB RAM + GPU |
45
- | HPC | High-IO (h, ir, i) | 8+ vCPU, local SSD |
46
-
47
- > See `references/flavors.md` for discovery workflow. **Do not hardcode flavor names** — availability changes by region and over time.
48
-
49
- ## Common Workflows
50
-
51
- | Task | Command | Steps |
52
- |------|---------|-------|
53
- | List flavors | hcloud ECS ListFlavors --cli-region=<region> | references/flavors.md |
54
- | Create instance | hcloud ECS CreateServers --server.name=<n> --server.flavorRef=<id> --server.imageRef=<id> --server.nics.1.subnet_id=<id> --server.availability_zone=<az> | references/create-instance.md |
55
- | Find by name | See "How to search for instances" below | |
56
- | Bind EIP | hcloud EIP AssociatePublicips --publicip_id=<id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT | Get port ID from `hcloud ECS ListServersDetails --server_id=<id>` → `OS-EXT-IPS:port_id` |
57
- | Security group rule | hcloud VPC CreateSecurityGroupRule --security_group_id=<id> --direction=<direction> --protocol=<protocol> | references/sg.md |
58
- | Attach disk | hcloud EVS AttachVolume --volume_id=<id> --server_id=<id> | references/evs.md |
59
- | Delete instance | hcloud ECS DeleteServers --servers.1.id=<id> --delete_publicip=true --delete_volume=true | references/create-instance.md |
60
-
61
- ## How to Search for Instances
62
-
63
- `ListServersDetails` supports `--name` for exact match only. For fuzzy search:
64
-
65
- 1. List all instances: `hcloud ECS ListServersDetails --cli-region=<region> --limit=100`
66
- 2. Filter client-side by name substring, tag, or status
67
- 3. Use `--server_tags` filter if instances are tagged: `hcloud ECS ListServersDetails --server_tags.1.key=Project`
68
-
69
- Abort if the result set is larger than `--limit` and ask the user to narrow the search.
70
-
71
- ## Deleting Instances
72
-
73
- - Show the user the exact command and get explicit approval before running
74
- - By default, `--delete_publicip` and `--delete_volume` are **false** — public IP and system disk survive deletion
75
- - Set both to `true` to avoid orphaned resources and unexpected billing
76
- - Data disks ARE deleted by default (unlike system disk)
77
-
78
- ## Troubleshooting
79
-
80
- | Error | Root Cause -> Fix |
81
- |-------|------------------|
82
- | Cannot SSH | SG missing port 22 or no EIP -> Add ingress rule / Bind EIP |
83
- | Flavor unavailable | Region limitation -> ListFlavors in target region |
84
- | Insufficient resources | Stock depleted -> Change flavor or AZ |
85
- | AuthFailure | Expired AK/SK -> hcloud configure init |
86
- | APIGW.0802 / region permission | IAM user has no access to this region -> IAM console → User → Permissions → add region, or switch to another region |
87
-
88
- ## Security Considerations
89
-
90
- - MUST use security groups, not iptables
91
- - MUST store SSH keys in DEW, never in user-data
92
- - SHOULD enable CTS audit logging
93
- - MUST NOT open 0.0.0.0/0 for SSH
94
-
95
- ## MCP Tools
96
-
97
- Prefer these tools over raw hcloud CLI — they enforce safety policies:
98
-
99
- - huaweicloud_list_operations service=ECS
100
- - huaweicloud_run_readonly_command for discovery (auto-redacts output)
101
- - huaweicloud_run_approved_command for writes (requires exact command approval)
102
- - huaweicloud_check_cli to verify hcloud is available
103
-
104
- ## Without MCP (Fallback)
105
-
106
- If MCP tools are NOT available (new install, session not restarted):
107
- - Raw hcloud commands WILL appear in shell history — passwords and secrets are at risk
108
- - Always use key_name instead of adminPass
109
- - Verify safety manually: no secret value reads, no credential file access
110
- - Restart session as soon as possible to enable safety policies
111
-
112
- ## Without MCP
113
-
114
- Fall back to hcloud CLI. State: "MCP unavailable, using local hcloud CLI."
115
-
116
- ## Flexus (Lightweight ECS)
117
-
118
- Flexus is the lightweight ECS family. Two variants:
119
-
120
- | Variant | API | CLI | Billing |
121
- |---------|-----|:---:|---------|
122
- | **Flexus L** | HCSS (hcss:lightInstances) | ❌ No hcloud — Python SDK only | Prepaid only |
123
- | **Flexus X** | Standard ECS API | ✅ `hcloud ECS` with `x1.*` flavors | On-demand & prepaid |
124
-
125
- For Flexus X, use standard ECS CreateServers flow with `x1.*` flavors. For Flexus L, manual console provisioning is recommended — no KooCLI path exists.
126
-
127
- ## References
128
-
129
- - ECS Docs: https://support.huaweicloud.com/ecs/
130
- - Flavor specs: references/flavors.md
131
- - Create instance: references/create-instance.md
1
+ ---
2
+ name: huawei-ecs
3
+ description: "Use when creating, configuring, managing, or troubleshooting ECS instances on Huawei Cloud. Covers instance creation (hcloud ECS CreateServers), flavor selection, image management, security groups, EIP binding, disk attachment, auto-scaling (AS), and troubleshooting. Triggers on: ECS, instance, flavor, image, security group, EIP, EVS, auto-scaling. NOT for: CCE container workloads (use huawei-cce), BMS bare metal servers."
4
+ version: 1
5
+ ---
6
+
7
+ # Huawei Cloud ECS
8
+
9
+ **STOP - Do not answer from general knowledge.** Follow the procedure below.
10
+
11
+ Always run `hcloud <Service> <Operation> --help` before constructing commands to discover exact parameter names and requirements.
12
+
13
+ ## Overview
14
+
15
+ Domain expertise for Huawei Cloud Elastic Cloud Server (ECS). Covers instance lifecycle, flavor selection, image management, networking, storage attachment, auto-scaling, and troubleshooting.
16
+
17
+ ## Prerequisites
18
+
19
+ Before creating an ECS instance from scratch, you MUST have:
20
+ - A VPC (see `huawei-vpc`)
21
+ - A subnet with DNS configured (see `huawei-vpc`)
22
+ - A security group with application ports open (see `huawei-vpc`)
23
+
24
+ If these do not exist, load the `huawei-vpc` skill first and create them before returning here.
25
+
26
+ ## Critical Warnings
27
+
28
+ | Trap | Why |
29
+ |------|-----|
30
+ | Flavor not in region | Not all flavors available everywhere. Check with ECS ListFlavors first |
31
+ | Security group denies all | New SGs deny ALL inbound. Must explicitly add rules |
32
+ | EIP bills when idle | Unattached EIP still incurs charges |
33
+ | Stopped instance still bills | Pay-per-use instances bill when stopped (unless shutdown-no-billing flavor) |
34
+ | Disk survives instance delete | Deleting instance does NOT delete system disk by default |
35
+
36
+ ## Flavor Selection Guide
37
+
38
+ Flavor families are **region-dependent**. Always run `hcloud ECS ListFlavors --cli-region=<r>` to discover available flavors before recommending.
39
+
40
+ | Scenario | Family | What to look for |
41
+ |----------|--------|-----------------|
42
+ | Web app / microservices | General-purpose (ac, s, sn, c) | 2-4 vCPU, 4-8 GB RAM |
43
+ | Database / big data | Memory-optimized (m, r) | 4-8 vCPU, 16-64 GB RAM |
44
+ | AI inference | GPU (g, p) | 8+ vCPU, 64+ GB RAM + GPU |
45
+ | HPC | High-IO (h, ir, i) | 8+ vCPU, local SSD |
46
+
47
+ > See `references/flavors.md` for discovery workflow. **Do not hardcode flavor names** — availability changes by region and over time.
48
+
49
+ ## Common Workflows
50
+
51
+ | Task | Command | Steps |
52
+ |------|---------|-------|
53
+ | List flavors | hcloud ECS ListFlavors --cli-region=<region> | references/flavors.md |
54
+ | Create instance | hcloud ECS CreateServers --server.name=<n> --server.flavorRef=<id> --server.imageRef=<id> --server.nics.1.subnet_id=<id> --server.availability_zone=<az> | references/create-instance.md |
55
+ | Find by name | See "How to search for instances" below | |
56
+ | Bind EIP | hcloud EIP AssociatePublicips --publicip_id=<id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT | Get port ID from `hcloud ECS ListServersDetails --server_id=<id>` → `OS-EXT-IPS:port_id` |
57
+ | Security group rule | hcloud VPC CreateSecurityGroupRule --security_group_id=<id> --direction=<direction> --protocol=<protocol> | references/sg.md |
58
+ | Attach disk | hcloud EVS AttachVolume --volume_id=<id> --server_id=<id> | references/evs.md |
59
+ | Delete instance | hcloud ECS DeleteServers --servers.1.id=<id> --delete_publicip=true --delete_volume=true | references/create-instance.md |
60
+
61
+ ## How to Search for Instances
62
+
63
+ `ListServersDetails` supports `--name` for exact match only. For fuzzy search:
64
+
65
+ 1. List all instances: `hcloud ECS ListServersDetails --cli-region=<region> --limit=100`
66
+ 2. Filter client-side by name substring, tag, or status
67
+ 3. Use `--server_tags` filter if instances are tagged: `hcloud ECS ListServersDetails --server_tags.1.key=Project`
68
+
69
+ Abort if the result set is larger than `--limit` and ask the user to narrow the search.
70
+
71
+ ## Deleting Instances
72
+
73
+ - Show the user the exact command and get explicit approval before running
74
+ - By default, `--delete_publicip` and `--delete_volume` are **false** — public IP and system disk survive deletion
75
+ - Set both to `true` to avoid orphaned resources and unexpected billing
76
+ - Data disks ARE deleted by default (unlike system disk)
77
+
78
+ ## Troubleshooting
79
+
80
+ | Error | Root Cause -> Fix |
81
+ |-------|------------------|
82
+ | Cannot SSH | SG missing port 22 or no EIP -> Add ingress rule / Bind EIP |
83
+ | Flavor unavailable | Region limitation -> ListFlavors in target region |
84
+ | Insufficient resources | Stock depleted -> Change flavor or AZ |
85
+ | AuthFailure | Expired AK/SK -> hcloud configure init |
86
+ | APIGW.0802 / region permission | IAM user has no access to this region -> IAM console → User → Permissions → add region, or switch to another region |
87
+
88
+ ## Security Considerations
89
+
90
+ - MUST use security groups, not iptables
91
+ - MUST store SSH keys in DEW, never in user-data
92
+ - SHOULD enable CTS audit logging
93
+ - MUST NOT open 0.0.0.0/0 for SSH
94
+
95
+ ## MCP Tools
96
+
97
+ Prefer these tools over raw hcloud CLI — they enforce safety policies:
98
+
99
+ - huaweicloud_list_operations service=ECS
100
+ - huaweicloud_run_readonly_command for discovery (auto-redacts output)
101
+ - huaweicloud_run_approved_command for writes (requires exact command approval)
102
+ - huaweicloud_check_cli to verify hcloud is available
103
+
104
+ ## Without MCP (Fallback)
105
+
106
+ If MCP tools are NOT available (new install, session not restarted):
107
+ - Raw hcloud commands WILL appear in shell history — passwords and secrets are at risk
108
+ - Always use key_name instead of adminPass
109
+ - Verify safety manually: no secret value reads, no credential file access
110
+ - Restart session as soon as possible to enable safety policies
111
+
112
+ ## Without MCP
113
+
114
+ Fall back to hcloud CLI. State: "MCP unavailable, using local hcloud CLI."
115
+
116
+ ## Flexus (Lightweight ECS)
117
+
118
+ Flexus is the lightweight ECS family. Two variants:
119
+
120
+ | Variant | API | CLI | Billing |
121
+ |---------|-----|:---:|---------|
122
+ | **Flexus L** | HCSS (hcss:lightInstances) | ❌ No hcloud — Python SDK only | Prepaid only |
123
+ | **Flexus X** | Standard ECS API | ✅ `hcloud ECS` with `x1.*` flavors | On-demand & prepaid |
124
+
125
+ For Flexus X, use standard ECS CreateServers flow with `x1.*` flavors. For Flexus L, manual console provisioning is recommended — no KooCLI path exists.
126
+
127
+ ## References
128
+
129
+ - ECS Docs: https://support.huaweicloud.com/ecs/
130
+ - Flavor specs: references/flavors.md
131
+ - Create instance: references/create-instance.md