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,83 @@
|
|
|
1
|
+
# Architecture Templates by Scale
|
|
2
|
+
|
|
3
|
+
Templates define the resource mix and dependency topology per user scale. Adapt specs to the target region (always verify with `ListFlavors` / `ListImages`), never copy them blindly.
|
|
4
|
+
|
|
5
|
+
## Scale Classification
|
|
6
|
+
|
|
7
|
+
**When the user has not stated their scale** (and signals like "生产环境"/"学习用" are absent), present this table as a choice - the user picks the tier, the template follows:
|
|
8
|
+
|
|
9
|
+
| Scale | Signals | Product mix | Cost signal |
|
|
10
|
+
| -------------- | -------------------------------------------------- | --------------------------------------------------------------------- | ---------------------- |
|
|
11
|
+
| Personal | Side project, low traffic, cost-sensitive | FunctionGraph (free tier) + OBS static hosting, or single minimal ECS | Tens of CNY/month |
|
|
12
|
+
| Small business | Team product, stable traffic, needs SLA-ish uptime | ECS + RDS (single instance) + EIP, frontend OBS+CDN or same ECS | Hundreds of CNY/month |
|
|
13
|
+
| Enterprise | Production, HA, compliance | CCE + GaussDB (primary/standby) + WAF + CDN + OBS logs | Thousands of CNY/month |
|
|
14
|
+
|
|
15
|
+
## Template: Personal - OBS+CDN frontend / FunctionGraph backend (lightest)
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
OBS public bucket -> CDN acceleration -> DNS CNAME -> user domain
|
|
19
|
+
(Vue/React build output)
|
|
20
|
+
FunctionGraph (Node.js/Python)
|
|
21
|
+
(Express/FastAPI backend logic)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- FunctionGraph has a free tier; personal projects are often near-free
|
|
25
|
+
- Persistent data needs a real database (DDS single node in free tier, or minimal RDS). FG filesystem is ephemeral - SQLite data is lost between invocations
|
|
26
|
+
|
|
27
|
+
## Template: Personal - ECS+EIP frontend / FunctionGraph backend
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
VPC -> Subnet -> ECS(1C1G) -> EIP
|
|
31
|
+
(Nginx serves static files)
|
|
32
|
+
FunctionGraph (backend API)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Template: Small business - OBS+CDN frontend / ECS+RDS backend
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
OBS public bucket -> CDN -> DNS -> user domain
|
|
39
|
+
|
|
40
|
+
VPC -> Subnet -> SG -> ECS(2C4G) -> EIP
|
|
41
|
+
└─ RDS (MySQL single instance)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Template: Small business - all on ECS
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
VPC -> Subnet -> SG -> ECS(2C4G) -> EIP
|
|
48
|
+
├─ Nginx (frontend static)
|
|
49
|
+
├─ Node.js (backend)
|
|
50
|
+
└─ RDS (MySQL single instance)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Fewest resources; no CDN, no HTTPS by default. Good for quick validation or intranet scenarios.
|
|
54
|
+
|
|
55
|
+
## Template: Enterprise
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
OBS public bucket -> CDN -> WAF -> DNS -> user domain
|
|
59
|
+
|
|
60
|
+
VPC -> Subnet -> SG
|
|
61
|
+
├─ CCE (3 nodes) -> ELB -> EIP
|
|
62
|
+
├─ GaussDB (primary/standby)
|
|
63
|
+
└─ OBS (logs)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Dependency Ordering Rules
|
|
67
|
+
|
|
68
|
+
Creation must follow topological order; destroy is the exact reverse:
|
|
69
|
+
|
|
70
|
+
1. Network foundation first: VPC → Subnet → Security Group (+ rules)
|
|
71
|
+
2. Compute / database next: ECS, RDS, CCE, FunctionGraph
|
|
72
|
+
3. Bindings and exposure last: EIP bind, CDN domain, DNS record set
|
|
73
|
+
4. Shared foundations (VPC/Subnet) are referenced by many resources - deleting them first always fails with "resource in use"
|
|
74
|
+
|
|
75
|
+
## Frontend Hosting Decision Matrix
|
|
76
|
+
|
|
77
|
+
| Aspect | OBS+CDN+DNS | ECS+EIP |
|
|
78
|
+
| -------------------- | --------------------------------------- | ------------------------------------- |
|
|
79
|
+
| Prerequisite | Registered + ICP-filed domain | None (IP access) |
|
|
80
|
+
| Ops | Zero server ops | Full server management |
|
|
81
|
+
| Backend on same host | No (static only) | Yes (SSR / API / Nginx) |
|
|
82
|
+
| Traffic cost | Pay per GB, cheap at scale | Fixed bandwidth billing |
|
|
83
|
+
| Best for | Static sites, SPAs, docs, landing pages | SSR frontends, all-in-one deployments |
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Resource Purchase Catalog
|
|
2
|
+
|
|
3
|
+
Every resource type the orchestration flow can purchase, bind, and destroy. This is the authoritative checklist when composing a deployment plan.
|
|
4
|
+
|
|
5
|
+
> **Operation names below are entry points, not gospel.** Always confirm exact parameters with `hcloud <Service> <Operation> --help` before planning a command. When an operation name is uncertain, run `hcloud <Service> --help` first.
|
|
6
|
+
|
|
7
|
+
## Networking (foundation - create first, destroy last)
|
|
8
|
+
|
|
9
|
+
> **v3 API notes (verified by E2E)**: `CreateSecurityGroup` is account-scoped - NO `vpc_id` param. `CreateSecurityGroupRule` uses `multiport=80` (not `port_range_min/max`). `DeleteSubnet` requires `--vpc_id` in addition to `--subnet_id`. Deletion APIs return empty output on success (async 202/204) - confirm via list, not stdout.
|
|
10
|
+
|
|
11
|
+
| Resource | Create | Delete | Skill | Depends on |
|
|
12
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| VPC | `hcloud VPC CreateVpc --vpc.name=<n> --vpc.cidr=<cidr>` | `hcloud VPC DeleteVpc --vpc_id=<id>` | huawei-vpc | - |
|
|
14
|
+
| Subnet | `hcloud VPC CreateSubnet --subnet.name=<n> --subnet.cidr=<cidr> --subnet.gateway_ip=<gw> --subnet.vpc_id=<id> --subnet.dnsList.1=100.125.0.20 --subnet.dnsList.2=114.114.114.114` (⚠️ dnsList 必带——实测缺失后实例内 apt/git 域名解析全挂;UpdateSubnet 补写时必填 `--vpc_id` + `--subnet.name`) | `hcloud VPC DeleteSubnet --subnet_id=<id> --vpc_id=<id>` | huawei-vpc | VPC |
|
|
15
|
+
| Security group | `hcloud VPC CreateSecurityGroup --security_group.name=<n>` (v3: account-scoped, no vpc_id) | `hcloud VPC DeleteSecurityGroup --security_group_id=<id>` | huawei-vpc | - |
|
|
16
|
+
| Security group rules | `hcloud VPC CreateSecurityGroupRule --security_group_rule.security_group_id=<id> --security_group_rule.direction=ingress --security_group_rule.protocol=tcp --security_group_rule.multiport=80 --security_group_rule.remote_ip_prefix=<cidr>` | `hcloud VPC DeleteSecurityGroupRule --security_group_rule_id=<id>` | huawei-vpc | Security group. New SGs deny ALL inbound - rules are mandatory. Risk rules block `0.0.0.0/0` exposure - use the VPC CIDR for internal rules |
|
|
17
|
+
| EIP | `hcloud EIP CreatePublicip` | `hcloud EIP DeletePublicip` | huawei-vpc | - (bills when idle) |
|
|
18
|
+
| EIP bind | `hcloud EIP AssociatePublicips --publicip.associate_instance_type=PORT` | `hcloud EIP DisassociatePublicips` | huawei-vpc | EIP + target port |
|
|
19
|
+
|
|
20
|
+
## Compute
|
|
21
|
+
|
|
22
|
+
| Resource | Create | Delete | Skill | Depends on |
|
|
23
|
+
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ---------- | -------------------------------------------------------------------------- |
|
|
24
|
+
| ECS instance | `hcloud ECS CreateServers --server.name=<n> --server.flavorRef=<id> --server.imageRef=<id> --server.vpcid=<id> --server.nics.1.subnet_id=<id> --server.security_groups.1.id=<id> --server.availability_zone=<az> --server.root_volume.volumetype=<type>` (hidden required: `vpcid` + `root_volume.volumetype`; check flavor family vs image arch, e.g. kc1 = ARM needs an ARM image) | `hcloud ECS DeleteServers --servers.1.id=<id> --delete_publicip=true --delete_volume=true` | huawei-ecs | VPC + Subnet + SG. Set both delete flags true on teardown or EIP/disk leak |
|
|
25
|
+
| EVS data disk | `hcloud EVS CreateVolume` | `hcloud EVS DeleteVolume` | huawei-ecs | - (attach with `hcloud EVS AttachVolume`) |
|
|
26
|
+
|
|
27
|
+
## Databases
|
|
28
|
+
|
|
29
|
+
| Resource | Create | Delete | Skill | Depends on |
|
|
30
|
+
| --------------------------- | --------------------------------------------------------- | ------------------------------------------------------- | -------------- | ------------ |
|
|
31
|
+
| RDS (MySQL/PG/SQLServer) | discover with `hcloud RDS --help` (CreateInstance family) | discover with `hcloud RDS --help` | huawei-rds | VPC + Subnet |
|
|
32
|
+
| GaussDB | discover with `hcloud GaussDB --help` | discover with `hcloud GaussDB --help` | huawei-gaussdb | VPC + Subnet |
|
|
33
|
+
| DDS (MongoDB) / DCS (Redis) | discover with `hcloud DDS --help` / `hcloud DCS --help` | discover with `hcloud DDS --help` / `hcloud DCS --help` | huawei-dds-dcs | VPC + Subnet |
|
|
34
|
+
|
|
35
|
+
## Storage / Delivery
|
|
36
|
+
|
|
37
|
+
| Resource | Create | Delete | Skill | Depends on |
|
|
38
|
+
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------ | ---------------------------------------------------------------------------------- |
|
|
39
|
+
| OBS bucket | `hcloud OBS mb obs://<bucket> -location=<region>` (NO `-f`; `-location` is mandatory even with a regional endpoint; same-name re-create is idempotent success) | `hcloud OBS rm obs://<bucket> -f` (empty objects first; idempotent) | huawei-obs | - |
|
|
40
|
+
| Upload objects | `hcloud OBS cp <src> obs://<bucket>/ -f -acl=public-read` | - | huawei-obs | Bucket. Per-object ACL mandatory - bucket ACL does not cascade |
|
|
41
|
+
| Static website hosting | NO CLI path - `chattri` only sets ACL/storage-class and obsutil has no website command. Use the console, or enable via CDN OBS-origin (`--domain.sources.1.enable_obs_web_hosting=1`) | - | huawei-obs | Bucket. Bucket name must equal the custom domain for CDN custom-domain access |
|
|
42
|
+
| CDN acceleration domain | `hcloud CDN CreateDomain --domain.business_type=web --domain.domain_name=<domain> --domain.sources.1.origin_type=obs_bucket --domain.sources.1.ip_or_domain=<bucket-website-endpoint> --domain.sources.1.active_standby=1 --cli-region=cn-north-1` (CDN is a GLOBAL service: region must be cn-north-1 or ap-southeast-1; first create attempt fails with `CDN.00010185` until the user passes domain ownership verification via DNS record or file upload; `--domain.sources.1.enable_obs_web_hosting=1` enables OBS website hosting on the origin) | disable then delete | - (no skill) | OBS source or ECS origin. Mainland acceleration requires ICP filing |
|
|
43
|
+
| DNS record set | discover with `hcloud DNS --help` (CreateRecordSet family) | discover with `hcloud DNS --help` | - (no skill) | CDN CNAME + domain hosted in Huawei Cloud DNS (check `hcloud DNS ListPublicZones`) |
|
|
44
|
+
|
|
45
|
+
## Serverless / API
|
|
46
|
+
|
|
47
|
+
| Resource | Create | Delete | Skill | Depends on |
|
|
48
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | --------------------------------------------------------- |
|
|
49
|
+
| FunctionGraph function | `hcloud FunctionGraph CreateFunction --func_name=<n> --runtime=Node.js18.15 --handler=index.handler --memory_size=128 --timeout=3 --package=default --code_type=inline --func_code.file=<base64>` (runtime enum is exact: `Node.js18.15`, `Python3.9`, `Go1.x`, ...; `--package=inline` fails with `FSS.1006` - the pair is `--package=default --code_type=inline`) | `hcloud FunctionGraph DeleteFunction --function_urn=<urn-without-:latest>` (urn must omit version/alias to delete the whole function; param is `--function_urn`, NOT `--func_urn`) | huawei-functiongraph | - |
|
|
50
|
+
| FunctionGraph trigger | `hcloud FunctionGraph CreateFunctionTrigger --function_urn=<urn> --trigger_type_code=TIMER --trigger_status=ACTIVE --event_data.name=<n> --event_data.schedule_type=Rate --event_data.schedule=1m` (timer uses `schedule_type=Rate` + bare `1m`; `schedule=@every 1h` fails with `FSS.1109`) | `hcloud FunctionGraph DeleteFunctionTrigger --function_urn=<urn> --trigger_type_code=TIMER --trigger_id=<id>` | huawei-functiongraph | Function. Use DEDICATEDGATEWAY (not deprecated APIG type) |
|
|
51
|
+
| APIG instance | `hcloud APIG CreateInstanceV2 --spec_id=<id>` | discover with `hcloud APIG --help` | huawei-apig | - |
|
|
52
|
+
|
|
53
|
+
## Container
|
|
54
|
+
|
|
55
|
+
| Resource | Create | Delete | Skill | Depends on |
|
|
56
|
+
| ----------------------- | --------------------------------- | --------------------------------- | ---------- | ------------------------------------------------ |
|
|
57
|
+
| CCE cluster + node pool | discover with `hcloud CCE --help` | discover with `hcloud CCE --help` | huawei-cce | VPC + Subnet. Long creation time - warn the user |
|
|
58
|
+
|
|
59
|
+
## Messaging / Backup / Observability / Security
|
|
60
|
+
|
|
61
|
+
| Resource | Create | Delete | Skill |
|
|
62
|
+
| ----------------------------- | ------------------------------------------------------- | --------------------------------- | ---------------- |
|
|
63
|
+
| SMN topic / subscription | discover with `hcloud SMN --help` | discover with `hcloud SMN --help` | huawei-smn-dms |
|
|
64
|
+
| DMS queue (Kafka/RocketMQ) | discover with `hcloud DMS --help` | discover with `hcloud DMS --help` | huawei-smn-dms |
|
|
65
|
+
| CBR vault / policy | discover with `hcloud CBR --help` | discover with `hcloud CBR --help` | huawei-cbr |
|
|
66
|
+
| CES alarm rule | discover with `hcloud CES --help` | discover with `hcloud CES --help` | huawei-cloud-eye |
|
|
67
|
+
| CTS tracker | discover with `hcloud CTS --help` | discover with `hcloud CTS --help` | huawei-cts |
|
|
68
|
+
| DEW secret / KMS key | discover with `hcloud DEW --help` / `hcloud KMS --help` | discover with `hcloud DEW --help` | huawei-dew |
|
|
69
|
+
| WAF policy | discover with `hcloud WAF --help` | discover with `hcloud WAF --help` | huawei-waf-aad |
|
|
70
|
+
| IAM users / groups / agencies | discover with `hcloud IAM --help` | discover with `hcloud IAM --help` | huawei-iam |
|
|
71
|
+
|
|
72
|
+
## Pricing and Balance
|
|
73
|
+
|
|
74
|
+
### On-demand price inquiry (verified template)
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
hcloud BSS ListOnDemandResourceRatings --project_id=<pid> \
|
|
78
|
+
--product_infos.1.id=<label> \
|
|
79
|
+
--product_infos.1.cloud_service_type=hws.service.type.ec2 \
|
|
80
|
+
--product_infos.1.resource_type=hws.resource.type.vm \
|
|
81
|
+
--product_infos.1.region=<resource-region> \
|
|
82
|
+
--product_infos.1.resource_spec=kc1.small.1.linux \
|
|
83
|
+
--product_infos.1.subscription_num=1 \
|
|
84
|
+
--product_infos.1.usage_factor=Duration \
|
|
85
|
+
--product_infos.1.usage_measure_id=4 \
|
|
86
|
+
--product_infos.1.usage_value=730 \
|
|
87
|
+
--cli-region=cn-north-1 --cli-domain-id=<domain_id>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- `usage_measure_id=4` = hour; `usage_value=730` = one month. Response: `amount` (CNY) per product label
|
|
91
|
+
- **ECS codes verified**: service `hws.service.type.ec2`, resource `hws.resource.type.vm`, spec = `<flavor>.linux` (or `.win`); monthly price for kc1.small.1 = 87.60 CNY (official, cn-north-4)
|
|
92
|
+
- **EIP codes NOT usable (verified)**: `hws.service.type.vpc` + `19_bgp` fails with `CBC.6074` - use official website prices as static estimates and label them 估算
|
|
93
|
+
- **Other services**: codes are per-service and MUST be looked up via BSS metadata APIs (`ListServiceTypes` / `ListResourceTypes` / `ListUsageTypes`) or docs - a wrong combination fails with `CBC.6074`. Never guess
|
|
94
|
+
- **Balance query may be permission-blocked**: `CBC.0151` = IAM user lacks `billing:balance:view` → degrade to "user self-checks balance" and continue (do not block; `Ecs.7000` at order time is recoverable). domain_id 可从报错信息 `iam::<domain_id>:user:<name>` 提取
|
|
95
|
+
|
|
96
|
+
- Account balance: `hcloud BSS ShowCustomerAccountBalances --cli-region=cn-north-1 --cli-domain-id=<domain_id>`
|
|
97
|
+
- Global services (BSS/IAM/CDN) demand `--cli-domain-id` per call (or in the profile) under AK/SK auth
|
|
98
|
+
- If the domain_id is unknown: extract it from ANY resource response's `tenant_id` field (e.g. a VPC create response) or from the console (My Credentials page)
|
|
99
|
+
- Response shape: `account_balances[].amount` (cash account type=1, voucher account type=5), `debt_amount`, `currency`
|
|
100
|
+
- Cost gate rule: no deployment without a per-resource cost estimate AND a balance check. Verified failure mode when skipped: ECS creation dies with `Ecs.7000 Insufficient account balance` at order submission
|
|
101
|
+
|
|
102
|
+
## Auth Bootstrapping (prerequisite for every command above)
|
|
103
|
+
|
|
104
|
+
- Symptom of a broken profile: every hcloud API returns `APIGW.0301 Incorrect IAM authentication information` while OBS/obsutil keeps working - caused by a stale `securityToken` in the profile
|
|
105
|
+
- Fix: `hcloud configure delete --cli-profile=default`, then re-run `npx huaweicloud-devkit auth init` with permanent AK/SK only (no token). `configure set` refuses empty values, so the token cannot be cleared in place
|
|
106
|
+
- project_id is auto-discovered once signing works - no need to configure it manually
|
|
107
|
+
- VPC/OBS create responses expose `tenant_id` (= domain_id) - the reliable fallback source when BSS/IAM discovery is blocked
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Deployment State File Specification
|
|
2
|
+
|
|
3
|
+
Session-scoped tracking for the orchestration flow. This is a manual, session-scoped analog of Terraform state - lightweight by design, not a long-term deployment ledger.
|
|
4
|
+
|
|
5
|
+
## Location
|
|
6
|
+
|
|
7
|
+
System temp directory (session dies with the file):
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Linux/macOS: /tmp/huaweicloud-iac-state.json
|
|
11
|
+
Windows: %TEMP%\huaweicloud-iac-state.json
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Lifecycle
|
|
15
|
+
|
|
16
|
+
- Created at the start of Stage 6 (provisioning) with the first `deploying` deployment
|
|
17
|
+
- Updated after EVERY successful resource creation (never batch-write at the end)
|
|
18
|
+
- Marked `partial` immediately on any failure
|
|
19
|
+
- Marked `destroyed` after a successful teardown
|
|
20
|
+
- Expires with the session - never promise cross-session deploy management
|
|
21
|
+
|
|
22
|
+
## Schema
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"version": "1.0",
|
|
27
|
+
"deployments": {
|
|
28
|
+
"d-002": {
|
|
29
|
+
"created_at": "2026-09-05T14:00:00Z",
|
|
30
|
+
"arch": "personal-serverless",
|
|
31
|
+
"region": "cn-east-3",
|
|
32
|
+
"frontend": "obs-cdn",
|
|
33
|
+
"domain": "www.example.com",
|
|
34
|
+
"resources": [
|
|
35
|
+
{
|
|
36
|
+
"id": "obs_bucket",
|
|
37
|
+
"type": "OBS_Bucket",
|
|
38
|
+
"resource_id": "www.example.com",
|
|
39
|
+
"params": { "acl": "public-read", "website": true }
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"id": "cdn",
|
|
43
|
+
"type": "CDN_Domain",
|
|
44
|
+
"resource_id": "cdn-xxx",
|
|
45
|
+
"params": { "cname": "xxx.cdn.myhuaweicloud.com" },
|
|
46
|
+
"depends_on": ["obs_bucket"]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "dns",
|
|
50
|
+
"type": "DNS_RecordSet",
|
|
51
|
+
"resource_id": "rs-xxx",
|
|
52
|
+
"params": { "type": "CNAME", "value": "xxx.cdn.myhuaweicloud.com" },
|
|
53
|
+
"depends_on": ["cdn"]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "fg",
|
|
57
|
+
"type": "FunctionGraph",
|
|
58
|
+
"resource_id": "urn:fss:xxx",
|
|
59
|
+
"params": { "runtime": "Node.js" }
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"status": "deployed"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Field rules:
|
|
69
|
+
|
|
70
|
+
- `id`: stable resource role within the deployment (`vpc`, `subnet`, `sg`, `ecs`, `eip`, `rds`, `obs_bucket`, `cdn`, `dns`, `fg`, ...) - later resources reference these names in `depends_on`
|
|
71
|
+
- `resource_id`: the real cloud ID extracted from the creation command output - never reconstructed from memory
|
|
72
|
+
- `depends_on`: array of `id`s this resource was created after; determines reverse destroy order
|
|
73
|
+
- `params`: only what teardown or diagnostics needs (name, flags like ACL) - no secrets
|
|
74
|
+
|
|
75
|
+
## Status Machine
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
deploying ──all created + verified──▶ deployed
|
|
79
|
+
│
|
|
80
|
+
└──any failure──▶ partial (keep created-resource records; destroy to clean up)
|
|
81
|
+
|
|
82
|
+
deployed/partial ──destroy──▶ destroyed (terminal; queries only)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
| Status | Meaning | Allowed operations |
|
|
86
|
+
| ----------- | ----------------------------------- | -------------------------------- |
|
|
87
|
+
| `deploying` | Provisioning in progress | Wait / observe |
|
|
88
|
+
| `deployed` | All resources created and verified | Query, destroy |
|
|
89
|
+
| `partial` | Interrupted; orphan resources exist | **Destroy (clean up leftovers)** |
|
|
90
|
+
| `destroyed` | Torn down | Query only |
|
|
91
|
+
|
|
92
|
+
## Write Rules
|
|
93
|
+
|
|
94
|
+
1. Write state after every single successful create - extract `resource_id` from the actual command output
|
|
95
|
+
2. `resource_id` extraction is deterministic: parse the JSON the command returned; if the output shape is unexpected, stop and inspect instead of guessing
|
|
96
|
+
3. A failed create is recorded only via the `partial` status - do not fabricate IDs for failed resources
|
|
97
|
+
4. Destroy order = exact reverse of the recorded `resources` array order (creation order is already topological)
|
|
98
|
+
5. "Resource not found" during destroy = already gone; keep going and still record it as processed
|
|
99
|
+
6. **UTF-8 WITHOUT BOM**: PowerShell 5.1 `Set-Content -Encoding utf8` writes a BOM that makes strict JSON parsers fail (`Unexpected token ''`). Write state with Node `fs.writeFileSync` or another BOM-less writer; if parsing fails on a `\uFEFF` prefix, strip it and rewrite the file clean
|
|
100
|
+
7. Empty command stdout is a valid success signal for VPC v3 deletes (async 202/204) - confirm teardown via list APIs, not stdout
|
|
101
|
+
|
|
102
|
+
## Known Weakness
|
|
103
|
+
|
|
104
|
+
State correctness rests entirely on the agent writing each `resource_id` right after creation. A wrong or missing ID causes leaks (missed deletes) or wrong deletes at teardown. Mitigations: write immediately after each step, parse output programmatically, show the full to-be-deleted list for final confirmation before destroying.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: huawei-iam
|
|
3
|
-
description:
|
|
3
|
+
description: 'Use when managing IAM users, groups, roles, policies, agencies, projects, or access keys on Huawei Cloud. Covers IAM policy structure, least-privilege design, temporary credentials (STS), OneAccess integration, and security best practices. Triggers on: IAM, permission, policy, role, user, group, AK/SK, access key, agency, project, authorization. NOT for: DEW secret management (use huawei-dew).'
|
|
4
4
|
version: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,13 +16,13 @@ Domain expertise for Huawei Cloud Identity and Access Management (IAM). Covers u
|
|
|
16
16
|
|
|
17
17
|
## Critical Warnings
|
|
18
18
|
|
|
19
|
-
| Trap
|
|
20
|
-
|
|
21
|
-
| NEVER create IAM users for humans | Use OneAccess (IAM Identity Center) or federated SSO
|
|
22
|
-
| NEVER create long-term AK/SK
|
|
23
|
-
| Wildcard policies dangerous
|
|
24
|
-
| Agency trust is powerful
|
|
25
|
-
| Root account must have MFA
|
|
19
|
+
| Trap | Why |
|
|
20
|
+
| --------------------------------- | --------------------------------------------------------------- |
|
|
21
|
+
| NEVER create IAM users for humans | Use OneAccess (IAM Identity Center) or federated SSO |
|
|
22
|
+
| NEVER create long-term AK/SK | Use temporary STS tokens via agencies |
|
|
23
|
+
| Wildcard policies dangerous | Effect:Allow + Resource:* = full access. Always scope resources |
|
|
24
|
+
| Agency trust is powerful | Agencies let services assume roles. Always add conditions |
|
|
25
|
+
| Root account must have MFA | Root AK/SK is all-powerful. Enable MFA immediately |
|
|
26
26
|
|
|
27
27
|
## Policy Structure
|
|
28
28
|
|
|
@@ -42,33 +42,33 @@ Domain expertise for Huawei Cloud Identity and Access Management (IAM). Covers u
|
|
|
42
42
|
|
|
43
43
|
## Common Workflows
|
|
44
44
|
|
|
45
|
-
| Task
|
|
46
|
-
|
|
47
|
-
| List users
|
|
48
|
-
| Create group
|
|
49
|
-
| Create custom policy
|
|
50
|
-
| Create agency
|
|
51
|
-
| Get temporary credential | hcloud STS
|
|
52
|
-
| Attach policy | hcloud IAM
|
|
45
|
+
| Task | Command | Steps |
|
|
46
|
+
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
|
47
|
+
| List users | hcloud IAM KeystoneListUsers --cli-region=<r> | references/iam-ops.md |
|
|
48
|
+
| Create group | hcloud IAM CreateGroupV5 --group_name=<name> | references/iam-ops.md |
|
|
49
|
+
| Create custom policy | hcloud IAM CreateCloudServiceCustomPolicy --role.display_name=<n> --role.type=<type> --role.policy.Statement.1.Effect=Allow | references/policy-examples.md |
|
|
50
|
+
| Create agency | hcloud IAM CreateAgency --agency.name=<n> --agency.domain_id=<id> --agency.trust_domain_name=<domain> | references/agency.md |
|
|
51
|
+
| Get temporary credential | hcloud STS AssumeAgency --agency_urn=<urn> --agency_session_name=<n> --duration_seconds=3600 | references/sts.md |
|
|
52
|
+
| Attach policy to group | hcloud IAM AttachGroupPolicyV5 --group_id=<id> --policy_id=<id> | references/iam-ops.md |
|
|
53
53
|
|
|
54
54
|
## Policy Examples (Least Privilege)
|
|
55
55
|
|
|
56
|
-
| Role
|
|
57
|
-
|
|
58
|
-
| ECS Reader
|
|
59
|
-
| OBS Bucket Operator | obs:Get*, obs:Put*, obs:Delete*, obs:List*
|
|
60
|
-
| RDS Backup Operator | rds:CreateBackup, rds:RestoreFromBackup, rds:ListBackup | rds:*
|
|
56
|
+
| Role | Actions | Resource |
|
|
57
|
+
| ------------------- | ------------------------------------------------------- | ------------------------ |
|
|
58
|
+
| ECS Reader | ecs:List*, ecs:Get*, ecs:Describe* | * |
|
|
59
|
+
| OBS Bucket Operator | obs:Get*, obs:Put*, obs:Delete*, obs:List* | obs:_:_:bucket:my-bucket |
|
|
60
|
+
| RDS Backup Operator | rds:CreateBackup, rds:RestoreFromBackup, rds:ListBackup | rds:* |
|
|
61
61
|
|
|
62
62
|
> See `references/policy-examples.md` for complete policy JSON templates with conditions.
|
|
63
63
|
|
|
64
64
|
## Troubleshooting
|
|
65
65
|
|
|
66
|
-
| Error
|
|
67
|
-
|
|
68
|
-
| AccessDenied
|
|
69
|
-
| AuthFailure
|
|
70
|
-
| Agency trust failed | Missing trust policy condition -> Add g:SourceAccount condition
|
|
71
|
-
| Quota exceeded
|
|
66
|
+
| Error | Root Cause -> Fix |
|
|
67
|
+
| ------------------- | ---------------------------------------------------------------------- |
|
|
68
|
+
| AccessDenied | Missing IAM permission -> Check policy action and resource scope |
|
|
69
|
+
| AuthFailure | Expired AK/SK or wrong project -> Renew credentials / Check project ID |
|
|
70
|
+
| Agency trust failed | Missing trust policy condition -> Add g:SourceAccount condition |
|
|
71
|
+
| Quota exceeded | IAM user/group/policy limit -> Request quota increase |
|
|
72
72
|
|
|
73
73
|
## Security Considerations
|
|
74
74
|
|
|
@@ -88,10 +88,10 @@ FunctionGraph needs an agency to access VPC resources (RDS, DCS, etc.):
|
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
90
|
# 1. Create agency with FunctionGraph trust
|
|
91
|
-
hcloud IAM CreateAgency --
|
|
91
|
+
hcloud IAM CreateAgency --agency.name=<name> --agency.trust_domain_name=functiongraph
|
|
92
92
|
|
|
93
|
-
# 2.
|
|
94
|
-
hcloud IAM
|
|
93
|
+
# 2. Grant role to agency
|
|
94
|
+
hcloud IAM AssociateAgencyWithDomainPermission --agency_id=<id> --role_id=<role-id>
|
|
95
95
|
|
|
96
96
|
# 3. Use in CreateFunction
|
|
97
97
|
hcloud FunctionGraph CreateFunction ... --app_xrole=<agency-name>
|
|
@@ -9,6 +9,7 @@ Huawei Cloud IAM uses a different action naming convention from AWS. Actions use
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Examples:
|
|
12
|
+
|
|
12
13
|
- `ecs:servers:list` (NOT `ecs:ListInstances`)
|
|
13
14
|
- `obs:bucket:GetBucket` (NOT `s3:GetBucket`)
|
|
14
15
|
- `vpc:vpcs:list` (NOT `vpc:DescribeVpcs`)
|
|
@@ -18,77 +19,100 @@ Always verify exact action names via `https://support.huaweicloud.com/usermanual
|
|
|
18
19
|
## Read-Only Policies
|
|
19
20
|
|
|
20
21
|
### ECS Read-Only
|
|
22
|
+
|
|
21
23
|
```json
|
|
22
24
|
{
|
|
23
25
|
"Version": "1.1",
|
|
24
|
-
"Statement": [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
"Statement": [
|
|
27
|
+
{
|
|
28
|
+
"Effect": "Allow",
|
|
29
|
+
"Action": ["ecs:servers:list", "ecs:servers:get", "ecs:*:list", "ecs:*:get"],
|
|
30
|
+
"Resource": ["*"]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
29
33
|
}
|
|
30
34
|
```
|
|
31
35
|
|
|
32
36
|
### OBS Read-Only (scoped bucket)
|
|
37
|
+
|
|
33
38
|
```json
|
|
34
39
|
{
|
|
35
40
|
"Version": "1.1",
|
|
36
|
-
"Statement": [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
"Statement": [
|
|
42
|
+
{
|
|
43
|
+
"Effect": "Allow",
|
|
44
|
+
"Action": ["obs:bucket:Get*", "obs:bucket:List*", "obs:object:Get*"],
|
|
45
|
+
"Resource": ["obs:*:*:bucket:my-bucket", "obs:*:*:bucket:my-bucket/*"]
|
|
46
|
+
}
|
|
47
|
+
]
|
|
41
48
|
}
|
|
42
49
|
```
|
|
43
50
|
|
|
44
51
|
### FunctionGraph Read-Only
|
|
52
|
+
|
|
45
53
|
```json
|
|
46
54
|
{
|
|
47
55
|
"Version": "1.1",
|
|
48
|
-
"Statement": [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
"Statement": [
|
|
57
|
+
{
|
|
58
|
+
"Effect": "Allow",
|
|
59
|
+
"Action": [
|
|
60
|
+
"functiongraph:function:getConfig",
|
|
61
|
+
"functiongraph:function:list",
|
|
62
|
+
"functiongraph:function:invoke",
|
|
63
|
+
"functiongraph:trigger:list"
|
|
64
|
+
],
|
|
65
|
+
"Resource": ["*"]
|
|
66
|
+
}
|
|
67
|
+
]
|
|
53
68
|
}
|
|
54
69
|
```
|
|
55
70
|
|
|
56
71
|
## Full-Access (Scoped)
|
|
57
72
|
|
|
58
73
|
### RDS Operator
|
|
74
|
+
|
|
59
75
|
```json
|
|
60
76
|
{
|
|
61
77
|
"Version": "1.1",
|
|
62
|
-
"Statement": [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
"Statement": [
|
|
79
|
+
{
|
|
80
|
+
"Effect": "Allow",
|
|
81
|
+
"Action": ["rds:*"],
|
|
82
|
+
"Resource": ["*"],
|
|
83
|
+
"Condition": { "StringEquals": { "g:ResourceTag/Environment": ["dev", "staging"] } }
|
|
84
|
+
}
|
|
85
|
+
]
|
|
68
86
|
}
|
|
69
87
|
```
|
|
70
88
|
|
|
71
89
|
### FunctionGraph Developer
|
|
90
|
+
|
|
72
91
|
```json
|
|
73
92
|
{
|
|
74
93
|
"Version": "1.1",
|
|
75
|
-
"Statement": [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
"Statement": [
|
|
95
|
+
{
|
|
96
|
+
"Effect": "Allow",
|
|
97
|
+
"Action": ["functiongraph:function:*", "functiongraph:trigger:*", "functiongraph:runtime:list"],
|
|
98
|
+
"Resource": ["*"]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
80
101
|
}
|
|
81
102
|
```
|
|
82
103
|
|
|
83
104
|
### APIG Operator
|
|
105
|
+
|
|
84
106
|
```json
|
|
85
107
|
{
|
|
86
108
|
"Version": "1.1",
|
|
87
|
-
"Statement": [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
"Statement": [
|
|
110
|
+
{
|
|
111
|
+
"Effect": "Allow",
|
|
112
|
+
"Action": ["apig:instance:*", "apig:api:*", "apig:group:*", "apig:environment:*"],
|
|
113
|
+
"Resource": ["*"]
|
|
114
|
+
}
|
|
115
|
+
]
|
|
92
116
|
}
|
|
93
117
|
```
|
|
94
118
|
|
|
@@ -104,15 +128,17 @@ Always verify exact action names via `https://support.huaweicloud.com/usermanual
|
|
|
104
128
|
```json
|
|
105
129
|
{
|
|
106
130
|
"Version": "1.1",
|
|
107
|
-
"Statement": [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
131
|
+
"Statement": [
|
|
132
|
+
{
|
|
133
|
+
"Effect": "Allow",
|
|
134
|
+
"Action": ["ecs:*"],
|
|
135
|
+
"Resource": ["*"],
|
|
136
|
+
"Condition": {
|
|
137
|
+
"StringEquals": { "g:SourceAccount": "0123456789" },
|
|
138
|
+
"StringLike": { "g:SourceUrn": "urn:fss:*" }
|
|
139
|
+
}
|
|
114
140
|
}
|
|
115
|
-
|
|
141
|
+
]
|
|
116
142
|
}
|
|
117
143
|
```
|
|
118
144
|
|
|
@@ -31,13 +31,13 @@ hcloud IAM GetAccountSummary # account summary
|
|
|
31
31
|
|
|
32
32
|
## IAM vs AWS Comparison
|
|
33
33
|
|
|
34
|
-
| AWS
|
|
35
|
-
|
|
36
|
-
| `iam:ListUsers`
|
|
37
|
-
| AWS Managed Policy
|
|
38
|
-
| Customer Managed
|
|
39
|
-
| Resource-Based Policy | Project-Level Policy (项目级策略)
|
|
40
|
-
| IAM Role
|
|
34
|
+
| AWS | Huawei Cloud |
|
|
35
|
+
| --------------------- | ------------------------------------ |
|
|
36
|
+
| `iam:ListUsers` | `iam:users:list` (lowercase + colon) |
|
|
37
|
+
| AWS Managed Policy | System Policy (系统策略) |
|
|
38
|
+
| Customer Managed | Custom Policy (自定义策略) |
|
|
39
|
+
| Resource-Based Policy | Project-Level Policy (项目级策略) |
|
|
40
|
+
| IAM Role | Agency (委托) |
|
|
41
41
|
|
|
42
42
|
> Huawei Cloud IAM action naming: `<service>:<resource>:<action>`. Always verify at https://support.huaweicloud.com/usermanual-iam/iam_01_0001.html
|
|
43
43
|
|
|
@@ -49,8 +49,8 @@ hcloud IAM GetAccountSummary # account summary
|
|
|
49
49
|
"Action": ["ecs:*"],
|
|
50
50
|
"Resource": ["*"],
|
|
51
51
|
"Condition": {
|
|
52
|
-
"StringEquals": {"g:SourceAccount": "<account-id>"},
|
|
53
|
-
"StringLike": {"g:SourceUrn": "urn:fss:*"}
|
|
52
|
+
"StringEquals": { "g:SourceAccount": "<account-id>" },
|
|
53
|
+
"StringLike": { "g:SourceUrn": "urn:fss:*" }
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
```
|