huaweicloud-devkit 0.1.21 → 0.1.25-dev.0
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.
- package/.agents/plugins/marketplace.json +20 -20
- package/LICENSE +201 -201
- package/README.md +169 -169
- package/bin/setup.cjs +7 -7
- package/integrations/opencode/commands/huaweicloud-doctor.md +14 -14
- package/integrations/opencode/opencode.json +14 -14
- package/integrations/opencode/skills/huaweicloud-core/SKILL.md +30 -30
- package/package.json +43 -43
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +43 -43
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +42 -42
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +43 -43
- package/plugins/huaweicloud-core/.mcp.json +13 -13
- package/plugins/huaweicloud-core/hooks/hooks.json +26 -26
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +88 -88
- package/plugins/huaweicloud-core/safety/policy.json +85 -85
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +144 -144
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +48 -48
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +50 -50
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +101 -101
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +73 -73
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +55 -55
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +70 -70
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +97 -97
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +29 -29
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +23 -23
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +131 -131
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +96 -96
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +28 -28
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +52 -52
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +132 -132
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +58 -58
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +71 -71
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +119 -119
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +142 -142
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +111 -111
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +65 -65
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +118 -118
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +26 -26
- package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +56 -56
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +181 -181
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +69 -69
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +78 -78
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +76 -76
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +59 -59
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +63 -63
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +47 -47
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +127 -127
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +93 -93
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +19 -19
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +27 -27
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +46 -46
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +83 -83
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +4 -4
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +265 -265
- package/plugins/huaweicloud-core/src/mcp-server.mjs +116 -93
- package/plugins/huaweicloud-core/src/safety-policy.mjs +289 -289
- package/plugins/huaweicloud-core/src/setup-cli.mjs +874 -869
- package/plugins/huaweicloud-core/src/tools.mjs +677 -677
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: huawei-vpc
|
|
3
|
-
description: "Use when creating, configuring, or managing VPC networks, subnets, security groups, EIPs, NAT gateways, VPN connections, or network ACLs on Huawei Cloud. Triggers on: VPC, subnet, security group, EIP, NAT, VPN, network ACL, route table, bandwidth. NOT for: DNS or CDN configuration."
|
|
4
|
-
version: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Huawei Cloud VPC
|
|
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 Virtual Private Cloud (VPC). Covers VPC/subnet lifecycle, security groups, EIP management, NAT gateways, VPN, and network ACLs.
|
|
16
|
-
|
|
17
|
-
## Critical Warnings
|
|
18
|
-
|
|
19
|
-
| Trap | Why |
|
|
20
|
-
|------|-----|
|
|
21
|
-
| VPC CIDR cannot change | Once set, VPC CIDR block is immutable |
|
|
22
|
-
| Security group stateful | SG rules are stateful. Return traffic auto-allowed |
|
|
23
|
-
| Network ACL stateless | ACL rules must allow both inbound AND outbound |
|
|
24
|
-
| EIP bills when idle | Unbound EIP still charges. Release when unused |
|
|
25
|
-
| Subnet AZ binding | Subnet tied to single AZ. Cross-AZ needs multiple subnets |
|
|
26
|
-
| EIP PER type needs `--bandwidth.name` | PER bandwidth requires explicit name; `--help` marks it optional but it's required |
|
|
27
|
-
| **VPC params need nested prefix** | KooCLI 7.x VPC API uses `--vpc.<param>`, `--subnet.<param>`, `--security_group.<param>`. Example: `--vpc.name=xxx` NOT `--name=xxx` |
|
|
28
|
-
| **Security group needs no vpc_id** | VPC v3 API `CreateSecurityGroup` does NOT accept `vpc_id`. Security groups are region-level, not VPC-bound |
|
|
29
|
-
| Subnet DNS empty → ECS no DNS | DNS params (`--subnet.primary_dns`, `--subnet.secondary_dns`) marked optional but empty default breaks cloud-init domain resolution — `yum`/`apt` installs fail silently. Always set both. See `--help` for region-specific DNS IPs |
|
|
30
|
-
|
|
31
|
-
## Common Workflows
|
|
32
|
-
|
|
33
|
-
| Task | Command | Steps |
|
|
34
|
-
|------|---------|-------|
|
|
35
|
-
| Create VPC | hcloud VPC CreateVpc --vpc.name=<name> --vpc.cidr=<cidr> | CIDR must not conflict with existing VPCs. Run `hcloud VPC ListVpcs` first |
|
|
36
|
-
| Create subnet | hcloud VPC CreateSubnet --subnet.name=<name> --subnet.vpc_id=<id> --subnet.cidr=<cidr> --subnet.gateway_ip=<gw> --subnet.primary_dns=<dns1> --subnet.secondary_dns=<dns2> --subnet.availability_zone=<az> | Subnet CIDR must be a subset of the VPC CIDR. DNS addresses vary by region — see `hcloud VPC CreateSubnet --help` |
|
|
37
|
-
| Security group | hcloud VPC CreateSecurityGroup --security_group.name=<name> | references/security-group.md |
|
|
38
|
-
| SG rule | hcloud VPC CreateSecurityGroupRule --security_group_rule.security_group_id=<id> --security_group_rule.direction=<direction> --security_group_rule.protocol=<protocol> --security_group_rule.multiport=<port> --security_group_rule.remote_ip_prefix=<cidr> | references/security-group.md |
|
|
39
|
-
| Create EIP | hcloud EIP CreatePublicip --publicip.type=<type> --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name> | Run `hcloud EIP CreatePublicip --help` to confirm valid type values per region |
|
|
40
|
-
| Bind EIP to ECS | 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` |
|
|
41
|
-
| Unbind EIP | hcloud EIP DisassociatePublicip --publicip_id=<id> | references/eip.md |
|
|
42
|
-
| Delete EIP | hcloud EIP DeletePublicip --publicip_id=<id> | references/eip.md |
|
|
43
|
-
| List EIPs | hcloud EIP ListPublicips | |
|
|
44
|
-
| NAT gateway | hcloud NAT CreateNatGateway --nat.name=<name> --nat.spec=<spec> --router_id=<vpc-id> --internal_network_id=<subnet-id> | Run `hcloud NAT CreateNatGateway --help` for available spec values |
|
|
45
|
-
|
|
46
|
-
## Troubleshooting
|
|
47
|
-
|
|
48
|
-
| Error | Root Cause -> Fix |
|
|
49
|
-
|-------|------------------|
|
|
50
|
-
| Cannot reach instance | SG missing rule or no EIP -> Add SG rule / Bind EIP |
|
|
51
|
-
| Subnet CIDR conflict | Overlapping with existing subnets -> Choose non-overlapping CIDR |
|
|
52
|
-
| NAT gateway no internet | Route table missing default route -> Add 0.0.0.0/0 via NAT |
|
|
53
|
-
| EIP quota exceeded | Check actual quota: `hcloud EIP ListPublicips --cli-region=<r>` to see current usage. Default varies by account (typically 5-10) |
|
|
54
|
-
| EIP.7905 | Run `hcloud EIP ListPublicips --cli-region=<r>` first to check current usage |
|
|
55
|
-
| VPC.0301: Bandwidth name invalid | PER type requires `--bandwidth.name`, even though `--help` marks it optional |
|
|
56
|
-
| EIP has no public IP after binding | May need AddIngressEipV2 for ELB-type resources (see huawei-apig) |
|
|
57
|
-
| ECS cloud-init fails silently (port 80/443 closed) | Subnet likely has no DNS. Check `hcloud VPC ShowSubnet --subnet_id=<id>` → `dnsList` empty? Rebuild subnet with `--subnet.primary_dns=<dns1> --subnet.secondary_dns=<dns2>`. DNS addresses per region: `hcloud VPC CreateSubnet --help` |
|
|
58
|
-
| SYS.0403 / SCP deny | Service Control Policy explicitly denies this operation — contact org admin to adjust SCP, or use an account/region without the restriction |
|
|
59
|
-
|
|
60
|
-
## Security Considerations
|
|
61
|
-
|
|
62
|
-
- MUST use security groups, NOT iptables
|
|
63
|
-
- MUST scope SG rules to specific CIDRs, NOT 0.0.0.0/0
|
|
64
|
-
- SHOULD use network ACLs as defense-in-depth
|
|
65
|
-
- SHOULD place databases in private subnets (no EIP)
|
|
66
|
-
- MUST enable VPC flow logs for audit
|
|
67
|
-
|
|
68
|
-
## MCP Tools
|
|
69
|
-
|
|
70
|
-
- huaweicloud_list_operations service=VPC
|
|
71
|
-
- huaweicloud_run_readonly_command for VPC/subnet discovery
|
|
72
|
-
- huaweicloud_run_approved_command for writes
|
|
73
|
-
|
|
74
|
-
## References
|
|
75
|
-
|
|
76
|
-
- VPC Docs: https://support.huaweicloud.com/vpc/
|
|
77
|
-
- Subnet guide: references/subnet.md
|
|
78
|
-
- Security group: references/security-group.md
|
|
1
|
+
---
|
|
2
|
+
name: huawei-vpc
|
|
3
|
+
description: "Use when creating, configuring, or managing VPC networks, subnets, security groups, EIPs, NAT gateways, VPN connections, or network ACLs on Huawei Cloud. Triggers on: VPC, subnet, security group, EIP, NAT, VPN, network ACL, route table, bandwidth. NOT for: DNS or CDN configuration."
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Huawei Cloud VPC
|
|
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 Virtual Private Cloud (VPC). Covers VPC/subnet lifecycle, security groups, EIP management, NAT gateways, VPN, and network ACLs.
|
|
16
|
+
|
|
17
|
+
## Critical Warnings
|
|
18
|
+
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
|------|-----|
|
|
21
|
+
| VPC CIDR cannot change | Once set, VPC CIDR block is immutable |
|
|
22
|
+
| Security group stateful | SG rules are stateful. Return traffic auto-allowed |
|
|
23
|
+
| Network ACL stateless | ACL rules must allow both inbound AND outbound |
|
|
24
|
+
| EIP bills when idle | Unbound EIP still charges. Release when unused |
|
|
25
|
+
| Subnet AZ binding | Subnet tied to single AZ. Cross-AZ needs multiple subnets |
|
|
26
|
+
| EIP PER type needs `--bandwidth.name` | PER bandwidth requires explicit name; `--help` marks it optional but it's required |
|
|
27
|
+
| **VPC params need nested prefix** | KooCLI 7.x VPC API uses `--vpc.<param>`, `--subnet.<param>`, `--security_group.<param>`. Example: `--vpc.name=xxx` NOT `--name=xxx` |
|
|
28
|
+
| **Security group needs no vpc_id** | VPC v3 API `CreateSecurityGroup` does NOT accept `vpc_id`. Security groups are region-level, not VPC-bound |
|
|
29
|
+
| Subnet DNS empty → ECS no DNS | DNS params (`--subnet.primary_dns`, `--subnet.secondary_dns`) marked optional but empty default breaks cloud-init domain resolution — `yum`/`apt` installs fail silently. Always set both. See `--help` for region-specific DNS IPs |
|
|
30
|
+
|
|
31
|
+
## Common Workflows
|
|
32
|
+
|
|
33
|
+
| Task | Command | Steps |
|
|
34
|
+
|------|---------|-------|
|
|
35
|
+
| Create VPC | hcloud VPC CreateVpc --vpc.name=<name> --vpc.cidr=<cidr> | CIDR must not conflict with existing VPCs. Run `hcloud VPC ListVpcs` first |
|
|
36
|
+
| Create subnet | hcloud VPC CreateSubnet --subnet.name=<name> --subnet.vpc_id=<id> --subnet.cidr=<cidr> --subnet.gateway_ip=<gw> --subnet.primary_dns=<dns1> --subnet.secondary_dns=<dns2> --subnet.availability_zone=<az> | Subnet CIDR must be a subset of the VPC CIDR. DNS addresses vary by region — see `hcloud VPC CreateSubnet --help` |
|
|
37
|
+
| Security group | hcloud VPC CreateSecurityGroup --security_group.name=<name> | references/security-group.md |
|
|
38
|
+
| SG rule | hcloud VPC CreateSecurityGroupRule --security_group_rule.security_group_id=<id> --security_group_rule.direction=<direction> --security_group_rule.protocol=<protocol> --security_group_rule.multiport=<port> --security_group_rule.remote_ip_prefix=<cidr> | references/security-group.md |
|
|
39
|
+
| Create EIP | hcloud EIP CreatePublicip --publicip.type=<type> --bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name> | Run `hcloud EIP CreatePublicip --help` to confirm valid type values per region |
|
|
40
|
+
| Bind EIP to ECS | 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` |
|
|
41
|
+
| Unbind EIP | hcloud EIP DisassociatePublicip --publicip_id=<id> | references/eip.md |
|
|
42
|
+
| Delete EIP | hcloud EIP DeletePublicip --publicip_id=<id> | references/eip.md |
|
|
43
|
+
| List EIPs | hcloud EIP ListPublicips | |
|
|
44
|
+
| NAT gateway | hcloud NAT CreateNatGateway --nat.name=<name> --nat.spec=<spec> --router_id=<vpc-id> --internal_network_id=<subnet-id> | Run `hcloud NAT CreateNatGateway --help` for available spec values |
|
|
45
|
+
|
|
46
|
+
## Troubleshooting
|
|
47
|
+
|
|
48
|
+
| Error | Root Cause -> Fix |
|
|
49
|
+
|-------|------------------|
|
|
50
|
+
| Cannot reach instance | SG missing rule or no EIP -> Add SG rule / Bind EIP |
|
|
51
|
+
| Subnet CIDR conflict | Overlapping with existing subnets -> Choose non-overlapping CIDR |
|
|
52
|
+
| NAT gateway no internet | Route table missing default route -> Add 0.0.0.0/0 via NAT |
|
|
53
|
+
| EIP quota exceeded | Check actual quota: `hcloud EIP ListPublicips --cli-region=<r>` to see current usage. Default varies by account (typically 5-10) |
|
|
54
|
+
| EIP.7905 | Run `hcloud EIP ListPublicips --cli-region=<r>` first to check current usage |
|
|
55
|
+
| VPC.0301: Bandwidth name invalid | PER type requires `--bandwidth.name`, even though `--help` marks it optional |
|
|
56
|
+
| EIP has no public IP after binding | May need AddIngressEipV2 for ELB-type resources (see huawei-apig) |
|
|
57
|
+
| ECS cloud-init fails silently (port 80/443 closed) | Subnet likely has no DNS. Check `hcloud VPC ShowSubnet --subnet_id=<id>` → `dnsList` empty? Rebuild subnet with `--subnet.primary_dns=<dns1> --subnet.secondary_dns=<dns2>`. DNS addresses per region: `hcloud VPC CreateSubnet --help` |
|
|
58
|
+
| SYS.0403 / SCP deny | Service Control Policy explicitly denies this operation — contact org admin to adjust SCP, or use an account/region without the restriction |
|
|
59
|
+
|
|
60
|
+
## Security Considerations
|
|
61
|
+
|
|
62
|
+
- MUST use security groups, NOT iptables
|
|
63
|
+
- MUST scope SG rules to specific CIDRs, NOT 0.0.0.0/0
|
|
64
|
+
- SHOULD use network ACLs as defense-in-depth
|
|
65
|
+
- SHOULD place databases in private subnets (no EIP)
|
|
66
|
+
- MUST enable VPC flow logs for audit
|
|
67
|
+
|
|
68
|
+
## MCP Tools
|
|
69
|
+
|
|
70
|
+
- huaweicloud_list_operations service=VPC
|
|
71
|
+
- huaweicloud_run_readonly_command for VPC/subnet discovery
|
|
72
|
+
- huaweicloud_run_approved_command for writes
|
|
73
|
+
|
|
74
|
+
## References
|
|
75
|
+
|
|
76
|
+
- VPC Docs: https://support.huaweicloud.com/vpc/
|
|
77
|
+
- Subnet guide: references/subnet.md
|
|
78
|
+
- Security group: references/security-group.md
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
# VPC Network Management Reference
|
|
2
|
-
|
|
3
|
-
## DNS Addresses by Region
|
|
4
|
-
|
|
5
|
-
Subnets without DNS configuration will fail cloud-init. Use these DNS addresses:
|
|
6
|
-
|
|
7
|
-
| Region | Primary DNS | Secondary DNS |
|
|
8
|
-
|--------|------------|---------------|
|
|
9
|
-
| cn-north-1 | 100.125.1.250 | 100.125.129.250 |
|
|
10
|
-
| cn-north-4 | 100.125.1.250 | 100.125.129.250 |
|
|
11
|
-
| cn-east-3 | 100.125.1.250 | 100.125.129.250 |
|
|
12
|
-
| cn-south-1 | 100.125.1.250 | 100.125.129.250 |
|
|
13
|
-
| ap-southeast-3 | 100.125.1.250 | 100.125.129.250 |
|
|
14
|
-
|
|
15
|
-
**Subnet create with DNS**:
|
|
16
|
-
```bash
|
|
17
|
-
hcloud VPC CreateSubnet \
|
|
18
|
-
--subnet.name=<name> \
|
|
19
|
-
--subnet.vpc_id=<id> \
|
|
20
|
-
--subnet.cidr=10.50.1.0/24 \
|
|
21
|
-
--subnet.gateway_ip=10.50.1.1 \
|
|
22
|
-
--subnet.availability_zone=<az> \
|
|
23
|
-
--subnet.dnsList.1=100.125.1.250 \
|
|
24
|
-
--subnet.dnsList.2=100.125.129.250
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Nested Prefix Summary
|
|
28
|
-
|
|
29
|
-
KooCLI 7.x VPC API requires nested prefixes:
|
|
30
|
-
|
|
31
|
-
| Resource | Create Param Prefix | Example |
|
|
32
|
-
|----------|---------------------|---------|
|
|
33
|
-
| VPC | `--vpc.` | `--vpc.name=my-vpc --vpc.cidr=192.168.0.0/16` |
|
|
34
|
-
| Subnet | `--subnet.` | `--subnet.name=web --subnet.vpc_id=<id> --subnet.cidr=192.168.1.0/24` |
|
|
35
|
-
| Security Group | `--security_group.` | `--security_group.name=sg-web` |
|
|
36
|
-
| SG Rule | `--security_group_rule.` | `--security_group_rule.direction=ingress` |
|
|
37
|
-
|
|
38
|
-
## EIP Management
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
# Create EIP (pay-per-use)
|
|
42
|
-
hcloud EIP CreatePublicip --publicip.type=<type> \
|
|
43
|
-
--bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
|
|
44
|
-
|
|
45
|
-
# Bind to ECS (PORT type, not ECS)
|
|
46
|
-
hcloud EIP AssociatePublicips --publicip_id=<id> \
|
|
47
|
-
--publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
|
|
48
|
-
|
|
49
|
-
# Unbind
|
|
50
|
-
hcloud EIP DisassociatePublicip --publicip_id=<id>
|
|
51
|
-
|
|
52
|
-
# List
|
|
53
|
-
hcloud EIP ListPublicips
|
|
54
|
-
|
|
55
|
-
# Delete (unbind first)
|
|
56
|
-
hcloud EIP DeletePublicip --publicip_id=<id>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
> EIP bills even when not bound. Release unused EIPs.
|
|
60
|
-
|
|
61
|
-
## Security Group Quick Reference
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# Create SG (no vpc_id needed)
|
|
65
|
-
hcloud VPC CreateSecurityGroup --security_group.name=<name>
|
|
66
|
-
|
|
67
|
-
# Add SSH rule
|
|
68
|
-
hcloud VPC CreateSecurityGroupRule \
|
|
69
|
-
--security_group_rule.security_group_id=<sg-id> \
|
|
70
|
-
--security_group_rule.direction=<direction> \
|
|
71
|
-
--security_group_rule.protocol=<protocol> \
|
|
72
|
-
--security_group_rule.multiport=<port> \
|
|
73
|
-
--security_group_rule.remote_ip_prefix=<cidr>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
> SG is stateful — return traffic auto-allowed. Network ACL is stateless — need both directions.
|
|
1
|
+
# VPC Network Management Reference
|
|
2
|
+
|
|
3
|
+
## DNS Addresses by Region
|
|
4
|
+
|
|
5
|
+
Subnets without DNS configuration will fail cloud-init. Use these DNS addresses:
|
|
6
|
+
|
|
7
|
+
| Region | Primary DNS | Secondary DNS |
|
|
8
|
+
|--------|------------|---------------|
|
|
9
|
+
| cn-north-1 | 100.125.1.250 | 100.125.129.250 |
|
|
10
|
+
| cn-north-4 | 100.125.1.250 | 100.125.129.250 |
|
|
11
|
+
| cn-east-3 | 100.125.1.250 | 100.125.129.250 |
|
|
12
|
+
| cn-south-1 | 100.125.1.250 | 100.125.129.250 |
|
|
13
|
+
| ap-southeast-3 | 100.125.1.250 | 100.125.129.250 |
|
|
14
|
+
|
|
15
|
+
**Subnet create with DNS**:
|
|
16
|
+
```bash
|
|
17
|
+
hcloud VPC CreateSubnet \
|
|
18
|
+
--subnet.name=<name> \
|
|
19
|
+
--subnet.vpc_id=<id> \
|
|
20
|
+
--subnet.cidr=10.50.1.0/24 \
|
|
21
|
+
--subnet.gateway_ip=10.50.1.1 \
|
|
22
|
+
--subnet.availability_zone=<az> \
|
|
23
|
+
--subnet.dnsList.1=100.125.1.250 \
|
|
24
|
+
--subnet.dnsList.2=100.125.129.250
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Nested Prefix Summary
|
|
28
|
+
|
|
29
|
+
KooCLI 7.x VPC API requires nested prefixes:
|
|
30
|
+
|
|
31
|
+
| Resource | Create Param Prefix | Example |
|
|
32
|
+
|----------|---------------------|---------|
|
|
33
|
+
| VPC | `--vpc.` | `--vpc.name=my-vpc --vpc.cidr=192.168.0.0/16` |
|
|
34
|
+
| Subnet | `--subnet.` | `--subnet.name=web --subnet.vpc_id=<id> --subnet.cidr=192.168.1.0/24` |
|
|
35
|
+
| Security Group | `--security_group.` | `--security_group.name=sg-web` |
|
|
36
|
+
| SG Rule | `--security_group_rule.` | `--security_group_rule.direction=ingress` |
|
|
37
|
+
|
|
38
|
+
## EIP Management
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Create EIP (pay-per-use)
|
|
42
|
+
hcloud EIP CreatePublicip --publicip.type=<type> \
|
|
43
|
+
--bandwidth.size=<size> --bandwidth.share_type=<share-type> --bandwidth.name=<name>
|
|
44
|
+
|
|
45
|
+
# Bind to ECS (PORT type, not ECS)
|
|
46
|
+
hcloud EIP AssociatePublicips --publicip_id=<id> \
|
|
47
|
+
--publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
|
|
48
|
+
|
|
49
|
+
# Unbind
|
|
50
|
+
hcloud EIP DisassociatePublicip --publicip_id=<id>
|
|
51
|
+
|
|
52
|
+
# List
|
|
53
|
+
hcloud EIP ListPublicips
|
|
54
|
+
|
|
55
|
+
# Delete (unbind first)
|
|
56
|
+
hcloud EIP DeletePublicip --publicip_id=<id>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> EIP bills even when not bound. Release unused EIPs.
|
|
60
|
+
|
|
61
|
+
## Security Group Quick Reference
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Create SG (no vpc_id needed)
|
|
65
|
+
hcloud VPC CreateSecurityGroup --security_group.name=<name>
|
|
66
|
+
|
|
67
|
+
# Add SSH rule
|
|
68
|
+
hcloud VPC CreateSecurityGroupRule \
|
|
69
|
+
--security_group_rule.security_group_id=<sg-id> \
|
|
70
|
+
--security_group_rule.direction=<direction> \
|
|
71
|
+
--security_group_rule.protocol=<protocol> \
|
|
72
|
+
--security_group_rule.multiport=<port> \
|
|
73
|
+
--security_group_rule.remote_ip_prefix=<cidr>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
> SG is stateful — return traffic auto-allowed. Network ACL is stateless — need both directions.
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
# Security Group Rules
|
|
2
|
-
|
|
3
|
-
## Security Group is NOT bound to VPC
|
|
4
|
-
|
|
5
|
-
VPC v3 API `CreateSecurityGroup` does NOT accept a `vpc_id` parameter. Security groups are region-level resources, not VPC-bound. They work across any VPC in the same region.
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# CORRECT — no vpc_id needed
|
|
9
|
-
hcloud VPC CreateSecurityGroup --security_group.name=<name>
|
|
10
|
-
|
|
11
|
-
# WRONG
|
|
12
|
-
hcloud VPC CreateSecurityGroup --security_group.vpc_id=<vpc-id>
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## KooCLI 7.x Nested Parameter Format
|
|
16
|
-
|
|
17
|
-
Security group params use `--security_group.` prefix. Rules use `--security_group_rule.` prefix.
|
|
18
|
-
|
|
19
|
-
## Create Security Group Rule
|
|
20
|
-
|
|
21
|
-
Complete example with nested prefix:
|
|
22
|
-
```bash
|
|
23
|
-
hcloud VPC CreateSecurityGroupRule \
|
|
24
|
-
--security_group_rule.security_group_id=<sg-id> \
|
|
25
|
-
--security_group_rule.direction=<direction> \
|
|
26
|
-
--security_group_rule.protocol=<protocol> \
|
|
27
|
-
--security_group_rule.multiport=<port> \
|
|
28
|
-
--security_group_rule.remote_ip_prefix=<cidr>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
> Always run `hcloud VPC CreateSecurityGroupRule --help` to verify param names.
|
|
32
|
-
|
|
33
|
-
## Stateful vs Stateless
|
|
34
|
-
|
|
35
|
-
| Feature | Security Group | Network ACL |
|
|
36
|
-
|---------|---------------|-------------|
|
|
37
|
-
| Stateful? | Yes — return traffic auto-allowed | No — must allow both directions |
|
|
38
|
-
| Applied to | ECS instance NIC | Subnet |
|
|
39
|
-
| Rules | Allow only | Allow and Deny |
|
|
40
|
-
| Default | Deny all inbound, allow all outbound | Allow all |
|
|
41
|
-
|
|
42
|
-
## Common Rules Reference
|
|
43
|
-
|
|
44
|
-
| Direction | Protocol | Port | Source | Purpose |
|
|
45
|
-
|-----------|----------|------|--------|---------|
|
|
46
|
-
| Ingress | TCP | 22 | <office-ip>/32 | SSH |
|
|
47
|
-
| Ingress | TCP | 80 | 0.0.0.0/0 | HTTP |
|
|
48
|
-
| Ingress | TCP | 443 | 0.0.0.0/0 | HTTPS |
|
|
49
|
-
| Ingress | TCP | 3306 | <sg-app-id> | MySQL from app |
|
|
50
|
-
| Ingress | TCP | 6379 | <sg-app-id> | Redis from app |
|
|
51
|
-
| Egress | ALL | ALL | 0.0.0.0/0 | Outbound default |
|
|
52
|
-
|
|
53
|
-
## Common Errors
|
|
54
|
-
|
|
55
|
-
| Error | Root Cause -> Fix |
|
|
56
|
-
|-------|-------------------|
|
|
57
|
-
| Cannot SSH | Default SG denies all inbound. Add port 22 rule |
|
|
58
|
-
| Rule not effective | SG assigned to wrong instance. Verify NIC attachment |
|
|
59
|
-
| `[USE_ERROR]不正确的参数:vpc_id` | Security groups don't need vpc_id. Remove it |
|
|
1
|
+
# Security Group Rules
|
|
2
|
+
|
|
3
|
+
## Security Group is NOT bound to VPC
|
|
4
|
+
|
|
5
|
+
VPC v3 API `CreateSecurityGroup` does NOT accept a `vpc_id` parameter. Security groups are region-level resources, not VPC-bound. They work across any VPC in the same region.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# CORRECT — no vpc_id needed
|
|
9
|
+
hcloud VPC CreateSecurityGroup --security_group.name=<name>
|
|
10
|
+
|
|
11
|
+
# WRONG
|
|
12
|
+
hcloud VPC CreateSecurityGroup --security_group.vpc_id=<vpc-id>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## KooCLI 7.x Nested Parameter Format
|
|
16
|
+
|
|
17
|
+
Security group params use `--security_group.` prefix. Rules use `--security_group_rule.` prefix.
|
|
18
|
+
|
|
19
|
+
## Create Security Group Rule
|
|
20
|
+
|
|
21
|
+
Complete example with nested prefix:
|
|
22
|
+
```bash
|
|
23
|
+
hcloud VPC CreateSecurityGroupRule \
|
|
24
|
+
--security_group_rule.security_group_id=<sg-id> \
|
|
25
|
+
--security_group_rule.direction=<direction> \
|
|
26
|
+
--security_group_rule.protocol=<protocol> \
|
|
27
|
+
--security_group_rule.multiport=<port> \
|
|
28
|
+
--security_group_rule.remote_ip_prefix=<cidr>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> Always run `hcloud VPC CreateSecurityGroupRule --help` to verify param names.
|
|
32
|
+
|
|
33
|
+
## Stateful vs Stateless
|
|
34
|
+
|
|
35
|
+
| Feature | Security Group | Network ACL |
|
|
36
|
+
|---------|---------------|-------------|
|
|
37
|
+
| Stateful? | Yes — return traffic auto-allowed | No — must allow both directions |
|
|
38
|
+
| Applied to | ECS instance NIC | Subnet |
|
|
39
|
+
| Rules | Allow only | Allow and Deny |
|
|
40
|
+
| Default | Deny all inbound, allow all outbound | Allow all |
|
|
41
|
+
|
|
42
|
+
## Common Rules Reference
|
|
43
|
+
|
|
44
|
+
| Direction | Protocol | Port | Source | Purpose |
|
|
45
|
+
|-----------|----------|------|--------|---------|
|
|
46
|
+
| Ingress | TCP | 22 | <office-ip>/32 | SSH |
|
|
47
|
+
| Ingress | TCP | 80 | 0.0.0.0/0 | HTTP |
|
|
48
|
+
| Ingress | TCP | 443 | 0.0.0.0/0 | HTTPS |
|
|
49
|
+
| Ingress | TCP | 3306 | <sg-app-id> | MySQL from app |
|
|
50
|
+
| Ingress | TCP | 6379 | <sg-app-id> | Redis from app |
|
|
51
|
+
| Egress | ALL | ALL | 0.0.0.0/0 | Outbound default |
|
|
52
|
+
|
|
53
|
+
## Common Errors
|
|
54
|
+
|
|
55
|
+
| Error | Root Cause -> Fix |
|
|
56
|
+
|-------|-------------------|
|
|
57
|
+
| Cannot SSH | Default SG denies all inbound. Add port 22 rule |
|
|
58
|
+
| Rule not effective | SG assigned to wrong instance. Verify NIC attachment |
|
|
59
|
+
| `[USE_ERROR]不正确的参数:vpc_id` | Security groups don't need vpc_id. Remove it |
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: huawei-waf-aad
|
|
3
|
-
description: "Use when configuring Web Application Firewall (WAF) policies/rules, or Anti-DDoS (AAD) protection on Huawei Cloud. Triggers: WAF, AAD, firewall, DDoS, web protection, IP blacklist, rate limiting, CC attack. NOT for: security groups (use huawei-vpc), CTS audit (use huawei-cts)."
|
|
4
|
-
version: 1
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Huawei Cloud WAF / AAD
|
|
8
|
-
|
|
9
|
-
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
-
|
|
11
|
-
Always run `hcloud WAF <Operation> --help` before constructing commands to discover exact parameter names and requirements. For AAD operations, use `hcloud AAD --help`.
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
Domain expertise for WAF and Anti-DDoS. Covers WAF policy/rules, AAD protection, IP whitelist/blacklist, and rate limiting.
|
|
16
|
-
|
|
17
|
-
## Critical Warnings
|
|
18
|
-
|
|
19
|
-
| Trap | Why |
|
|
20
|
-
|------|-----|
|
|
21
|
-
| WAF needs CNAME redirect | DNS must point to WAF endpoint, not server IP |
|
|
22
|
-
| Premium instance required | Cloud WAF needs a dedicated/premium WAF instance |
|
|
23
|
-
| AAD Standard vs Enterprise | Standard protects single IP. Enterprise protects entire IP ranges |
|
|
24
|
-
| Rule order matters | WAF rules evaluated top-to-bottom within a policy |
|
|
25
|
-
|
|
26
|
-
## Common Workflows
|
|
27
|
-
|
|
28
|
-
### WAF
|
|
29
|
-
|
|
30
|
-
| Task | Operation |
|
|
31
|
-
|------|-----------|
|
|
32
|
-
| List WAF instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
33
|
-
| List policies | `ListPolicies --cli-region=<r> --project_id=<p>` |
|
|
34
|
-
| Create custom rule | `BatchCreateCustomRule --cli-region=<r> --project_id=<p>` |
|
|
35
|
-
| Create IP blacklist | `BatchCreateWhiteblackipRule --cli-region=<r> --project_id=<p>` |
|
|
36
|
-
| Create CC rule | `BatchCreateCcRule --cli-region=<r> --project_id=<p>` |
|
|
37
|
-
| Create geo rule | `BatchCreateGeoIpRule --cli-region=<r> --project_id=<p>` |
|
|
38
|
-
|
|
39
|
-
### AAD
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
hcloud AAD ListInstances --cli-region=<r> --project_id=<p>
|
|
43
|
-
hcloud AAD CreateInstance --cli-region=<r> --project_id=<p>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Troubleshooting
|
|
47
|
-
|
|
48
|
-
| Error | Fix |
|
|
49
|
-
|-------|-----|
|
|
50
|
-
| Website unreachable after WAF | Check CNAME record points to WAF endpoint |
|
|
51
|
-
| WAF blocking legitimate traffic | Check rules order, adjust false positive settings |
|
|
52
|
-
| AAD not responding | Standard AAD only protects single EIP. Check EIP binding |
|
|
53
|
-
|
|
54
|
-
## Security
|
|
55
|
-
|
|
56
|
-
- MUST use WAF for all public-facing web applications
|
|
57
|
-
- SHOULD enable AAD for DDoS protection
|
|
58
|
-
- MUST test WAF rules in report-only mode before blocking
|
|
59
|
-
|
|
60
|
-
## Cross-Skill References
|
|
61
|
-
|
|
62
|
-
- **EIP**: See `huawei-vpc` for elastic IP binding
|
|
63
|
-
- **DNS/CNAME**: Configure via your DNS provider
|
|
1
|
+
---
|
|
2
|
+
name: huawei-waf-aad
|
|
3
|
+
description: "Use when configuring Web Application Firewall (WAF) policies/rules, or Anti-DDoS (AAD) protection on Huawei Cloud. Triggers: WAF, AAD, firewall, DDoS, web protection, IP blacklist, rate limiting, CC attack. NOT for: security groups (use huawei-vpc), CTS audit (use huawei-cts)."
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Huawei Cloud WAF / AAD
|
|
8
|
+
|
|
9
|
+
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
|
+
|
|
11
|
+
Always run `hcloud WAF <Operation> --help` before constructing commands to discover exact parameter names and requirements. For AAD operations, use `hcloud AAD --help`.
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Domain expertise for WAF and Anti-DDoS. Covers WAF policy/rules, AAD protection, IP whitelist/blacklist, and rate limiting.
|
|
16
|
+
|
|
17
|
+
## Critical Warnings
|
|
18
|
+
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
|------|-----|
|
|
21
|
+
| WAF needs CNAME redirect | DNS must point to WAF endpoint, not server IP |
|
|
22
|
+
| Premium instance required | Cloud WAF needs a dedicated/premium WAF instance |
|
|
23
|
+
| AAD Standard vs Enterprise | Standard protects single IP. Enterprise protects entire IP ranges |
|
|
24
|
+
| Rule order matters | WAF rules evaluated top-to-bottom within a policy |
|
|
25
|
+
|
|
26
|
+
## Common Workflows
|
|
27
|
+
|
|
28
|
+
### WAF
|
|
29
|
+
|
|
30
|
+
| Task | Operation |
|
|
31
|
+
|------|-----------|
|
|
32
|
+
| List WAF instances | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
33
|
+
| List policies | `ListPolicies --cli-region=<r> --project_id=<p>` |
|
|
34
|
+
| Create custom rule | `BatchCreateCustomRule --cli-region=<r> --project_id=<p>` |
|
|
35
|
+
| Create IP blacklist | `BatchCreateWhiteblackipRule --cli-region=<r> --project_id=<p>` |
|
|
36
|
+
| Create CC rule | `BatchCreateCcRule --cli-region=<r> --project_id=<p>` |
|
|
37
|
+
| Create geo rule | `BatchCreateGeoIpRule --cli-region=<r> --project_id=<p>` |
|
|
38
|
+
|
|
39
|
+
### AAD
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
hcloud AAD ListInstances --cli-region=<r> --project_id=<p>
|
|
43
|
+
hcloud AAD CreateInstance --cli-region=<r> --project_id=<p>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Troubleshooting
|
|
47
|
+
|
|
48
|
+
| Error | Fix |
|
|
49
|
+
|-------|-----|
|
|
50
|
+
| Website unreachable after WAF | Check CNAME record points to WAF endpoint |
|
|
51
|
+
| WAF blocking legitimate traffic | Check rules order, adjust false positive settings |
|
|
52
|
+
| AAD not responding | Standard AAD only protects single EIP. Check EIP binding |
|
|
53
|
+
|
|
54
|
+
## Security
|
|
55
|
+
|
|
56
|
+
- MUST use WAF for all public-facing web applications
|
|
57
|
+
- SHOULD enable AAD for DDoS protection
|
|
58
|
+
- MUST test WAF rules in report-only mode before blocking
|
|
59
|
+
|
|
60
|
+
## Cross-Skill References
|
|
61
|
+
|
|
62
|
+
- **EIP**: See `huawei-vpc` for elastic IP binding
|
|
63
|
+
- **DNS/CNAME**: Configure via your DNS provider
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface:
|
|
2
|
-
display_name: "Huawei Cloud API And SDK"
|
|
3
|
-
short_description: "Build correct Huawei Cloud API requests and SDK integrations."
|
|
4
|
-
default_prompt: "Use $huaweicloud-api-and-sdk to plan this Huawei Cloud API or SDK integration."
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Huawei Cloud API And SDK"
|
|
3
|
+
short_description: "Build correct Huawei Cloud API requests and SDK integrations."
|
|
4
|
+
default_prompt: "Use $huaweicloud-api-and-sdk to plan this Huawei Cloud API or SDK integration."
|