huaweicloud-devkit 1.1.2-next.0 → 1.1.2-next.2
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 +18 -18
- package/README.md +182 -38
- package/README.zh-CN.md +180 -36
- package/bin/dsh-postinstall.cjs +77 -0
- package/bin/setup.cjs +7 -4
- package/cordis.patch.yml +13 -0
- package/integrations/atomcode/hooks/huaweicloud-telemetry.js +181 -0
- package/integrations/atomcode/hooks.json +9 -0
- package/integrations/dsh/hook-plugin.mjs +148 -0
- package/integrations/hermes/hooks/huaweicloud-telemetry.py +238 -0
- package/integrations/hermes/manifest.yaml +43 -0
- package/integrations/opencode/hooks/skill-tracker.js +115 -0
- package/integrations/opencode/opencode.json +1 -4
- package/integrations/workbuddy/hooks/telemetry-tracker.py +226 -0
- package/package.json +74 -43
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +23 -33
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +4 -17
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +30 -0
- package/plugins/huaweicloud-core/.mcp.json +2 -5
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +4 -18
- package/plugins/huaweicloud-core/assets/icon.png +0 -0
- package/plugins/huaweicloud-core/assets/logo-dark.png +0 -0
- package/plugins/huaweicloud-core/assets/logo.png +0 -0
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +104 -28
- package/plugins/huaweicloud-core/openclaw.plugin.json +20 -0
- package/plugins/huaweicloud-core/safety/policy.json +75 -99
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +196 -35
- package/plugins/huaweicloud-core/skills/huawei-apig/SKILL.md +38 -34
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +38 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-cts/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-dds-dcs/SKILL.md +31 -31
- package/plugins/huaweicloud-core/skills/huawei-deployment/SKILL.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-dew/SKILL.md +40 -31
- package/plugins/huaweicloud-core/skills/huawei-dew/references/csms-usage.md +8 -1
- package/plugins/huaweicloud-core/skills/huawei-dew/references/kms-usage.md +6 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +45 -37
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +57 -6
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/hc-activity.md +27 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +13 -13
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +44 -39
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +12 -10
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +21 -20
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-gaussdb/SKILL.md +20 -20
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +27 -23
- package/plugins/huaweicloud-core/skills/huawei-iac/SKILL.md +93 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/architectures.md +83 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/resource-catalog.md +107 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/state-file.md +104 -0
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +30 -30
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +65 -39
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +9 -9
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +33 -25
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +46 -45
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +19 -19
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +12 -7
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +13 -12
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +4 -4
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +71 -61
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +776 -44
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +84 -0
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +100 -0
- package/plugins/huaweicloud-core/skills/huawei-smn-dms/SKILL.md +36 -29
- package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +57 -0
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +39 -39
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +22 -15
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +20 -19
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +15 -15
- package/plugins/huaweicloud-core/skills/huawei-waf-aad/SKILL.md +23 -20
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +13 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +21 -2
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +30 -4
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +68 -54
- package/plugins/huaweicloud-core/skills/huaweicloud-core/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +6 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +15 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +0 -1
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +36 -34
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/agents/openai.yaml +3 -3
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +142 -5
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +217 -5
- package/plugins/huaweicloud-core/src/auth/reconcile.mjs +174 -0
- package/plugins/huaweicloud-core/src/auth/service.mjs +57 -2
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/src/detect-framework.mjs +366 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +203 -16
- package/plugins/huaweicloud-core/src/icon-library.mjs +176 -0
- package/plugins/huaweicloud-core/src/mcp-protocol.mjs +88 -0
- package/plugins/huaweicloud-core/src/mcp-server-remote.mjs +107 -0
- package/plugins/huaweicloud-core/src/mcp-server.mjs +154 -99
- package/plugins/huaweicloud-core/src/proxy/proxy-agent.mjs +20 -102
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +11 -4
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +4 -1
- package/plugins/huaweicloud-core/src/safety-policy.mjs +123 -68
- package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +48 -12
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +25 -26
- package/plugins/huaweicloud-core/src/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +943 -10
- package/plugins/huaweicloud-core/src/sandbox/uninstall-cleanup.mjs +50 -0
- package/plugins/huaweicloud-core/src/search-market.mjs +49 -14
- package/plugins/huaweicloud-core/src/setup-cli.mjs +3091 -498
- package/plugins/huaweicloud-core/src/telemetry/agent-detect.mjs +40 -0
- package/plugins/huaweicloud-core/src/telemetry/agent-registry.mjs +328 -0
- package/plugins/huaweicloud-core/src/telemetry/telemetry.mjs +378 -0
- package/plugins/huaweicloud-core/src/tools.mjs +1272 -146
- package/plugins/huaweicloud-core/src/update-check.mjs +383 -0
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +72 -38
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-fair-queue.js +10 -5
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-multiplexer.js +13 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-packet.js +12 -16
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-terminal-channel.js +46 -31
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-tunnel-channel.mjs +268 -0
- package/plugins/huaweicloud-core/src/ws-exec/index.js +3 -0
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +40 -13
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/SKILL.md +0 -190
- package/plugins/huaweicloud-core/skills/huawei-cloud-find-skills/scripts/search-skills.mjs +0 -124
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Framework Command Mapping
|
|
2
|
+
|
|
3
|
+
Maps web frameworks to install, build, serve commands and output directories for sandbox deployment.
|
|
4
|
+
|
|
5
|
+
## Architecture Compatibility
|
|
6
|
+
|
|
7
|
+
The sandbox runs **HCE OS on aarch64**. Frameworks that depend on native binaries (e.g., `@swc/core`, `esbuild`, `sharp`, `prisma`) may fail to install or build inside the sandbox since prebuilt binaries target x86_64 by default.
|
|
8
|
+
|
|
9
|
+
**Recommended strategy**: build locally (x86_64) then upload the dist output to the sandbox for serving.
|
|
10
|
+
|
|
11
|
+
| Dependency | Frameworks Affected | Mitigation |
|
|
12
|
+
| ---------------- | ------------------------ | ------------------------------------- |
|
|
13
|
+
| `@swc/core` | Taro, Next.js 13+ | Pre-build locally, upload dist |
|
|
14
|
+
| `esbuild` | Vite, Nuxt, uni-app | Usually has aarch64 binary; try build |
|
|
15
|
+
| `sharp` | Gatsby, Next.js images | Pre-build locally, upload dist |
|
|
16
|
+
| `prisma` | Next.js, Nuxt (database) | Use `binaryTargets = ["linux-arm64"]` |
|
|
17
|
+
| `node-gyp` (C++) | node-sass, bcrypt | `build-essential` is pre-installed |
|
|
18
|
+
|
|
19
|
+
**Pre-build workflow**:
|
|
20
|
+
|
|
21
|
+
1. Build on local machine (x86_64): `npm install && npm run build`
|
|
22
|
+
2. Use `huaweicloud_sandbox_connect` with git config (auto-transfers code) or `huaweicloud_sandbox_upload_project` to upload dist
|
|
23
|
+
3. Deploy with nginx static/SPA template — no native deps needed at runtime
|
|
24
|
+
|
|
25
|
+
## SSR Frameworks
|
|
26
|
+
|
|
27
|
+
| Framework | Install | Build | Serve | Output Dir | Port | Nginx |
|
|
28
|
+
| --------- | ------------- | --------------- | ----------------------------------------------------------- | ---------- | ---- | ----- |
|
|
29
|
+
| Next.js | `npm install` | `npm run build` | `nohup npm start > /tmp/app.log 2>&1 &` | `.next` | 3000 | proxy |
|
|
30
|
+
| Nuxt | `npm install` | `npm run build` | `nohup node .output/server/index.mjs > /tmp/app.log 2>&1 &` | `.output` | 3000 | proxy |
|
|
31
|
+
|
|
32
|
+
## Static Site Generators (SSG)
|
|
33
|
+
|
|
34
|
+
| Framework | Install | Build | Serve | Output Dir | Port | Nginx |
|
|
35
|
+
| ---------- | ----------------- | -------------------- | ------------ | ----------------- | ---- | ------ |
|
|
36
|
+
| VitePress | `npm install` | `npm run docs:build` | nginx static | `.vitepress/dist` | 8080 | spa |
|
|
37
|
+
| Docusaurus | `npm install` | `npm run build` | nginx static | `build` | 8080 | spa |
|
|
38
|
+
| Hugo | (download binary) | `hugo` | nginx static | `public` | 8080 | static |
|
|
39
|
+
| Hexo | `npm install` | `npm run build` | nginx static | `public` | 8080 | static |
|
|
40
|
+
|
|
41
|
+
## SPA Frameworks
|
|
42
|
+
|
|
43
|
+
| Framework | Install | Build | Serve | Output Dir | Port | Nginx |
|
|
44
|
+
| ----------------------------- | ------------- | --------------- | --------- | ---------------- | ---- | ----- |
|
|
45
|
+
| Vite (React/Vue/Svelte/Solid) | `npm install` | `npm run build` | nginx SPA | `dist` | 8080 | spa |
|
|
46
|
+
| Create React App | `npm install` | `npm run build` | nginx SPA | `build` | 8080 | spa |
|
|
47
|
+
| Vue CLI | `npm install` | `npm run build` | nginx SPA | `dist` | 8080 | spa |
|
|
48
|
+
| Angular | `npm install` | `npm run build` | nginx SPA | `dist/<project>` | 8080 | spa |
|
|
49
|
+
|
|
50
|
+
## Cross-Platform Frameworks (H5)
|
|
51
|
+
|
|
52
|
+
| Framework | Install | Build | Serve | Output Dir | Port | Nginx |
|
|
53
|
+
| --------- | ------------- | ------------------ | --------- | --------------- | ---- | ----- |
|
|
54
|
+
| Taro | `npm install` | `npm run build:h5` | nginx SPA | `dist` | 8080 | spa |
|
|
55
|
+
| uni-app | `npm install` | `npm run build:h5` | nginx SPA | `dist/build/h5` | 8080 | spa |
|
|
56
|
+
|
|
57
|
+
## Runtime Dependencies
|
|
58
|
+
|
|
59
|
+
### Sandbox Pre-installed (expected)
|
|
60
|
+
|
|
61
|
+
These tools should be available in the sandbox image. Verify with the pre-flight check in SKILL.md Step 3.
|
|
62
|
+
|
|
63
|
+
| Tool | Min Version | Purpose |
|
|
64
|
+
| --------------- | ----------- | ----------------------------- |
|
|
65
|
+
| Node.js | 22.x | All npm-based workflows |
|
|
66
|
+
| npm | 10.x | Package manager (fallback) |
|
|
67
|
+
| nginx | 1.26.x | Primary static/SSR serving |
|
|
68
|
+
| python3 | 3.12+ | HTTP server fallback |
|
|
69
|
+
| git | 2.45.x | Code checkout |
|
|
70
|
+
| curl | 8.x | Tool downloads, health checks |
|
|
71
|
+
| build-essential | - | Native module compilation |
|
|
72
|
+
| pnpm | 10.x | Monorepo / workspace installs |
|
|
73
|
+
|
|
74
|
+
### Install on Demand
|
|
75
|
+
|
|
76
|
+
Tools that may need installation in the sandbox before building:
|
|
77
|
+
|
|
78
|
+
| Tool | Trigger | Install Command |
|
|
79
|
+
| --------- | ------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
80
|
+
| yarn | `yarn.lock` detected | `npm i -g yarn` |
|
|
81
|
+
| Hugo | `hugo.toml` / `config.toml` detected | Download Hugo extended binary (see below) |
|
|
82
|
+
| DevBridge | Tunnel exposure step | `curl -fsSL https://res-hd.hc-cdn.cn/sharedata/hdspace/devbridge/install.sh \| bash` |
|
|
83
|
+
|
|
84
|
+
> Hugo download: `curl -fsSL https://github.com/gohugoio/hugo/releases/download/v0.140.0/hugo_extended_0.140.0_linux-amd64.tar.gz -o /tmp/hugo.tar.gz && sudo tar -xzf /tmp/hugo.tar.gz -C /usr/local/bin hugo && rm /tmp/hugo.tar.gz`
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Nginx Configuration Templates
|
|
2
|
+
|
|
3
|
+
Nginx is the primary serving mechanism for web apps deployed to the sandbox. Python `http.server` is a fallback when nginx is unavailable.
|
|
4
|
+
|
|
5
|
+
## Nginx Setup (sandbox)
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
sudo apt-get update -qq && sudo apt-get install -y -qq nginx 2>/dev/null || true
|
|
9
|
+
sudo mkdir -p /etc/nginx/conf.d
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Template 1: SPA (with try_files fallback)
|
|
13
|
+
|
|
14
|
+
Use for: Vite, CRA, Vue CLI, Angular, VitePress, Docusaurus, Taro H5, uni-app H5
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
sudo tee /etc/nginx/conf.d/app.conf > /dev/null << 'NGINX_EOF'
|
|
18
|
+
server {
|
|
19
|
+
listen <port>;
|
|
20
|
+
root /workspace/<project>/<outputDir>;
|
|
21
|
+
index index.html;
|
|
22
|
+
|
|
23
|
+
location / {
|
|
24
|
+
try_files $uri $uri/ /index.html;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
28
|
+
expires 1h;
|
|
29
|
+
add_header Cache-Control "public, immutable";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
NGINX_EOF
|
|
33
|
+
sudo nginx -s reload 2>/dev/null || sudo nginx
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Template 2: SSR Reverse Proxy
|
|
37
|
+
|
|
38
|
+
Use for: Next.js, Nuxt
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sudo tee /etc/nginx/conf.d/app.conf > /dev/null << 'NGINX_EOF'
|
|
42
|
+
server {
|
|
43
|
+
listen <publicPort>;
|
|
44
|
+
server_name _;
|
|
45
|
+
large_client_header_buffers 4 32k;
|
|
46
|
+
|
|
47
|
+
location / {
|
|
48
|
+
proxy_pass http://127.0.0.1:<nodePort>;
|
|
49
|
+
proxy_http_version 1.1;
|
|
50
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
51
|
+
proxy_set_header Connection 'upgrade';
|
|
52
|
+
proxy_set_header Host $host;
|
|
53
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
54
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
55
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
56
|
+
proxy_cache_bypass $http_upgrade;
|
|
57
|
+
proxy_read_timeout 60s;
|
|
58
|
+
proxy_buffer_size 128k;
|
|
59
|
+
proxy_buffers 4 256k;
|
|
60
|
+
proxy_busy_buffers_size 256k;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
NGINX_EOF
|
|
64
|
+
sudo nginx -s reload 2>/dev/null || sudo nginx
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Template 3: Static Site (with clean URL support)
|
|
68
|
+
|
|
69
|
+
Use for: Hugo, Hexo, plain static HTML
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
sudo tee /etc/nginx/conf.d/app.conf > /dev/null << 'NGINX_EOF'
|
|
73
|
+
server {
|
|
74
|
+
listen <port>;
|
|
75
|
+
root /workspace/<project>/<outputDir>;
|
|
76
|
+
index index.html;
|
|
77
|
+
|
|
78
|
+
location / {
|
|
79
|
+
try_files $uri $uri.html $uri/ =404;
|
|
80
|
+
autoindex off;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
84
|
+
expires 1h;
|
|
85
|
+
add_header Cache-Control "public, immutable";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
NGINX_EOF
|
|
89
|
+
sudo nginx -s reload 2>/dev/null || sudo nginx
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Fallback: Python HTTP Server
|
|
93
|
+
|
|
94
|
+
When nginx fails to install or start:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
cd /workspace/<project>/<outputDir> && nohup python3 -m http.server <port> > /tmp/http.log 2>&1 &
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> This does **not** support SPA client-side routing. Use only for static sites or when nginx is truly unavailable.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-smn-dms
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when creating or managing SMN topics/subscriptions/messages or DMS Kafka/RabbitMQ/RocketMQ queues on Huawei Cloud. Triggers: SMN, DMS, notification, message queue, Kafka, RabbitMQ, RocketMQ, topic, subscription. NOT for: APIG (use huawei-apig), FunctionGraph triggers (use huawei-functiongraph).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ version: 1
|
|
|
8
8
|
|
|
9
9
|
**STOP - Do not answer from general knowledge.** Follow the procedure below.
|
|
10
10
|
|
|
11
|
-
Always run `hcloud SMN <Operation> --help` or `hcloud
|
|
11
|
+
Always run `hcloud SMN <Operation> --help`, `hcloud Kafka <Operation> --help`, `hcloud RabbitMQ <Operation> --help`, or `hcloud RocketMQ <Operation> --help` before constructing commands.
|
|
12
12
|
|
|
13
13
|
## Overview
|
|
14
14
|
|
|
@@ -18,50 +18,57 @@ Domain expertise for SMN (Simple Message Notification) and DMS (Distributed Mess
|
|
|
18
18
|
|
|
19
19
|
## Critical Warnings
|
|
20
20
|
|
|
21
|
-
| Trap
|
|
22
|
-
|
|
21
|
+
| Trap | Why |
|
|
22
|
+
| ------------------------- | ------------------------------------------------------------- |
|
|
23
23
|
| Subscription confirmation | HTTP/HTTPS subscriptions need endpoint ping-back confirmation |
|
|
24
|
-
| Email subscription delay
|
|
25
|
-
| SMS charge per message
|
|
24
|
+
| Email subscription delay | Email subscriptions require user to click confirmation link |
|
|
25
|
+
| SMS charge per message | Template SMS incurs per-delivery charges |
|
|
26
26
|
|
|
27
27
|
### Common Workflows
|
|
28
28
|
|
|
29
|
-
| Task
|
|
30
|
-
|
|
31
|
-
| List topics
|
|
32
|
-
| Create topic
|
|
33
|
-
| Add subscription
|
|
34
|
-
| List subscriptions
|
|
29
|
+
| Task | Operation |
|
|
30
|
+
| ----------------------- | --------------------------------------------------------- |
|
|
31
|
+
| List topics | `ListTopics --cli-region=<r> --project_id=<p>` |
|
|
32
|
+
| Create topic | `CreateTopic --cli-region=<r> --project_id=<p>` |
|
|
33
|
+
| Add subscription | `AddSubscription --cli-region=<r> --project_id=<p>` |
|
|
34
|
+
| List subscriptions | `ListSubscriptions --cli-region=<r> --project_id=<p>` |
|
|
35
35
|
| Create message template | `CreateMessageTemplate --cli-region=<r> --project_id=<p>` |
|
|
36
|
-
| Publish message
|
|
37
|
-
| Delete topic
|
|
36
|
+
| Publish message | `PublishMessage --cli-region=<r> --project_id=<p>` |
|
|
37
|
+
| Delete topic | `DeleteTopic --cli-region=<r> --project_id=<p>` |
|
|
38
38
|
|
|
39
39
|
## DMS
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
> **DMS 是产品统一品牌**,涵盖 Kafka、RabbitMQ、RocketMQ 三种引擎。在 KooCLI 中,三种引擎被拆分为独立服务,**不存在 `hcloud DMS` 命令**。
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
43
|
+
### Engine → KooCLI Service Mapping
|
|
44
|
+
|
|
45
|
+
| Engine | KooCLI Service | Description |
|
|
46
|
+
| -------- | ----------------- | -------------------- |
|
|
47
|
+
| Kafka | `hcloud Kafka` | 高吞吐分布式消息队列 |
|
|
48
|
+
| RabbitMQ | `hcloud RabbitMQ` | AMQP 消息代理 |
|
|
49
|
+
| RocketMQ | `hcloud RocketMQ` | 低延迟金融级消息队列 |
|
|
48
50
|
|
|
49
51
|
### Common Workflows
|
|
50
52
|
|
|
51
|
-
| Task | Operation
|
|
52
|
-
|
|
53
|
-
| List instances | `ListInstances --cli-region=<r> --project_id=<p>`
|
|
54
|
-
|
|
|
55
|
-
| List
|
|
53
|
+
| Task | Service | Operation |
|
|
54
|
+
| ------------------------ | ---------- | ------------------------------------------------------------------ |
|
|
55
|
+
| List Kafka instances | `Kafka` | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
56
|
+
| List RabbitMQ instances | `RabbitMQ` | `ListInstancesDetails --cli-region=<r> --project_id=<p>` |
|
|
57
|
+
| List RocketMQ instances | `RocketMQ` | `ListInstances --cli-region=<r> --project_id=<p>` |
|
|
58
|
+
| Create Kafka instance | `Kafka` | `CreatePostPaidKafkaInstance --cli-region=<r> --project_id=<p>` |
|
|
59
|
+
| Create RabbitMQ instance | `RabbitMQ` | `CreatePostPaidInstanceByEngine --cli-region=<r> --project_id=<p>` |
|
|
60
|
+
| Create RocketMQ instance | `RocketMQ` | `CreateInstanceByEngine --cli-region=<r> --project_id=<p>` |
|
|
61
|
+
| List Kafka topics | `Kafka` | `ListInstanceTopics --cli-region=<r> --project_id=<p>` |
|
|
62
|
+
| List RocketMQ topics | `RocketMQ` | `ListRocketInstanceTopics --cli-region=<r> --project_id=<p>` |
|
|
56
63
|
|
|
57
64
|
Discover exact parameters with `--help` before executing any command.
|
|
58
65
|
|
|
59
66
|
## Troubleshooting
|
|
60
67
|
|
|
61
|
-
| Error
|
|
62
|
-
|
|
63
|
-
| Subscription not confirmed
|
|
64
|
-
| DMS instance creation fails | Check VPC/subnet availability and engine version
|
|
68
|
+
| Error | Fix |
|
|
69
|
+
| --------------------------- | ------------------------------------------------- |
|
|
70
|
+
| Subscription not confirmed | SMN subscriptions need endpoint/user confirmation |
|
|
71
|
+
| DMS instance creation fails | Check VPC/subnet availability and engine version |
|
|
65
72
|
|
|
66
73
|
## Cross-Skill References
|
|
67
74
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: huawei-voucher
|
|
3
|
+
description: '查询和领取华为云激励代金券(一人一次)。当用户首次使用、开始会话、询问插件能力,或提到"领券/代金券/优惠券/激励金/领取/福利"等话题时,先调 voucher_status 查领取状态:未领取(claimed=false)则主动提示可领取一张代金券并询问是否领取;已领取(claimed=true)或状态不明确则静默不打扰。Triggers: 首次使用, 会话开始, voucher, coupon, incentive, 领券, 代金券, 优惠券, 激励金, 领取, 福利. NOT for: 账单/费用查询(用 huawei-billing)。'
|
|
4
|
+
version: 1
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 华为云激励代金券
|
|
8
|
+
|
|
9
|
+
## 主动提示准则(核心)
|
|
10
|
+
|
|
11
|
+
此能力仅在用户尚未领取时才有价值,需避免已领取用户被反复打扰。以下场景默认执行"先查后提示":会话开始、能力导读、首次对话、提到福利领取类话题。
|
|
12
|
+
|
|
13
|
+
1. 生产环境直接调用 `huaweicloud_voucher_status`(**不传** `domain_id`,后端从 IAM 自动解析账号)。
|
|
14
|
+
2. 按返回严格判定:
|
|
15
|
+
- `claimed=true` → 静默处理,不再提及代金券,不打扰用户
|
|
16
|
+
- `claimed=false` 且 `message="未领取"` → **主动提示**,用下方话术并询问是否领取
|
|
17
|
+
- 其余情况(如 `message="查询失败"`、状态不明确、调用异常)→ **严格不提示**
|
|
18
|
+
3. 提示话术(可直接使用):
|
|
19
|
+
> "你还可以领取一张华为云激励代金券(一人一次),需要我现在帮你领取吗?"
|
|
20
|
+
4. 能力导读时,若判定未领取,将代金券作为**独立、靠前**的提示项,而非埋在能力清单底部。
|
|
21
|
+
|
|
22
|
+
## 流程
|
|
23
|
+
|
|
24
|
+
### 1. 查询状态
|
|
25
|
+
|
|
26
|
+
调用 `huaweicloud_voucher_status`(生产环境无需 `domain_id`,测试环境需传 `domain_id`)。
|
|
27
|
+
|
|
28
|
+
返回 `{ claimed, message }`:
|
|
29
|
+
|
|
30
|
+
- `claimed=true` + `message="已领取"` → 已领取,告知结果即可,不再引导
|
|
31
|
+
- `claimed=false` + `message="未领取"` → 未领取,可引导领取
|
|
32
|
+
|
|
33
|
+
### 2. 领取代金券
|
|
34
|
+
|
|
35
|
+
调用 `huaweicloud_voucher_claim`(生产环境无需 `domain_id`)。
|
|
36
|
+
|
|
37
|
+
返回 `{ claimed, voucherId, amount, message }`。
|
|
38
|
+
|
|
39
|
+
### 3. 结果解读(错误码 UX)
|
|
40
|
+
|
|
41
|
+
| 返回 message 关键特征 | 含义 | 对用户表述 |
|
|
42
|
+
| -------------------------------------------- | --------------------------- | -------------------- |
|
|
43
|
+
| `领取成功` | 发券成功 | 告知券已到账 |
|
|
44
|
+
| `已领取过` / `已领取` | 该账号已领过 | 告知已领取,不打扰 |
|
|
45
|
+
| `本月代金券总额度已用完,所有账号均无法领取` | 全局额度用尽(HD.60630042) | 告知下月再试 |
|
|
46
|
+
| `请先完成实名认证` | 账号未实名(HD.60630022) | 引导去控制台实名认证 |
|
|
47
|
+
| `发券失败: <原文>` | 其他错误 | 原样转达,不展开 |
|
|
48
|
+
|
|
49
|
+
## 环境注意
|
|
50
|
+
|
|
51
|
+
- 生产环境:`voucher_status` / `voucher_claim` 无需传 `domain_id`,后端从 IAM 自动解析账号。
|
|
52
|
+
- 测试环境:需传 `domain_id`(华为云账号 ID);未传时返回 `测试环境需提供 domain_id`,此时可用 `hcloud IAM KeystoneListAuthDomains` 查询账号 ID 后补传。
|
|
53
|
+
|
|
54
|
+
## 注意事项
|
|
55
|
+
|
|
56
|
+
- 每个账号(domain_id)仅可领取一次,重复调用返回已领取。
|
|
57
|
+
- 领取结果以激励服务返回为准,不要凭本地认知猜测。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-vpc
|
|
3
|
-
description:
|
|
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
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -18,50 +18,50 @@ Domain expertise for Huawei Cloud Virtual Private Cloud (VPC). Covers VPC/subnet
|
|
|
18
18
|
|
|
19
19
|
## Critical Warnings
|
|
20
20
|
|
|
21
|
-
| Trap
|
|
22
|
-
|
|
23
|
-
| VPC CIDR cannot change
|
|
24
|
-
| Security group stateful
|
|
25
|
-
| Network ACL stateless
|
|
26
|
-
| EIP bills when idle
|
|
27
|
-
| Subnet AZ binding
|
|
28
|
-
| EIP PER type needs `--bandwidth.name` | PER bandwidth requires explicit name; `--help` marks it optional but it's required
|
|
29
|
-
| **VPC params need nested prefix**
|
|
30
|
-
| **Security group needs no vpc_id**
|
|
31
|
-
| Subnet DNS empty → ECS no DNS
|
|
32
|
-
| SCP blocks 0.0.0.0/0 SG rules
|
|
33
|
-
| **VPC tags use `*` separator**
|
|
21
|
+
| Trap | Why |
|
|
22
|
+
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| VPC CIDR cannot change | Once set, VPC CIDR block is immutable |
|
|
24
|
+
| Security group stateful | SG rules are stateful. Return traffic auto-allowed |
|
|
25
|
+
| Network ACL stateless | ACL rules must allow both inbound AND outbound |
|
|
26
|
+
| EIP bills when idle | Unbound EIP still charges. Release when unused |
|
|
27
|
+
| Subnet AZ binding | Subnet tied to single AZ. Cross-AZ needs multiple subnets |
|
|
28
|
+
| EIP PER type needs `--bandwidth.name` | PER bandwidth requires explicit name; `--help` marks it optional but it's required |
|
|
29
|
+
| **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` |
|
|
30
|
+
| **Security group needs no vpc_id** | VPC v3 API `CreateSecurityGroup` does NOT accept `vpc_id`. Security groups are region-level, not VPC-bound |
|
|
31
|
+
| 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. Common DNS (primary / secondary): cn-north-4 (100.125.1.250 / 100.125.129.250), cn-north-1 (100.125.1.250 / 100.125.21.250), cn-east-3 (100.125.1.250 / 100.125.64.250), cn-south-1 (100.125.1.250 / 100.125.136.29), ap-southeast-3 (100.125.1.250 / 100.125.128.250). Authoritative per region: `hcloud DNS ListNameServers --type=private --region=<r>` |
|
|
32
|
+
| SCP blocks 0.0.0.0/0 SG rules | If `CreateSecurityGroupRule` with `--remote_ip_prefix=0.0.0.0/0` fails with `SYS.0403`, an org-level SCP policy is denying wide-open rules. Narrow to a specific CIDR range (e.g., your office IP) instead |
|
|
33
|
+
| **VPC tags use `*` separator** | VPC tag format: `--vpc.tags.1=env*test` (asterisk between key and value). NOT `--vpc.tags.1.key=env` (ECS-style). This is different from ECS `--server.metadata.key=value` |
|
|
34
34
|
|
|
35
35
|
## Common Workflows
|
|
36
36
|
|
|
37
|
-
| Task
|
|
38
|
-
|
|
39
|
-
| Create VPC
|
|
40
|
-
| Create subnet
|
|
41
|
-
| Update subnet
|
|
42
|
-
| Security group
|
|
43
|
-
| SG rule
|
|
44
|
-
| Create EIP
|
|
45
|
-
| Bind EIP to ECS | hcloud EIP AssociatePublicips --publicip_id=<id> --publicip.associate_instance_id=<port-id> --publicip.associate_instance_type=PORT
|
|
46
|
-
| Unbind EIP
|
|
47
|
-
| Delete EIP
|
|
48
|
-
| List EIPs
|
|
49
|
-
| NAT gateway
|
|
37
|
+
| Task | Command | Steps |
|
|
38
|
+
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
39
|
+
| Create VPC | hcloud VPC CreateVpc --vpc.name=<name> --vpc.cidr=<cidr> | CIDR must not conflict with existing VPCs. Run `hcloud VPC ListVpcs` first |
|
|
40
|
+
| 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 Critical Warnings for common values |
|
|
41
|
+
| Update subnet | hcloud VPC UpdateSubnet --subnet_id=<id> --subnet.dnsList.1=<dns1> --subnet.dnsList.2=<dns2> | Fix DNS after creation. Restart ECS after updating DNS for cloud-init to pick up changes |
|
|
42
|
+
| Security group | hcloud VPC CreateSecurityGroup --security_group.name=<name> | references/security-group.md |
|
|
43
|
+
| 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 |
|
|
44
|
+
| 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 |
|
|
45
|
+
| 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` |
|
|
46
|
+
| Unbind EIP | hcloud EIP DisassociatePublicips --publicip_id=<id> | references/eip.md |
|
|
47
|
+
| Delete EIP | hcloud EIP DeletePublicip --publicip_id=<id> | references/eip.md |
|
|
48
|
+
| List EIPs | hcloud EIP ListPublicips | |
|
|
49
|
+
| 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 |
|
|
50
50
|
|
|
51
51
|
## Troubleshooting
|
|
52
52
|
|
|
53
|
-
| Error
|
|
54
|
-
|
|
55
|
-
| Cannot reach instance
|
|
56
|
-
| Subnet CIDR conflict
|
|
57
|
-
| NAT gateway no internet
|
|
58
|
-
| EIP quota exceeded
|
|
59
|
-
| EIP.7905
|
|
60
|
-
| VPC.0301: Bandwidth name invalid
|
|
61
|
-
| EIP has no public IP after binding
|
|
62
|
-
| 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
|
|
63
|
-
| VPC.0209: Subnet still used
|
|
64
|
-
| SYS.0403 / SCP deny
|
|
53
|
+
| Error | Root Cause -> Fix |
|
|
54
|
+
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| Cannot reach instance | SG missing rule or no EIP -> Add SG rule / Bind EIP |
|
|
56
|
+
| Subnet CIDR conflict | Overlapping with existing subnets -> Choose non-overlapping CIDR |
|
|
57
|
+
| NAT gateway no internet | Route table missing default route -> Add 0.0.0.0/0 via NAT |
|
|
58
|
+
| EIP quota exceeded | Check actual quota: `hcloud EIP ListPublicips --cli-region=<r>` to see current usage. Default varies by account (typically 5-10) |
|
|
59
|
+
| EIP.7905 | Run `hcloud EIP ListPublicips --cli-region=<r>` first to check current usage |
|
|
60
|
+
| VPC.0301: Bandwidth name invalid | PER type requires `--bandwidth.name`, even though `--help` marks it optional |
|
|
61
|
+
| EIP has no public IP after binding | May need AddIngressEipV2 for ELB-type resources (see huawei-apig) |
|
|
62
|
+
| 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 DNS ListNameServers --type=private --region=<r>` |
|
|
63
|
+
| VPC.0209: Subnet still used | Subnet has dependent resources (ECS/RDS) — delete instances first, then subnet |
|
|
64
|
+
| 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. If SSH is blocked, bootstrap via cloud-init user_data instead: see `huawei-ecs` — no SSH needed |
|
|
65
65
|
|
|
66
66
|
## Security Considerations
|
|
67
67
|
|
|
@@ -4,15 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
Subnets without DNS configuration will fail cloud-init. Use these DNS addresses:
|
|
6
6
|
|
|
7
|
-
| Region
|
|
8
|
-
|
|
9
|
-
| cn-north-1
|
|
10
|
-
| cn-north-4
|
|
11
|
-
| cn-east-3
|
|
12
|
-
| cn-south-1
|
|
13
|
-
| ap-southeast-3 | 100.125.1.250 | 100.125.
|
|
7
|
+
| Region | Primary DNS | Secondary DNS |
|
|
8
|
+
| -------------- | ------------- | --------------- |
|
|
9
|
+
| cn-north-1 | 100.125.1.250 | 100.125.21.250 |
|
|
10
|
+
| cn-north-4 | 100.125.1.250 | 100.125.129.250 |
|
|
11
|
+
| cn-east-3 | 100.125.1.250 | 100.125.64.250 |
|
|
12
|
+
| cn-south-1 | 100.125.1.250 | 100.125.136.29 |
|
|
13
|
+
| ap-southeast-3 | 100.125.1.250 | 100.125.128.250 |
|
|
14
|
+
|
|
15
|
+
Get the authoritative values for any region at runtime (preferred over this table):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
hcloud DNS ListNameServers --type=private --region=<region>
|
|
19
|
+
```
|
|
14
20
|
|
|
15
21
|
**Subnet create with DNS**:
|
|
22
|
+
|
|
16
23
|
```bash
|
|
17
24
|
hcloud VPC CreateSubnet \
|
|
18
25
|
--subnet.name=<name> \
|
|
@@ -20,20 +27,20 @@ hcloud VPC CreateSubnet \
|
|
|
20
27
|
--subnet.cidr=10.50.1.0/24 \
|
|
21
28
|
--subnet.gateway_ip=10.50.1.1 \
|
|
22
29
|
--subnet.availability_zone=<az> \
|
|
23
|
-
--subnet.dnsList.1
|
|
24
|
-
--subnet.dnsList.2
|
|
30
|
+
--subnet.dnsList.1=<dns1> \
|
|
31
|
+
--subnet.dnsList.2=<dns2>
|
|
25
32
|
```
|
|
26
33
|
|
|
27
34
|
## Nested Prefix Summary
|
|
28
35
|
|
|
29
36
|
KooCLI 7.x VPC API requires nested prefixes:
|
|
30
37
|
|
|
31
|
-
| Resource
|
|
32
|
-
|
|
33
|
-
| VPC
|
|
34
|
-
| Subnet
|
|
35
|
-
| Security Group | `--security_group.`
|
|
36
|
-
| SG Rule
|
|
38
|
+
| Resource | Create Param Prefix | Example |
|
|
39
|
+
| -------------- | ------------------------ | --------------------------------------------------------------------- |
|
|
40
|
+
| VPC | `--vpc.` | `--vpc.name=my-vpc --vpc.cidr=192.168.0.0/16` |
|
|
41
|
+
| Subnet | `--subnet.` | `--subnet.name=web --subnet.vpc_id=<id> --subnet.cidr=192.168.1.0/24` |
|
|
42
|
+
| Security Group | `--security_group.` | `--security_group.name=sg-web` |
|
|
43
|
+
| SG Rule | `--security_group_rule.` | `--security_group_rule.direction=ingress` |
|
|
37
44
|
|
|
38
45
|
## EIP Management
|
|
39
46
|
|
|
@@ -19,6 +19,7 @@ Security group params use `--security_group.` prefix. Rules use `--security_grou
|
|
|
19
19
|
## Create Security Group Rule
|
|
20
20
|
|
|
21
21
|
Complete example with nested prefix:
|
|
22
|
+
|
|
22
23
|
```bash
|
|
23
24
|
hcloud VPC CreateSecurityGroupRule \
|
|
24
25
|
--security_group_rule.security_group_id=<sg-id> \
|
|
@@ -32,28 +33,28 @@ hcloud VPC CreateSecurityGroupRule \
|
|
|
32
33
|
|
|
33
34
|
## Stateful vs Stateless
|
|
34
35
|
|
|
35
|
-
| Feature
|
|
36
|
-
|
|
37
|
-
| Stateful?
|
|
38
|
-
| Applied to | ECS instance NIC
|
|
39
|
-
| Rules
|
|
40
|
-
| Default
|
|
36
|
+
| Feature | Security Group | Network ACL |
|
|
37
|
+
| ---------- | ------------------------------------ | ------------------------------- |
|
|
38
|
+
| Stateful? | Yes — return traffic auto-allowed | No — must allow both directions |
|
|
39
|
+
| Applied to | ECS instance NIC | Subnet |
|
|
40
|
+
| Rules | Allow only | Allow and Deny |
|
|
41
|
+
| Default | Deny all inbound, allow all outbound | Allow all |
|
|
41
42
|
|
|
42
43
|
## Common Rules Reference
|
|
43
44
|
|
|
44
|
-
| Direction | Protocol | Port | Source
|
|
45
|
-
|
|
46
|
-
| Ingress
|
|
47
|
-
| Ingress
|
|
48
|
-
| Ingress
|
|
49
|
-
| Ingress
|
|
50
|
-
| Ingress
|
|
51
|
-
| Egress
|
|
45
|
+
| Direction | Protocol | Port | Source | Purpose |
|
|
46
|
+
| --------- | -------- | ---- | -------------- | ---------------- |
|
|
47
|
+
| Ingress | TCP | 22 | <office-ip>/32 | SSH |
|
|
48
|
+
| Ingress | TCP | 80 | 0.0.0.0/0 | HTTP |
|
|
49
|
+
| Ingress | TCP | 443 | 0.0.0.0/0 | HTTPS |
|
|
50
|
+
| Ingress | TCP | 3306 | <sg-app-id> | MySQL from app |
|
|
51
|
+
| Ingress | TCP | 6379 | <sg-app-id> | Redis from app |
|
|
52
|
+
| Egress | ALL | ALL | 0.0.0.0/0 | Outbound default |
|
|
52
53
|
|
|
53
54
|
## Common Errors
|
|
54
55
|
|
|
55
|
-
| Error
|
|
56
|
-
|
|
57
|
-
| Cannot SSH
|
|
58
|
-
| Rule not effective
|
|
59
|
-
| `[USE_ERROR]不正确的参数:vpc_id` | Security groups don't need vpc_id. Remove it
|
|
56
|
+
| Error | Root Cause -> Fix |
|
|
57
|
+
| -------------------------------- | ---------------------------------------------------- |
|
|
58
|
+
| Cannot SSH | Default SG denies all inbound. Add port 22 rule |
|
|
59
|
+
| Rule not effective | SG assigned to wrong instance. Verify NIC attachment |
|
|
60
|
+
| `[USE_ERROR]不正确的参数:vpc_id` | Security groups don't need vpc_id. Remove it |
|