@huawei-iac-tools/landingzone-workbench 0.0.0-stage → 0.0.1
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/LICENSE +201 -0
- package/README.md +85 -2
- package/cordis.patch.yml +21 -0
- package/knowledge/account-qualification.md +128 -0
- package/knowledge/blueprints/_base/blueprint.json +481 -0
- package/knowledge/blueprints/_base/defaults.json +127 -0
- package/knowledge/blueprints/foundation-lz/blueprint.json +43 -0
- package/knowledge/blueprints/foundation-lz/defaults.json +47 -0
- package/knowledge/blueprints/full-lz/blueprint.json +11 -0
- package/knowledge/blueprints/full-lz/defaults.json +8 -0
- package/knowledge/config.json +43 -0
- package/knowledge/error-rules.json +14 -0
- package/knowledge/ic-policies.json +21 -0
- package/knowledge/modules/account-structure.md +101 -0
- package/knowledge/modules/compliance/config-rms.md +212 -0
- package/knowledge/modules/compliance/cts.md +179 -0
- package/knowledge/modules/compliance/obs-lts.md +155 -0
- package/knowledge/modules/ic-policies.json +21 -0
- package/knowledge/modules/identity-center.md +603 -0
- package/knowledge/modules/module-layers.md +169 -0
- package/knowledge/modules/network/er.md +222 -0
- package/knowledge/modules/network/nat-eip.md +123 -0
- package/knowledge/modules/network/ram-share.md +92 -0
- package/knowledge/modules/network/vpc-subnet.md +142 -0
- package/knowledge/modules/organization-security/scp.md +122 -0
- package/knowledge/modules/organizations.md +212 -0
- package/knowledge/modules/recommended-config.md +157 -0
- package/knowledge/modules/recommended-rules.json +175 -0
- package/knowledge/modules/scp-policies.json +111 -0
- package/knowledge/modules/security/aad.md +94 -0
- package/knowledge/modules/security/cfw.md +105 -0
- package/knowledge/modules/security/waf.md +110 -0
- package/knowledge/param-mappings.json +133 -0
- package/knowledge/prompts.md +83 -0
- package/knowledge/resource-types.json +1162 -0
- package/knowledge/scp-policies.json +111 -0
- package/knowledge/state-machine.md +33 -0
- package/lib/client.js +21 -0
- package/lib/index.js +28592 -0
- package/lib/types/account-role.d.ts +19 -0
- package/lib/types/account-scope.d.ts +10 -0
- package/lib/types/agency.d.ts +38 -0
- package/lib/types/client/DropdownSelect.d.ts +49 -0
- package/lib/types/client/LoginGate.d.ts +20 -0
- package/lib/types/client/PanelIcon.d.ts +11 -0
- package/lib/types/client/WorkbenchShell.d.ts +21 -0
- package/lib/types/client/account-role.d.ts +15 -0
- package/lib/types/client/credential-status.d.ts +15 -0
- package/lib/types/client/huawei-mark.d.ts +37 -0
- package/lib/types/client/index.d.ts +26 -0
- package/lib/types/client/layout-ref.d.ts +23 -0
- package/lib/types/client/pages/ConfigPage/AdviceCard.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/AuditBar.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/ChangeSummaryCard.d.ts +22 -0
- package/lib/types/client/pages/ConfigPage/ChangesCard.d.ts +27 -0
- package/lib/types/client/pages/ConfigPage/ComplianceDetail.d.ts +25 -0
- package/lib/types/client/pages/ConfigPage/ComplianceSummaryCard.d.ts +31 -0
- package/lib/types/client/pages/ConfigPage/FindingsCard.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/GlossaryDrawer.d.ts +17 -0
- package/lib/types/client/pages/ConfigPage/OrgComplianceDetail.d.ts +15 -0
- package/lib/types/client/pages/ConfigPage/Pager.d.ts +32 -0
- package/lib/types/client/pages/ConfigPage/ResourceDrawer.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/ResourcesTable.d.ts +35 -0
- package/lib/types/client/pages/ConfigPage/RollupPanel.d.ts +17 -0
- package/lib/types/client/pages/ConfigPage/RuleDetailDrawer.d.ts +23 -0
- package/lib/types/client/pages/ConfigPage/StatusCards.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/UncoveredDialog.d.ts +22 -0
- package/lib/types/client/pages/ConfigPage/config-api.d.ts +101 -0
- package/lib/types/client/pages/ConfigPage/config-store.d.ts +57 -0
- package/lib/types/client/pages/ConfigPage/index.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/paging.d.ts +46 -0
- package/lib/types/client/pages/ConfigPage/scope-options.d.ts +51 -0
- package/lib/types/client/pages/CostPage/AccountAllocation.d.ts +24 -0
- package/lib/types/client/pages/CostPage/AccountBars.d.ts +20 -0
- package/lib/types/client/pages/CostPage/AccountColumns.d.ts +24 -0
- package/lib/types/client/pages/CostPage/AccountDonut.d.ts +18 -0
- package/lib/types/client/pages/CostPage/AccountSwitcher.d.ts +25 -0
- package/lib/types/client/pages/CostPage/AdviceCard.d.ts +43 -0
- package/lib/types/client/pages/CostPage/AdviceFindings.d.ts +43 -0
- package/lib/types/client/pages/CostPage/BillingPanels.d.ts +23 -0
- package/lib/types/client/pages/CostPage/BudgetCard.d.ts +36 -0
- package/lib/types/client/pages/CostPage/GlossaryDrawer.d.ts +16 -0
- package/lib/types/client/pages/CostPage/KpiRow.d.ts +23 -0
- package/lib/types/client/pages/CostPage/MarkdownBlock.d.ts +16 -0
- package/lib/types/client/pages/CostPage/ReportView.d.ts +17 -0
- package/lib/types/client/pages/CostPage/ResourceColumns.d.ts +19 -0
- package/lib/types/client/pages/CostPage/ResourceDonut.d.ts +18 -0
- package/lib/types/client/pages/CostPage/ResourcesCard.d.ts +40 -0
- package/lib/types/client/pages/CostPage/RuleDetailDrawer.d.ts +23 -0
- package/lib/types/client/pages/CostPage/SavingView.d.ts +38 -0
- package/lib/types/client/pages/CostPage/ServiceDonut.d.ts +17 -0
- package/lib/types/client/pages/CostPage/TrendChart.d.ts +24 -0
- package/lib/types/client/pages/CostPage/budget-input.d.ts +30 -0
- package/lib/types/client/pages/CostPage/cost-api.d.ts +266 -0
- package/lib/types/client/pages/CostPage/cost-store.d.ts +25 -0
- package/lib/types/client/pages/CostPage/format.d.ts +37 -0
- package/lib/types/client/pages/CostPage/index.d.ts +34 -0
- package/lib/types/client/pages/CostPage/trend-fold.d.ts +32 -0
- package/lib/types/client/pages/CostPage/useEcharts.d.ts +70 -0
- package/lib/types/client/pages/OrgStructurePage/AccountStatsCard.d.ts +22 -0
- package/lib/types/client/pages/OrgStructurePage/CoreAccountsCard.d.ts +18 -0
- package/lib/types/client/pages/OrgStructurePage/CreateAccountDialog.d.ts +28 -0
- package/lib/types/client/pages/OrgStructurePage/ManageUsersDialog.d.ts +28 -0
- package/lib/types/client/pages/OrgStructurePage/MemberAccountsTable.d.ts +32 -0
- package/lib/types/client/pages/OrgStructurePage/MoveAccountDialog.d.ts +29 -0
- package/lib/types/client/pages/OrgStructurePage/OrgGlossaryDrawer.d.ts +13 -0
- package/lib/types/client/pages/OrgStructurePage/OrgTreeCard.d.ts +31 -0
- package/lib/types/client/pages/OrgStructurePage/index.d.ts +21 -0
- package/lib/types/client/pages/OrgStructurePage/org-api.d.ts +166 -0
- package/lib/types/client/pages/OverviewPage/AnchorRow.d.ts +24 -0
- package/lib/types/client/pages/OverviewPage/AttentionList.d.ts +29 -0
- package/lib/types/client/pages/OverviewPage/OverviewCharts.d.ts +79 -0
- package/lib/types/client/pages/OverviewPage/OverviewGlossaryDrawer.d.ts +15 -0
- package/lib/types/client/pages/OverviewPage/index.d.ts +22 -0
- package/lib/types/client/pages/OverviewPage/overview-api.d.ts +115 -0
- package/lib/types/client/pages/ResourcePage/AccountResourceList.d.ts +21 -0
- package/lib/types/client/pages/ResourcePage/components/GlossaryDrawer.d.ts +20 -0
- package/lib/types/client/pages/ResourcePage/components/MetricCards.d.ts +19 -0
- package/lib/types/client/pages/ResourcePage/components/MultiSelect.d.ts +27 -0
- package/lib/types/client/pages/ResourcePage/components/PanelPager.d.ts +26 -0
- package/lib/types/client/pages/ResourcePage/components/RankBars.d.ts +25 -0
- package/lib/types/client/pages/ResourcePage/components/ScopeSelect.d.ts +27 -0
- package/lib/types/client/pages/ResourcePage/components/SourceConfigModal.d.ts +21 -0
- package/lib/types/client/pages/ResourcePage/components/SyncControls.d.ts +18 -0
- package/lib/types/client/pages/ResourcePage/components/TrendChart.d.ts +14 -0
- package/lib/types/client/pages/ResourcePage/components/useColumnWidths.d.ts +12 -0
- package/lib/types/client/pages/ResourcePage/format.d.ts +9 -0
- package/lib/types/client/pages/ResourcePage/index.d.ts +20 -0
- package/lib/types/client/pages/ResourcePage/summary-api.d.ts +205 -0
- package/lib/types/client/pages/SetupPage/AskPanel.d.ts +21 -0
- package/lib/types/client/pages/SetupPage/ChatEmbed.d.ts +40 -0
- package/lib/types/client/pages/SetupPage/ChatTab.d.ts +17 -0
- package/lib/types/client/pages/SetupPage/FormTab.d.ts +12 -0
- package/lib/types/client/pages/SetupPage/FormTabV2.d.ts +14 -0
- package/lib/types/client/pages/SetupPage/ProgressTreeView.d.ts +15 -0
- package/lib/types/client/pages/SetupPage/StageFlow.d.ts +16 -0
- package/lib/types/client/pages/SetupPage/index.d.ts +10 -0
- package/lib/types/client/pages/SetupPage/progress-types.d.ts +36 -0
- package/lib/types/client/pages/SetupPage/session-binding.d.ts +38 -0
- package/lib/types/client/pages/SetupPage/session-store.d.ts +57 -0
- package/lib/types/client/pages/SetupPage/sessions-ref.d.ts +5 -0
- package/lib/types/client/pages/SetupPage/setup-replan.d.ts +13 -0
- package/lib/types/client/pages/SetupPage/wb-api.d.ts +192 -0
- package/lib/types/client/pages/list-preview.d.ts +36 -0
- package/lib/types/client/permission-mode.d.ts +53 -0
- package/lib/types/client/store.d.ts +22 -0
- package/lib/types/collect.d.ts +78 -0
- package/lib/types/config/account-scope.d.ts +61 -0
- package/lib/types/config/advice-findings.d.ts +31 -0
- package/lib/types/config/advice-prompt.d.ts +60 -0
- package/lib/types/config/advice.d.ts +116 -0
- package/lib/types/config/cts.d.ts +30 -0
- package/lib/types/config/evidence/rules.d.ts +31 -0
- package/lib/types/config/evidence/types.d.ts +103 -0
- package/lib/types/config/failure-note.d.ts +46 -0
- package/lib/types/config/fingerprint-cache.d.ts +45 -0
- package/lib/types/config/identity.d.ts +67 -0
- package/lib/types/config/query.d.ts +49 -0
- package/lib/types/config/rms.d.ts +412 -0
- package/lib/types/config/routes.d.ts +32 -0
- package/lib/types/config/types.d.ts +785 -0
- package/lib/types/config/views.d.ts +158 -0
- package/lib/types/cost/accounts.d.ts +29 -0
- package/lib/types/cost/advice-findings.d.ts +77 -0
- package/lib/types/cost/advice-model.d.ts +19 -0
- package/lib/types/cost/advice-prompt.d.ts +73 -0
- package/lib/types/cost/advice-subagent-types.d.ts +6 -0
- package/lib/types/cost/advice-subagent.d.ts +116 -0
- package/lib/types/cost/advice-types.d.ts +63 -0
- package/lib/types/cost/advice.d.ts +125 -0
- package/lib/types/cost/aggregate.d.ts +157 -0
- package/lib/types/cost/assume.d.ts +43 -0
- package/lib/types/cost/bss.d.ts +166 -0
- package/lib/types/cost/budget-overview.d.ts +38 -0
- package/lib/types/cost/budget.d.ts +56 -0
- package/lib/types/cost/cache.d.ts +58 -0
- package/lib/types/cost/caliber.d.ts +40 -0
- package/lib/types/cost/console-links.d.ts +27 -0
- package/lib/types/cost/credentials.d.ts +38 -0
- package/lib/types/cost/data-window.d.ts +38 -0
- package/lib/types/cost/evidence/catalog.d.ts +35 -0
- package/lib/types/cost/evidence/index.d.ts +70 -0
- package/lib/types/cost/evidence/inventory.d.ts +44 -0
- package/lib/types/cost/evidence/pricing.d.ts +72 -0
- package/lib/types/cost/evidence/projects.d.ts +18 -0
- package/lib/types/cost/evidence/rules.d.ts +66 -0
- package/lib/types/cost/evidence/state.d.ts +38 -0
- package/lib/types/cost/evidence/thresholds.d.ts +68 -0
- package/lib/types/cost/evidence/types.d.ts +288 -0
- package/lib/types/cost/evidence/utilization.d.ts +37 -0
- package/lib/types/cost/history.d.ts +36 -0
- package/lib/types/cost/ledger.d.ts +97 -0
- package/lib/types/cost/normalize.d.ts +37 -0
- package/lib/types/cost/period-projection.d.ts +57 -0
- package/lib/types/cost/plan-check.d.ts +102 -0
- package/lib/types/cost/plan-db.d.ts +73 -0
- package/lib/types/cost/plan-types.d.ts +183 -0
- package/lib/types/cost/plan.d.ts +63 -0
- package/lib/types/cost/quote.d.ts +45 -0
- package/lib/types/cost/report.d.ts +136 -0
- package/lib/types/cost/resources.d.ts +108 -0
- package/lib/types/cost/routes.d.ts +38 -0
- package/lib/types/cost/scope.d.ts +42 -0
- package/lib/types/cost/types.d.ts +335 -0
- package/lib/types/cost/unit-prices-derive.d.ts +19 -0
- package/lib/types/cost/unit-prices.d.ts +23 -0
- package/lib/types/db.d.ts +228 -0
- package/lib/types/host-log.d.ts +7 -0
- package/lib/types/http.d.ts +42 -0
- package/lib/types/index.d.ts +30 -0
- package/lib/types/inventory.d.ts +286 -0
- package/lib/types/obs.d.ts +16 -0
- package/lib/types/org/aggregate.d.ts +36 -0
- package/lib/types/org/churn.d.ts +10 -0
- package/lib/types/org/orgs.d.ts +258 -0
- package/lib/types/org/routes.d.ts +28 -0
- package/lib/types/org-types.d.ts +156 -0
- package/lib/types/per-service.d.ts +39 -0
- package/lib/types/setup/blueprint-loader.d.ts +81 -0
- package/lib/types/setup/caller.d.ts +105 -0
- package/lib/types/setup/engine.d.ts +41 -0
- package/lib/types/setup/form-store.d.ts +13 -0
- package/lib/types/setup/nodes/n1-check.d.ts +14 -0
- package/lib/types/setup/nodes/n10-governance.d.ts +6 -0
- package/lib/types/setup/nodes/n11-infra.d.ts +6 -0
- package/lib/types/setup/nodes/n12-reconcile.d.ts +6 -0
- package/lib/types/setup/nodes/n2-region.d.ts +6 -0
- package/lib/types/setup/nodes/n3-blueprint.d.ts +6 -0
- package/lib/types/setup/nodes/n4-modules.d.ts +6 -0
- package/lib/types/setup/nodes/n5-details.d.ts +6 -0
- package/lib/types/setup/nodes/n6-plan.d.ts +6 -0
- package/lib/types/setup/nodes/n7-verify.d.ts +6 -0
- package/lib/types/setup/nodes/n8-approve.d.ts +6 -0
- package/lib/types/setup/nodes/n9-buildmode.d.ts +6 -0
- package/lib/types/setup/plan-state.d.ts +10 -0
- package/lib/types/setup/prompt-loader.d.ts +16 -0
- package/lib/types/setup/routes.d.ts +22 -0
- package/lib/types/setup/session-notify.d.ts +30 -0
- package/lib/types/setup/tools.d.ts +19 -0
- package/lib/types/setup/types.d.ts +157 -0
- package/lib/types/sse-bus.d.ts +23 -0
- package/lib/types/tools/config-facts.d.ts +16 -0
- package/lib/types/tools/cost-facts.d.ts +10 -0
- package/lib/types/tools/register.d.ts +18 -0
- package/lib/types/wb-conventions.d.ts +140 -0
- package/package.json +77 -4
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# 模块分层与多选规则(module-layers)
|
|
2
|
+
|
|
3
|
+
> 定义 Landing Zone 拆成哪些"模块包"、分几层、默认勾选、锁定规则、依赖联动。
|
|
4
|
+
> 把现有 28 个细粒度资源归并为 12 个模块包(多选粒度),分基础/增强/扩展三层。
|
|
5
|
+
>
|
|
6
|
+
> ⚠️ 选择形态:**分层多选**。基础层锁定必选,增强层默认不选可勾选,扩展层默认不选可勾选。
|
|
7
|
+
>
|
|
8
|
+
> 改模块清单/分层/默认/联动 → 改本文件。
|
|
9
|
+
> 消费方:arch-generator(按 selectedModules 守卫各 derive 块)、planner(moduleSelect 态展示+透传)。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 一、选择形态(分层多选)
|
|
14
|
+
|
|
15
|
+
- **基础层(base)**:LZ 地基,锁定必建,不可取消(用户能看到不能改)
|
|
16
|
+
- **增强层(enhanced)**:可选,默认不选,可逐项勾选
|
|
17
|
+
- **扩展层(extended)**:按需/付费,默认不选,可逐项勾选
|
|
18
|
+
- 每层内部支持多选;用户在增强层/扩展层可勾选
|
|
19
|
+
|
|
20
|
+
标准方案默认 moduleSelection = 基础层全选(锁定) + 增强层全不选 + 扩展层全不选(用户可勾选增强/扩展层模块)。
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 二、模块清单(12 包)
|
|
25
|
+
|
|
26
|
+
### 结构化定义(代码解析)
|
|
27
|
+
|
|
28
|
+
> ⚠️ 本代码块定义模块包清单 + layer + default + locked + 含资源(typeIds) + 联动。
|
|
29
|
+
> arch-generator 按 `selectedModules.has(<id>)` 守卫各 derive 块(不依赖 resources 映射,resources 仅供展示/review)。
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"modules": [
|
|
34
|
+
{ "id": "organization", "label": "组织创建", "layer": "base", "default": true, "locked": true, "resources": ["organization"] },
|
|
35
|
+
{ "id": "ou_structure", "label": "OU 结构(coreOu/applicationsOu)", "layer": "base", "default": true, "locked": true, "resources": ["coreOu", "applicationsOu"] },
|
|
36
|
+
{ "id": "accounts", "label": "账号创建(Core治理账号+业务调试账号)", "layer": "base", "default": true, "locked": true, "resources": ["shared_services_account", "log_archive_account", "security_account", "ops_account", "dev_account", "prod_account"], "note": "合并模块:默认参数(standard-baseline.md)只提供推荐账号清单,用户在 moduleDetail 可增删改任意账号(含取消所谓'核心'账号、新增自定义账号);spec.accounts 为真相源,arch-generator 遍历 spec.accounts 生成;取代 createDebugAccounts,向后兼容" },
|
|
37
|
+
{ "id": "trusted_services", "label": "可信服务 + 委托管理员", "layer": "base", "default": true, "locked": true, "resources": ["cts_trusted_service", "cts_delegated_admin", "config_trusted_service", "config_delegated_admin", "ic_trusted_service"] },
|
|
38
|
+
|
|
39
|
+
{ "id": "identity_center", "label": "Identity Center(实例+用户+组+权限集+分配)", "layer": "enhanced", "default": false, "locked": false, "resources": ["ic_instance", "ic_user", "ic_group", "ic_membership", "permission_set", "ps_policy_attach", "account_assignment"], "note": "可选,取消不影响其他(退为账号直登 iam 模式)" },
|
|
40
|
+
{ "id": "audit_logging", "label": "审计日志投递(CTS+Config+OBS)", "layer": "enhanced", "default": false, "locked": false, "resources": ["config_trust_agency", "obs_bucket_config", "cts_tracker", "config_recorder"] },
|
|
41
|
+
{ "id": "scp", "label": "SCP 策略防护(安全增强)", "layer": "enhanced", "default": false, "locked": false, "resources": ["scp_policy"], "note": "可选;推荐策略回传 code/attach 引用即可(content 全文由服务端从 scp-policies.json 唯一来源按 code 回填,防长参数),自定义新策略才传 content;绑定实体 root/OU/账号" },
|
|
42
|
+
|
|
43
|
+
{ "id": "vpc_network", "label": "VPC 网络规划(VPC+子网+NAT+EIP+RAM)", "layer": "extended", "default": false, "locked": false, "resources": ["vpc", "subnet", "eip", "nat_gateway", "ram_share"], "note": "形态由 networkTopology 决定(single/multi)" },
|
|
44
|
+
{ "id": "er_mesh", "label": "ER 企业路由器组网(ER+attachment)", "layer": "extended", "default": false, "locked": false, "resources": ["er_instance", "er_vpc_attachment"], "note": "仅 multi-vpc/er-mesh 形态有意义" },
|
|
45
|
+
{ "id": "cfw", "label": "CFW 云防火墙", "layer": "extended", "default": false, "locked": false, "resources": ["cfw_instance"] },
|
|
46
|
+
{ "id": "waf", "label": "WAF Web 应用防火墙", "layer": "extended", "default": false, "locked": false, "resources": ["waf"] },
|
|
47
|
+
{ "id": "aad", "label": "AAD 高级 DDoS 防护", "layer": "extended", "default": false, "locked": false, "resources": ["aad"] }
|
|
48
|
+
],
|
|
49
|
+
"defaults": {
|
|
50
|
+
"base": { "selectable": false, "selected": ["organization", "ou_structure", "accounts", "trusted_services"] },
|
|
51
|
+
"enhanced": { "selectable": true, "selected": [] },
|
|
52
|
+
"extended": { "selectable": true, "selected": [] }
|
|
53
|
+
},
|
|
54
|
+
"moduleDetail": {
|
|
55
|
+
"order": ["organization", "ou_structure", "accounts", "trusted_services", "identity_center", "audit_logging", "scp", "vpc_network", "er_mesh", "cfw", "waf", "aad"],
|
|
56
|
+
"rule": "moduleSelect 确认选哪些模块后,进入 moduleDetail 态,按 order 顺序逐个确认每个被选中模块的明细参数(无参数的跳过)",
|
|
57
|
+
"recommendedConfig": "knowledge/modules/recommended-rules.json (planner.ts getModuleRecommendedConfig 读 interactions[P1-4_<moduleId>].recommended;2026-11-13 从 interaction-config.md 迁出;recommended-config.md 已过时不消费)",
|
|
58
|
+
"items": {
|
|
59
|
+
"organization": { "params": [], "skip": true, "desc": "组织根,无需配置,自动创建" },
|
|
60
|
+
"ou_structure": { "params": ["ouList"], "paramAliases": { "ouList": ["ous"] }, "desc": "把账号分成几个组(OU),比如核心组、业务组", "recommendedConfig": true },
|
|
61
|
+
"accounts": { "params": ["accountNames", "buildDebugAccounts"], "desc": "要建哪些子账号(默认推荐6个,可增删改任意账号)", "removable": ["shared_services_account", "log_archive_account", "security_account", "ops_account", "dev_account", "prod_account"], "recommendedConfig": true },
|
|
62
|
+
"trusted_services": { "params": ["services", "delegatedAdmins"], "desc": "把哪些云服务的管理权下放给子账号(可信服务)", "recommendedConfig": true },
|
|
63
|
+
"identity_center": { "params": ["identitySource", "alias", "users", "groups", "permissionSets"], "desc": "怎么登录管理这些账号(统一身份中心:管理员用户、用户组、权限)", "recommendedConfig": true, "conditionalRequired": [ { "field": "users[0].email", "rule": "nonEmpty", "whenCloud": "icInstanceNotExists", "message": "IC 实例未创建,创建 IC 用户需提供有效邮箱(passwordMode=EMAIL,密码通过邮件下发,空邮箱会被 API 拒绝)" } ] },
|
|
64
|
+
"audit_logging": { "params": ["configBucketName", "ctsTrailName", "ctsBucketName"], "paramAliases": { "configBucketName": ["obsBucket.name"], "ctsTrailName": ["ctsTracker.trailName"], "ctsBucketName": ["ctsTracker.ctsBucketName"] }, "desc": "操作日志和资源变更记录存到哪(审计日志桶名和追踪器名)", "recommendedConfig": true },
|
|
65
|
+
"vpc_network": { "params": ["networkTopology", "vpcCidrs", "subnets"], "paramAliases": { "vpcCidrs": ["vpcs[*].cidr"], "subnets": ["vpcs[*].subnets[*]"] }, "desc": "每个账号的私有网络网段怎么划(几个VPC、用什么网段)", "recommendedConfig": true },
|
|
66
|
+
"er_mesh": { "params": ["erName", "erAsn"], "desc": "多个VPC怎么互通(企业路由器名称和编号)", "recommendedConfig": true },
|
|
67
|
+
"cfw": { "params": ["cfwEdition"], "paramAliases": { "cfwEdition": ["edition"] }, "desc": "云防火墙买哪个版本(标准版还是专业版)", "recommendedConfig": true },
|
|
68
|
+
"waf": { "params": ["wafEdition"], "paramAliases": { "wafEdition": ["edition"] }, "desc": "网站防护买哪个版本(入门版还是标准版)", "recommendedConfig": true },
|
|
69
|
+
"aad": { "params": ["aadEdition"], "paramAliases": { "aadEdition": ["edition"] }, "desc": "DDoS 高防规格(按防护峰值选)", "recommendedConfig": true },
|
|
70
|
+
"scp": { "params": ["policies"], "desc": "设哪些组织级安全规则(禁止做危险操作,比如禁止删日志账号、禁止开高危端口),规则绑到整个组织还是某个分组。推荐策略只回传 code 引用,content 由服务端回填", "recommendedConfig": true }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
> **架构决策字段(设计A)**:buildDebugAccounts(accounts 模块)/ identitySource(identity_center 模块)/ networkTopology(vpc_network 模块)是影响方案骨架的架构决策,不是普通模块参数。它们在 moduleDetail 确认时采集,经 applyModuleDetailParams 统一提升到 spec.requirements,是全流程唯一来源(proposing/verifying/approved/run 只从 spec 读,不从 requirements 顶级兼容)。standard 与 custom 方向的 spec 组装逻辑完全统一,区别仅在 moduleDetail 展示的 recommended 默认值不同。
|
|
77
|
+
|
|
78
|
+
> **条件必填(conditionalRequired)**:某些参数在特定云状态下才必填(非空)。moduleDetail 确认时,enforceOneByOne 先做 hasAllParams 常规校验(参数存在非 null),再查 conditionalRequired:条件命中(whenCloud 匹配 cloudState)且字段不满足 rule → 不推进,返回 validationError 提示。planner.ts 在 moduleDetail 态实时探测云状态(如 IC 实例是否已建),传 cloudState 给 enforceOneByOne。
|
|
79
|
+
> - `field`:参数内字段路径(如 `users[0].email`,支持数组下标)
|
|
80
|
+
> - `rule`:`nonEmpty`(非空字符串)/ `exists`(存在非 null)
|
|
81
|
+
> - `whenCloud`:云状态条件(如 `icInstanceNotExists` → cloudState.icInstanceExists===false)
|
|
82
|
+
> - `message`:校验失败时的用户提示
|
|
83
|
+
> - 用途:把"run 执行时 API 拒绝才发现"的问题前移到"moduleDetail 规划时主动采集",避免事后 adjusting 链式修复。
|
|
84
|
+
|
|
85
|
+
> **参数派生别名(paramAliases)**:声明参数键(`params`)与交互返回的推荐结构键(modules/recommended-rules.json 的 recommended,资源形态)可能不同名。AI 按推荐结构原样回传 moduleDetailParams 时,enforceOneByOne 会按 paramAliases 从结构对象中派生声明参数值(派生键与结构键并存写入,不删原键);派生后仍缺的参数不再静默不推进,而是返回 validationError 列出缺失键与传入键。
|
|
86
|
+
> - 路径语法:`a.b`(点路径)/ `a[*].b`(数组收集)/ `a[*].b[*]`(嵌套数组收集)
|
|
87
|
+
> - 例:audit_logging 传 `{obsBucket:{name:"config-bucket-x"},ctsTracker:{trailName:"system",ctsBucketName:"obs-cts-x"}}` → 自动派生 `configBucketName/ctsTrailName/ctsBucketName`
|
|
88
|
+
> - 同名回退:未命中别名路径时,在传入对象的一层子对象里找同名字段(如 `ctsTrailName ← ctsTracker.trailName` 天然命中)
|
|
89
|
+
> - 用途:消除 params 声明与 recommended 结构两套键名不一致导致的"确认不推进且无提示"问题(2026-11-13 audit_logging 静默拒绝事故)。
|
|
90
|
+
|
|
91
|
+
### 人读总表
|
|
92
|
+
|
|
93
|
+
| # | 模块包 | 层 | 默认 | 锁定 | 含资源 | 路径 | 现状 |
|
|
94
|
+
|---|---|---|---|---|---|---|---|
|
|
95
|
+
| 1 | 组织创建 | 基础 | ✅默认选 | 🔒锁定 | Organization | A | ✅ |
|
|
96
|
+
| 2 | OU 结构 | 基础 | ✅默认选 | 🔒锁定 | Core OU + Applications OU | A | ✅ |
|
|
97
|
+
| 3 | 账号创建(合并) | 基础 | ✅默认选 | 🔒锁定 | Core治理账号(锁定)+业务调试账号(可解除) | A | ✅ |
|
|
98
|
+
| 4 | 可信服务+委托管理员 | 基础 | ✅默认选 | 🔒锁定 | CTS/Config/IC 可信服务 + 委托 | A | ✅ |
|
|
99
|
+
| 5 | Identity Center | 增强 | ☐默认不选 | 可选 | IC实例+用户+组+权限集+分配 | A | ✅(取消退 iam 直登) |
|
|
100
|
+
| 6 | 审计日志投递 | 增强 | ☐默认不选 | 可选 | CTS追踪器+Config记录器+OBS+委托 | B | ✅ |
|
|
101
|
+
| 7 | SCP 策略防护 | 增强 | ☐默认不选 | 可选 | 服务控制策略(安全增强) | A | ✅ |
|
|
102
|
+
| 8 | VPC 网络规划 | 扩展 | ☐默认不选 | 可选 | VPC+子网+NAT+EIP+RAM | B | ✅ |
|
|
103
|
+
| 9 | ER 企业路由器组网 | 扩展 | ☐默认不选 | 可选 | ER+VPC attachment | B | ✅ |
|
|
104
|
+
| 10 | CFW 云防火墙 | 扩展 | ☐默认不选 | 可选 | CFW 实例 | B | ✅ |
|
|
105
|
+
| 11 | WAF Web 应用防火墙 | 扩展 | ☐默认不选 | 可选 | WAF 实例 | B | ✅ |
|
|
106
|
+
| 12 | AAD 高级 DDoS 防护 | 扩展 | ☐默认不选 | 可选 | AAD 实例 | B | ✅ |
|
|
107
|
+
|
|
108
|
+
### 分层决策记录(依据用户最新规划)
|
|
109
|
+
|
|
110
|
+
- **基础层(锁定必选)**:组织/OU/账号创建/可信服务。LZ 地基,不可取消
|
|
111
|
+
- **增强层(可选默认不选)**:Identity Center/审计日志投递/SCP。默认不选,可逐项勾选
|
|
112
|
+
- **扩展层(可选默认不选)**:VPC网络/ER组网/CFW/WAF/AAD。按需付费,默认不选可勾选
|
|
113
|
+
- **账号创建(合并模块)**:Core 治理账号(共享/日志/安全/运维)+ 业务调试账号(Dev+Prod)合并为一个模块。模块整体锁定(基础层),但内部业务调试账号可解除(moduleDetail 态可勾掉)
|
|
114
|
+
- **Identity Center**:增强层推荐,取消完全不影响其他(退为账号直登 iam 模式)
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 三、依赖联动规则
|
|
119
|
+
|
|
120
|
+
> 用户多选时的联动校验(planner 接收 moduleSelection 时校验)。
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"dependencies": [
|
|
125
|
+
{ "module": "er_mesh", "requires": "vpc_network", "action": "autoSelect", "reason": "ER 依赖 VPC attachment,选 ER 自动选 VPC;取消 VPC 则 ER 自动取消" },
|
|
126
|
+
{ "module": "cfw", "requires": "vpc_network", "action": "warn", "reason": "CFW 依赖 VPC,建议同时选 VPC 网络规划" },
|
|
127
|
+
{ "module": "audit_logging", "requires": "trusted_services", "action": "satisfied", "reason": "CTS 委托给 LogArchive,Config 委托给 Security;trusted_services 基础层锁定,通常满足" },
|
|
128
|
+
{ "module": "identity_center", "requires": "trusted_services", "action": "satisfied", "reason": "IC 可信服务在基础层 trusted_services 内,默认满足" }
|
|
129
|
+
],
|
|
130
|
+
"locked": ["organization", "ou_structure", "accounts", "trusted_services"]
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> 注:`locked` 列表的 accounts 模块整体锁定(基础层,用户不能取消该模块),但模块**内部**账号清单完全由用户决定——moduleDetail 态确认账号创建时,默认推荐6个账号(standard-baseline.md),用户可增删改任意账号(含取消"核心"账号、新增自定义账号如 prod1)。spec.accounts 是真相源,arch-generator 遍历 spec.accounts 生成。
|
|
135
|
+
|
|
136
|
+
- `autoSelect`:选本模块自动选依赖;取消依赖则本模块自动取消(双向)
|
|
137
|
+
- `warn`:依赖未选时仅警告,不阻断
|
|
138
|
+
- `satisfied`:依赖在基础层锁定,通常满足(无需校验)
|
|
139
|
+
- `locked`:基础层模块,用户试图取消时拒绝
|
|
140
|
+
|
|
141
|
+
> 注:identity_center 取消完全不影响其他模块(账号/组织照建),这是用户明确要求——IC 是"附加身份层",不是账号/组织的前置。
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 四、合规建议映射(已删除 — 跟模块选择走)
|
|
146
|
+
|
|
147
|
+
> v3 调整:合规等级(complianceLevel)交互已删除,不再自动触发 cfw-auto-enable,也不再"建议勾选"。
|
|
148
|
+
> CFW/WAF/AAD 防护完全由用户在 moduleSelect 自主勾选 → moduleDetail 确认 edition。
|
|
149
|
+
> complianceLevel 降级为可选传的纯展示字段,不影响资源生成。
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## 五、与现有维度的协同
|
|
154
|
+
|
|
155
|
+
| 现有维度 | 与 moduleSelection 的关系 |
|
|
156
|
+
|---|---|
|
|
157
|
+
| networkTopology | 决定 vpc_network 模块的内部形态(single-vpc=1 VPC;multi-vpc=4 VPC+子网+NAT/EIP+RAM)。vpc_network 未选则 networkTopology 不生效 |
|
|
158
|
+
| createDebugAccounts | 向后兼容别名:=true 等价于勾 accounts 模块且建调试账号;=false 等价于不建调试账号。planner 读取时做映射 |
|
|
159
|
+
| complianceLevel | v3 已删除交互,降级为可选传的纯展示字段(review 展示"合规要求:xxx"),不影响资源生成。CFW/WAF/AAD 跟模块选择走 |
|
|
160
|
+
| identitySource | 与 identity_center 模块协同:选 identity_center → 建 IC 全套(受 identitySource 决定 local/federated);取消 identity_center → 退为 iam 直登(不建 IC) |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 六、维护提醒
|
|
165
|
+
|
|
166
|
+
- 加/减模块包:改"二、模块清单"的 modules 数组 + 人读总表,同步 arch-generator 的 derive 守卫
|
|
167
|
+
- 改分层/默认:改 modules 的 layer/default/locked 字段 + defaults
|
|
168
|
+
- 改联动:改"三、依赖联动规则"
|
|
169
|
+
- SCP 策略防护已实现(resource-types.json 有 scp_policy/scp_policy_attach,scp-policies.json 有推荐策略)
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# 企业路由器(er)
|
|
2
|
+
|
|
3
|
+
> ER(Enterprise Router)是多 VPC 中心互联的 hub。
|
|
4
|
+
> 标准 LZ 网络块的核心——各业务 VPC 通过 ER 互通。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 一、是什么 / 为什么需要
|
|
9
|
+
|
|
10
|
+
ER 是企业级路由器,放某个账号(通常 SharedServices)做中心 hub。其他账号的 VPC 通过 VPC attachment 挂接到 ER,实现跨账号 VPC 互通,无需两两建对等连接。
|
|
11
|
+
|
|
12
|
+
**为什么需要**:多账号场景下,两两 VPC Peering 是 N² 复杂度;ER 是星型 hub,线性扩展,且支持路由策略。
|
|
13
|
+
|
|
14
|
+
## 二、里面应该有什么(子结构)
|
|
15
|
+
|
|
16
|
+
| 资源 | 职责 | 必备 |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| ER 实例 | 企业路由器 | ✅ |
|
|
19
|
+
| VPC attachment | VPC 接入 ER | ✅(每个要互通的 VPC 一个) |
|
|
20
|
+
| ER 路由表 | 路由策略 | ✅(自动) |
|
|
21
|
+
|
|
22
|
+
### 拓扑
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
ER (SharedServices 账号, ASN 64512)
|
|
26
|
+
/ | | \
|
|
27
|
+
VPC共享 VPC-dev VPC-prod VPC-ops
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 三、注意点 / 最佳实践 / 坑
|
|
31
|
+
|
|
32
|
+
### 约束
|
|
33
|
+
- **ER 是区域服务**,host 带 `er.<region>.`
|
|
34
|
+
- **ER 需指定 ASN**:私有 ASN 范围(64512-65534),默认 64512
|
|
35
|
+
- **VPC attachment 需 ER 接入子网**:VPC 要先建好 ER 接入子网(/29)
|
|
36
|
+
|
|
37
|
+
### 最佳实践
|
|
38
|
+
- ER 放 SharedServices(中心账号,网络 hub)
|
|
39
|
+
- 各业务 VPC 都挂接 ER(全互通)
|
|
40
|
+
- ASN 用 64512(私有范围,无冲突)
|
|
41
|
+
|
|
42
|
+
### 坑
|
|
43
|
+
- **attachment 依赖 VPC 的 ER 接入子网**:子网没建 attachment 失败
|
|
44
|
+
- **跨账号 attachment 需 RAM 共享**:ER 在 SharedServices,VPC 在业务账号,需先开 RAM 组织共享
|
|
45
|
+
|
|
46
|
+
## 四、费用属性(预计,仅作方案决策参考,非最终账单)
|
|
47
|
+
| 项目 | 月费(元,预计) | 说明 |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| ER 实例费 | 200 | 企业路由器实例费(预估,仅供参考) |
|
|
50
|
+
|
|
51
|
+
## 五、创建依赖
|
|
52
|
+
|
|
53
|
+
### 前置
|
|
54
|
+
- **SharedServices 账号已建**(ER 建在此账号)
|
|
55
|
+
- **VPC + ER 接入子网已建**(attachment 依赖)
|
|
56
|
+
- **RAM 组织共享已启用**(跨账号 attachment 依赖)
|
|
57
|
+
|
|
58
|
+
### 被依赖
|
|
59
|
+
- 无(ER 是网络末端,业务 VPC 挂上来即可互通)
|
|
60
|
+
|
|
61
|
+
## 六、怎么查接口(指向 ops-deploy)
|
|
62
|
+
|
|
63
|
+
| 查什么 | productshort | 关键 API |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| ER 实例 | ER | CreateInstance / ListInstances |
|
|
66
|
+
| VPC attachment | ER | CreateVpcAttachment / ListVpcAttachments |
|
|
67
|
+
|
|
68
|
+
**查法**:`apiexplorer('ER')` → compact 查契约 → `apiexplorerHost('ER', region)`。
|
|
69
|
+
> ER 接口含 project_id,需 assume 到 SharedServices 账号查 project_id。
|
|
70
|
+
|
|
71
|
+
## 七、资源探测指引
|
|
72
|
+
|
|
73
|
+
> ⚠️ 本节定义该资源如何探测是否已存在。
|
|
74
|
+
> ER 是成员账号资源(建在 SharedServices 账号),探测需 assume。
|
|
75
|
+
> path 含 {project_id},需先 query-project 查 project_id。
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"probes": [
|
|
80
|
+
{
|
|
81
|
+
"typeId": "er_instance",
|
|
82
|
+
"service": "ER",
|
|
83
|
+
"hostMode": "regional",
|
|
84
|
+
"steps": [
|
|
85
|
+
{
|
|
86
|
+
"step": 1,
|
|
87
|
+
"action": "query-host",
|
|
88
|
+
"productshort": "ER",
|
|
89
|
+
"via": "apiexplorerHost",
|
|
90
|
+
"output": "host"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"step": 2,
|
|
94
|
+
"action": "query-project",
|
|
95
|
+
"output": "projectId",
|
|
96
|
+
"save": true,
|
|
97
|
+
"depends": [
|
|
98
|
+
"host"
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"step": 3,
|
|
103
|
+
"action": "query-list",
|
|
104
|
+
"method": "GET",
|
|
105
|
+
"api": "ListEnterpriseRouters",
|
|
106
|
+
"path": "/v3/{projectId}/enterprise-router/instances",
|
|
107
|
+
"hostKey": "host",
|
|
108
|
+
"output": "instances",
|
|
109
|
+
"save": true,
|
|
110
|
+
"depends": [
|
|
111
|
+
"host",
|
|
112
|
+
"projectId"
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"match": {
|
|
117
|
+
"field": "instances[].name",
|
|
118
|
+
"expect": "equals-semanticParam",
|
|
119
|
+
"semField": "name"
|
|
120
|
+
},
|
|
121
|
+
"existsStatus": "historical_exists",
|
|
122
|
+
"existsDetail": "ER {name} 已存在,复用",
|
|
123
|
+
"pendingDetail": "ER {name} 未创建,待建"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"typeId": "er_vpc_attachment",
|
|
127
|
+
"service": "ER",
|
|
128
|
+
"hostMode": "regional",
|
|
129
|
+
"steps": [
|
|
130
|
+
{
|
|
131
|
+
"step": 1,
|
|
132
|
+
"action": "query-host",
|
|
133
|
+
"productshort": "ER",
|
|
134
|
+
"via": "apiexplorerHost",
|
|
135
|
+
"output": "erHost"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"step": 2,
|
|
139
|
+
"action": "query-project",
|
|
140
|
+
"output": "projectId",
|
|
141
|
+
"save": true,
|
|
142
|
+
"depends": [
|
|
143
|
+
"erHost"
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"step": 3,
|
|
148
|
+
"action": "query-list",
|
|
149
|
+
"method": "GET",
|
|
150
|
+
"api": "ListEnterpriseRouters",
|
|
151
|
+
"path": "/v3/{projectId}/enterprise-router/instances",
|
|
152
|
+
"hostKey": "erHost",
|
|
153
|
+
"extract": "instances[0].instance_id",
|
|
154
|
+
"output": "erId",
|
|
155
|
+
"save": true,
|
|
156
|
+
"depends": [
|
|
157
|
+
"erHost",
|
|
158
|
+
"projectId"
|
|
159
|
+
],
|
|
160
|
+
"paramSources": {
|
|
161
|
+
"projectId": {
|
|
162
|
+
"source": "priorQuery"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"step": 4,
|
|
168
|
+
"action": "query-list",
|
|
169
|
+
"method": "GET",
|
|
170
|
+
"api": "ListAttachments",
|
|
171
|
+
"path": "/v3/{projectId}/enterprise-router/{erId}/attachments",
|
|
172
|
+
"hostKey": "erHost",
|
|
173
|
+
"output": "attachments",
|
|
174
|
+
"save": true,
|
|
175
|
+
"depends": [
|
|
176
|
+
"erHost",
|
|
177
|
+
"projectId",
|
|
178
|
+
"erId"
|
|
179
|
+
],
|
|
180
|
+
"paramSources": {
|
|
181
|
+
"projectId": {
|
|
182
|
+
"source": "priorQuery"
|
|
183
|
+
},
|
|
184
|
+
"erId": {
|
|
185
|
+
"source": "priorQuery",
|
|
186
|
+
"queryApi": "ListEnterpriseRouters",
|
|
187
|
+
"extract": "instances[0].instance_id"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"match": {
|
|
193
|
+
"field": "attachments.attachments",
|
|
194
|
+
"expect": "exists-non-empty",
|
|
195
|
+
"idFields": [
|
|
196
|
+
"attachment_id"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
"absentWhen": {
|
|
200
|
+
"httpStatus": 404
|
|
201
|
+
},
|
|
202
|
+
"existsStatus": "historical_exists",
|
|
203
|
+
"existsDetail": "ER VPC attachment 已存在,复用",
|
|
204
|
+
"pendingDetail": "ER VPC attachment 未创建,待建(ER 实例未建时参数门自动判待建)"
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
}```
|
|
208
|
+
|
|
209
|
+
> 字段说明:
|
|
210
|
+
> - ER 是区域服务,hostMode=regional(host 带 `er.<region>.`)
|
|
211
|
+
> - query-project:用 assumed.getProjectId(region) 查 SharedServices 账号 project_id
|
|
212
|
+
> - match:ER 按 name 匹配(如 er-enterprise-lz)
|
|
213
|
+
> - er_vpc_attachment 依赖 er_id + vpc_id(跨实例),暂未探测(保守标 pending)
|
|
214
|
+
|
|
215
|
+
## 八、演示示例
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
ER: er-enterprise-lz (SharedServices, ASN 64512)
|
|
219
|
+
attachment: er-attach-shared (VPC共享接入)
|
|
220
|
+
→ 各业务 VPC 经 ER 互通
|
|
221
|
+
费用: ~200 元/月
|
|
222
|
+
```
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# NAT 与 EIP(nat-eip)
|
|
2
|
+
|
|
3
|
+
> NAT 网关 + EIP 提供业务账号的公网出口。
|
|
4
|
+
> NAT 做源地址转换,EIP 提供带宽。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 一、是什么 / 为什么需要
|
|
9
|
+
|
|
10
|
+
- **EIP(Elastic IP)**:弹性公网 IP,提供公网访问能力 + 带宽
|
|
11
|
+
- **NAT 网关**:让 VPC 内资源共用 EIP 出公网(源地址转换 SNAT)
|
|
12
|
+
|
|
13
|
+
**为什么需要**:业务账号内资源(ECS)需访问公网(拉镜像/更新)或被公网访问;不直接给每个 ECS 挂 EIP(贵且暴露),用 NAT+EIP 集中出口。
|
|
14
|
+
|
|
15
|
+
## 二、里面应该有什么(子结构)
|
|
16
|
+
|
|
17
|
+
| 资源 | 职责 | 必备 |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| EIP | 公网 IP + 带宽 | ✅(每需出口的账号一个) |
|
|
20
|
+
| NAT 网关 | SNAT 出口 | ✅(配 EIP) |
|
|
21
|
+
| SNAT 规则 | NAT 用 EIP 做源转换 | ✅(自动/手动) |
|
|
22
|
+
|
|
23
|
+
## 三、注意点 / 最佳实践 / 坑
|
|
24
|
+
|
|
25
|
+
### 约束
|
|
26
|
+
- **EIP/NAT 是区域服务**,host 带 `eip.<region>.` / `nat.<region>.`
|
|
27
|
+
- **NAT 需挂子网**:NAT 建在 VPC 的某子网
|
|
28
|
+
- **EIP 需指定带宽**:5_bgp 按带宽(5Mbps)或按流量
|
|
29
|
+
|
|
30
|
+
### 最佳实践
|
|
31
|
+
- 每业务账号(Dev/Prod)各一套 NAT+EIP(隔离出口)
|
|
32
|
+
- 带宽按需:测试 5Mbps,生产按业务量
|
|
33
|
+
- NAT 用小型(够测试/小生产)
|
|
34
|
+
|
|
35
|
+
### 坑
|
|
36
|
+
- **NAT 依赖子网 + EIP**:先建 EIP 和子网,再建 NAT
|
|
37
|
+
- **EIP 绑 NAT 后不能同时绑 ECS**(一个 EIP 一个目标)
|
|
38
|
+
|
|
39
|
+
## 四、费用属性(预计,仅作方案决策参考,非最终账单)
|
|
40
|
+
| 项目 | 月费(元,预计) | 说明 |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| EIP(5_bgp,5Mbps) | 23 | 按带宽计费(预估 5Mbps,仅供参考) |
|
|
43
|
+
| NAT 网关(小型) | 23 | NAT 网关小型规格(预估,仅供参考) |
|
|
44
|
+
|
|
45
|
+
## 五、创建依赖
|
|
46
|
+
|
|
47
|
+
### 前置
|
|
48
|
+
- **VPC + 子网已建**(NAT 挂子网)
|
|
49
|
+
- **EIP 已建**(NAT 用 EIP 出口)
|
|
50
|
+
- **成员账号已建**(assume)
|
|
51
|
+
|
|
52
|
+
### 被依赖
|
|
53
|
+
- 无(出口层末端)
|
|
54
|
+
|
|
55
|
+
## 六、怎么查接口(指向 ops-deploy)
|
|
56
|
+
|
|
57
|
+
| 查什么 | productshort | 关键 API |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| EIP | EIP | CreatePublicip / ListPublicips |
|
|
60
|
+
| NAT 网关 | NAT | CreateNatGateway / ListNatGateways |
|
|
61
|
+
| SNAT 规则 | NAT | CreateSnatRule |
|
|
62
|
+
|
|
63
|
+
**查法**:`apiexplorer('EIP')` / `apiexplorer('NAT')` → compact → `apiexplorerHost(productshort, region)`。
|
|
64
|
+
|
|
65
|
+
## 七、资源探测指引
|
|
66
|
+
|
|
67
|
+
> ⚠️ 本节定义该资源如何探测是否已存在。
|
|
68
|
+
> EIP/NAT 是成员账号资源,探测需 assume 进归属账号(拿临时凭据签名)。
|
|
69
|
+
> path 含 {project_id},需先 query-project 查成员账号的 project_id。
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"probes": [
|
|
74
|
+
{
|
|
75
|
+
"typeId": "eip",
|
|
76
|
+
"service": "EIP",
|
|
77
|
+
"hostMode": "regional",
|
|
78
|
+
"steps": [
|
|
79
|
+
{ "step": 1, "action": "query-host", "productshort": "EIP", "via": "apiexplorerHost", "output": "host" },
|
|
80
|
+
{ "step": 2, "action": "query-project", "output": "projectId", "save": true, "depends": ["host"] },
|
|
81
|
+
{ "step": 3, "action": "query-list", "method": "GET", "api": "ListPublicips", "path": "/v1/{projectId}/publicips", "hostKey": "host", "output": "publicips", "save": true, "depends": ["host", "projectId"] }
|
|
82
|
+
],
|
|
83
|
+
"match": { "field": "publicips", "expect": "exists-non-empty" },
|
|
84
|
+
"existsStatus": "historical_exists",
|
|
85
|
+
"existsDetail": "EIP 已存在,复用",
|
|
86
|
+
"pendingDetail": "EIP 未创建,待建"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"typeId": "nat_gateway",
|
|
90
|
+
"service": "NAT",
|
|
91
|
+
"hostMode": "regional",
|
|
92
|
+
"steps": [
|
|
93
|
+
{ "step": 1, "action": "query-host", "productshort": "NAT", "via": "apiexplorerHost", "output": "host" },
|
|
94
|
+
{ "step": 2, "action": "query-project", "output": "projectId", "save": true, "depends": ["host"] },
|
|
95
|
+
{ "step": 3, "action": "query-list", "method": "GET", "api": "ListNatGateways", "path": "/v2/{projectId}/nat_gateways", "hostKey": "host", "output": "nat_gateways", "save": true, "depends": ["host", "projectId"] }
|
|
96
|
+
],
|
|
97
|
+
"match": { "field": "nat_gateways", "expect": "exists-non-empty" },
|
|
98
|
+
"existsStatus": "historical_exists",
|
|
99
|
+
"existsDetail": "NAT 已存在,复用",
|
|
100
|
+
"pendingDetail": "NAT 未创建,待建"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> 字段说明:
|
|
107
|
+
> - EIP/NAT 是区域服务,hostMode=regional(host 带 `<region>.`)
|
|
108
|
+
> - query-project:用 assumed.getProjectId(region) 查成员账号 project_id
|
|
109
|
+
> - EIP 无 name 字段,用 exists-non-empty 粗判(账号下有 EIP 即视为已存在,不精确匹配)
|
|
110
|
+
> - NAT 同理(按账号下有 NAT 粗判;精确匹配需 router_id=VPC id,属跨实例依赖,后续扩展)
|
|
111
|
+
|
|
112
|
+
## 八、演示示例
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
Dev 账号:
|
|
116
|
+
EIP: eip-dev-egress (5_bgp, 5Mbps, ~23元/月)
|
|
117
|
+
NAT: nat-gateway-dev-egress (小型, ~23元/月)
|
|
118
|
+
SNAT: 用 eip-dev-egress 出公网
|
|
119
|
+
|
|
120
|
+
Prod 账号: 同上(eip-prod-egress / nat-gateway-prod-egress)
|
|
121
|
+
|
|
122
|
+
费用: 每账号 46元/月,Dev+Prod = 92元/月
|
|
123
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# RAM 组织共享(ram-share)
|
|
2
|
+
|
|
3
|
+
> RAM(Resource Access Manager)组织共享让跨账号资源可见。
|
|
4
|
+
> ER 跨账号 attachment 的前置。
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 一、是什么 / 为什么需要
|
|
9
|
+
|
|
10
|
+
RAM 组织共享启用后,组织内账号间可共享资源(如 ER)。无需逐对建立共享关系,组织级一键启用。
|
|
11
|
+
|
|
12
|
+
**为什么需要**:ER 在 SharedServices,业务 VPC 在各业务账号,跨账号 attachment 要求业务账号能"看到"SharedServices 的 ER——RAM 组织共享实现这个可见性。
|
|
13
|
+
|
|
14
|
+
## 二、里面应该有什么(子结构)
|
|
15
|
+
|
|
16
|
+
| 资源 | 职责 | 必备 |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| RAM 组织共享启用 | 组织级资源共享开关 | ✅(多VPC+ER时) |
|
|
19
|
+
|
|
20
|
+
## 三、注意点 / 最佳实践 / 坑
|
|
21
|
+
|
|
22
|
+
### 约束
|
|
23
|
+
- **RAM 是全局服务**,host 不带区域前缀
|
|
24
|
+
- **启用是组织级操作**:管理账号执行,对全组织生效
|
|
25
|
+
|
|
26
|
+
### 最佳实践
|
|
27
|
+
- 多 VPC + ER 场景必启
|
|
28
|
+
- 单 VPC 场景不需要
|
|
29
|
+
|
|
30
|
+
### 坑
|
|
31
|
+
- **查询接口可能 404**:`ListResourceShareOrganizationsEnabled` 在某些环境返回 APIGW.0101(API 未发布),这不代表资源不存在,需用别的判断方式或容错
|
|
32
|
+
|
|
33
|
+
## 三·五、费用属性(版本基价,沟通口径)
|
|
34
|
+
|
|
35
|
+
> RAM(资源共享)为**免费资源**(2026-11-12 确认):组织内共享不产生费用。
|
|
36
|
+
> 方案费用预估中 RAM 按 0 元计。
|
|
37
|
+
|
|
38
|
+
## 四、创建依赖
|
|
39
|
+
|
|
40
|
+
### 前置
|
|
41
|
+
- **Organization 已建**
|
|
42
|
+
|
|
43
|
+
### 被依赖
|
|
44
|
+
- **ER 跨账号 VPC attachment**(业务 VPC 接入 SharedServices 的 ER)
|
|
45
|
+
|
|
46
|
+
## 五、怎么查接口(指向 ops-deploy)
|
|
47
|
+
|
|
48
|
+
| 查什么 | productshort | 关键 API |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| 组织共享状态 | RAM | ShowOrganizationShare |
|
|
51
|
+
| 启用共享 | RAM | EnableOrganizationShare |
|
|
52
|
+
|
|
53
|
+
**查法**:`apiexplorer('RAM')` → compact → `apiexplorerHost('RAM', region)`(全局服务)。
|
|
54
|
+
> RAM 全局服务,host 不带区域前缀(`ram.myhuaweicloud.com`)。
|
|
55
|
+
|
|
56
|
+
## 六、资源探测指引
|
|
57
|
+
|
|
58
|
+
> ⚠️ 本节定义该资源如何探测是否已存在。
|
|
59
|
+
> RAM 组织共享是管理账号级(全局服务),用 caller.openapiRequest(MCP,不需 assume)。
|
|
60
|
+
> ShowOrganizationShare 返回组织共享是否启用。
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"probes": [
|
|
65
|
+
{
|
|
66
|
+
"typeId": "ram_share",
|
|
67
|
+
"service": "RAM",
|
|
68
|
+
"hostMode": "global",
|
|
69
|
+
"steps": [
|
|
70
|
+
{ "step": 1, "action": "query-host", "productshort": "RAM", "via": "apiexplorerHost", "output": "host" },
|
|
71
|
+
{ "step": 2, "action": "query-list", "method": "GET", "api": "ShowOrganizationShare", "path": "/v1/organization-share", "hostKey": "host", "output": "organization_share", "save": true, "depends": ["host"] }
|
|
72
|
+
],
|
|
73
|
+
"match": { "field": "organization_share.enabled", "expect": "exists-non-empty" },
|
|
74
|
+
"existsStatus": "historical_exists",
|
|
75
|
+
"existsDetail": "RAM 组织共享已启用,复用",
|
|
76
|
+
"pendingDetail": "RAM 组织共享未启用,待建"
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
> 字段说明:
|
|
83
|
+
> - RAM 全局服务,hostMode=global(host 不带区域前缀)
|
|
84
|
+
> - ShowOrganizationShare 返回 `{organization_share: {enabled: true/false}}`,match 检查 enabled 非空
|
|
85
|
+
> - 若 enabled=true → historical_exists;若 false 或无 → pending
|
|
86
|
+
|
|
87
|
+
## 七、演示示例
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
多VPC+ER 场景: RAM 组织共享 = enabled
|
|
91
|
+
单VPC 场景: 不需要
|
|
92
|
+
```
|