@huawei-iac-tools/landingzone-workbench 0.0.0-stage → 0.0.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.
Files changed (246) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +85 -2
  3. package/cordis.patch.yml +21 -0
  4. package/knowledge/account-qualification.md +128 -0
  5. package/knowledge/blueprints/_base/blueprint.json +481 -0
  6. package/knowledge/blueprints/_base/defaults.json +127 -0
  7. package/knowledge/blueprints/foundation-lz/blueprint.json +43 -0
  8. package/knowledge/blueprints/foundation-lz/defaults.json +47 -0
  9. package/knowledge/blueprints/full-lz/blueprint.json +11 -0
  10. package/knowledge/blueprints/full-lz/defaults.json +8 -0
  11. package/knowledge/config.json +43 -0
  12. package/knowledge/error-rules.json +14 -0
  13. package/knowledge/ic-policies.json +21 -0
  14. package/knowledge/modules/account-structure.md +101 -0
  15. package/knowledge/modules/compliance/config-rms.md +212 -0
  16. package/knowledge/modules/compliance/cts.md +179 -0
  17. package/knowledge/modules/compliance/obs-lts.md +155 -0
  18. package/knowledge/modules/ic-policies.json +21 -0
  19. package/knowledge/modules/identity-center.md +603 -0
  20. package/knowledge/modules/module-layers.md +169 -0
  21. package/knowledge/modules/network/er.md +222 -0
  22. package/knowledge/modules/network/nat-eip.md +123 -0
  23. package/knowledge/modules/network/ram-share.md +92 -0
  24. package/knowledge/modules/network/vpc-subnet.md +142 -0
  25. package/knowledge/modules/organization-security/scp.md +122 -0
  26. package/knowledge/modules/organizations.md +212 -0
  27. package/knowledge/modules/recommended-config.md +157 -0
  28. package/knowledge/modules/recommended-rules.json +175 -0
  29. package/knowledge/modules/scp-policies.json +111 -0
  30. package/knowledge/modules/security/aad.md +94 -0
  31. package/knowledge/modules/security/cfw.md +105 -0
  32. package/knowledge/modules/security/waf.md +110 -0
  33. package/knowledge/param-mappings.json +133 -0
  34. package/knowledge/prompts.md +83 -0
  35. package/knowledge/resource-types.json +1162 -0
  36. package/knowledge/scp-policies.json +111 -0
  37. package/knowledge/state-machine.md +33 -0
  38. package/lib/client.js +21 -0
  39. package/lib/index.js +28592 -0
  40. package/lib/types/account-role.d.ts +19 -0
  41. package/lib/types/account-scope.d.ts +10 -0
  42. package/lib/types/agency.d.ts +38 -0
  43. package/lib/types/client/DropdownSelect.d.ts +49 -0
  44. package/lib/types/client/LoginGate.d.ts +20 -0
  45. package/lib/types/client/PanelIcon.d.ts +11 -0
  46. package/lib/types/client/WorkbenchShell.d.ts +21 -0
  47. package/lib/types/client/account-role.d.ts +15 -0
  48. package/lib/types/client/credential-status.d.ts +15 -0
  49. package/lib/types/client/huawei-mark.d.ts +37 -0
  50. package/lib/types/client/index.d.ts +26 -0
  51. package/lib/types/client/layout-ref.d.ts +23 -0
  52. package/lib/types/client/pages/ConfigPage/AdviceCard.d.ts +26 -0
  53. package/lib/types/client/pages/ConfigPage/AuditBar.d.ts +21 -0
  54. package/lib/types/client/pages/ConfigPage/ChangeSummaryCard.d.ts +22 -0
  55. package/lib/types/client/pages/ConfigPage/ChangesCard.d.ts +27 -0
  56. package/lib/types/client/pages/ConfigPage/ComplianceDetail.d.ts +25 -0
  57. package/lib/types/client/pages/ConfigPage/ComplianceSummaryCard.d.ts +31 -0
  58. package/lib/types/client/pages/ConfigPage/FindingsCard.d.ts +21 -0
  59. package/lib/types/client/pages/ConfigPage/GlossaryDrawer.d.ts +17 -0
  60. package/lib/types/client/pages/ConfigPage/OrgComplianceDetail.d.ts +15 -0
  61. package/lib/types/client/pages/ConfigPage/Pager.d.ts +32 -0
  62. package/lib/types/client/pages/ConfigPage/ResourceDrawer.d.ts +26 -0
  63. package/lib/types/client/pages/ConfigPage/ResourcesTable.d.ts +35 -0
  64. package/lib/types/client/pages/ConfigPage/RollupPanel.d.ts +17 -0
  65. package/lib/types/client/pages/ConfigPage/RuleDetailDrawer.d.ts +23 -0
  66. package/lib/types/client/pages/ConfigPage/StatusCards.d.ts +26 -0
  67. package/lib/types/client/pages/ConfigPage/UncoveredDialog.d.ts +22 -0
  68. package/lib/types/client/pages/ConfigPage/config-api.d.ts +101 -0
  69. package/lib/types/client/pages/ConfigPage/config-store.d.ts +57 -0
  70. package/lib/types/client/pages/ConfigPage/index.d.ts +21 -0
  71. package/lib/types/client/pages/ConfigPage/paging.d.ts +46 -0
  72. package/lib/types/client/pages/ConfigPage/scope-options.d.ts +51 -0
  73. package/lib/types/client/pages/CostPage/AccountAllocation.d.ts +24 -0
  74. package/lib/types/client/pages/CostPage/AccountBars.d.ts +20 -0
  75. package/lib/types/client/pages/CostPage/AccountColumns.d.ts +24 -0
  76. package/lib/types/client/pages/CostPage/AccountDonut.d.ts +18 -0
  77. package/lib/types/client/pages/CostPage/AccountSwitcher.d.ts +25 -0
  78. package/lib/types/client/pages/CostPage/AdviceCard.d.ts +43 -0
  79. package/lib/types/client/pages/CostPage/AdviceFindings.d.ts +43 -0
  80. package/lib/types/client/pages/CostPage/BillingPanels.d.ts +23 -0
  81. package/lib/types/client/pages/CostPage/BudgetCard.d.ts +36 -0
  82. package/lib/types/client/pages/CostPage/GlossaryDrawer.d.ts +16 -0
  83. package/lib/types/client/pages/CostPage/KpiRow.d.ts +23 -0
  84. package/lib/types/client/pages/CostPage/MarkdownBlock.d.ts +16 -0
  85. package/lib/types/client/pages/CostPage/ReportView.d.ts +17 -0
  86. package/lib/types/client/pages/CostPage/ResourceColumns.d.ts +19 -0
  87. package/lib/types/client/pages/CostPage/ResourceDonut.d.ts +18 -0
  88. package/lib/types/client/pages/CostPage/ResourcesCard.d.ts +40 -0
  89. package/lib/types/client/pages/CostPage/RuleDetailDrawer.d.ts +23 -0
  90. package/lib/types/client/pages/CostPage/SavingView.d.ts +38 -0
  91. package/lib/types/client/pages/CostPage/ServiceDonut.d.ts +17 -0
  92. package/lib/types/client/pages/CostPage/TrendChart.d.ts +24 -0
  93. package/lib/types/client/pages/CostPage/budget-input.d.ts +30 -0
  94. package/lib/types/client/pages/CostPage/cost-api.d.ts +266 -0
  95. package/lib/types/client/pages/CostPage/cost-store.d.ts +25 -0
  96. package/lib/types/client/pages/CostPage/format.d.ts +37 -0
  97. package/lib/types/client/pages/CostPage/index.d.ts +34 -0
  98. package/lib/types/client/pages/CostPage/trend-fold.d.ts +32 -0
  99. package/lib/types/client/pages/CostPage/useEcharts.d.ts +70 -0
  100. package/lib/types/client/pages/OrgStructurePage/AccountStatsCard.d.ts +22 -0
  101. package/lib/types/client/pages/OrgStructurePage/CoreAccountsCard.d.ts +18 -0
  102. package/lib/types/client/pages/OrgStructurePage/CreateAccountDialog.d.ts +28 -0
  103. package/lib/types/client/pages/OrgStructurePage/ManageUsersDialog.d.ts +28 -0
  104. package/lib/types/client/pages/OrgStructurePage/MemberAccountsTable.d.ts +32 -0
  105. package/lib/types/client/pages/OrgStructurePage/MoveAccountDialog.d.ts +29 -0
  106. package/lib/types/client/pages/OrgStructurePage/OrgGlossaryDrawer.d.ts +13 -0
  107. package/lib/types/client/pages/OrgStructurePage/OrgTreeCard.d.ts +31 -0
  108. package/lib/types/client/pages/OrgStructurePage/index.d.ts +21 -0
  109. package/lib/types/client/pages/OrgStructurePage/org-api.d.ts +166 -0
  110. package/lib/types/client/pages/OverviewPage/AnchorRow.d.ts +24 -0
  111. package/lib/types/client/pages/OverviewPage/AttentionList.d.ts +29 -0
  112. package/lib/types/client/pages/OverviewPage/OverviewCharts.d.ts +79 -0
  113. package/lib/types/client/pages/OverviewPage/OverviewGlossaryDrawer.d.ts +15 -0
  114. package/lib/types/client/pages/OverviewPage/index.d.ts +22 -0
  115. package/lib/types/client/pages/OverviewPage/overview-api.d.ts +115 -0
  116. package/lib/types/client/pages/ResourcePage/AccountResourceList.d.ts +21 -0
  117. package/lib/types/client/pages/ResourcePage/components/GlossaryDrawer.d.ts +20 -0
  118. package/lib/types/client/pages/ResourcePage/components/MetricCards.d.ts +19 -0
  119. package/lib/types/client/pages/ResourcePage/components/MultiSelect.d.ts +27 -0
  120. package/lib/types/client/pages/ResourcePage/components/PanelPager.d.ts +26 -0
  121. package/lib/types/client/pages/ResourcePage/components/RankBars.d.ts +25 -0
  122. package/lib/types/client/pages/ResourcePage/components/ScopeSelect.d.ts +27 -0
  123. package/lib/types/client/pages/ResourcePage/components/SourceConfigModal.d.ts +21 -0
  124. package/lib/types/client/pages/ResourcePage/components/SyncControls.d.ts +18 -0
  125. package/lib/types/client/pages/ResourcePage/components/TrendChart.d.ts +14 -0
  126. package/lib/types/client/pages/ResourcePage/components/useColumnWidths.d.ts +12 -0
  127. package/lib/types/client/pages/ResourcePage/format.d.ts +9 -0
  128. package/lib/types/client/pages/ResourcePage/index.d.ts +20 -0
  129. package/lib/types/client/pages/ResourcePage/summary-api.d.ts +205 -0
  130. package/lib/types/client/pages/SetupPage/AskPanel.d.ts +21 -0
  131. package/lib/types/client/pages/SetupPage/ChatEmbed.d.ts +40 -0
  132. package/lib/types/client/pages/SetupPage/ChatTab.d.ts +17 -0
  133. package/lib/types/client/pages/SetupPage/FormTab.d.ts +12 -0
  134. package/lib/types/client/pages/SetupPage/FormTabV2.d.ts +14 -0
  135. package/lib/types/client/pages/SetupPage/ProgressTreeView.d.ts +15 -0
  136. package/lib/types/client/pages/SetupPage/StageFlow.d.ts +16 -0
  137. package/lib/types/client/pages/SetupPage/index.d.ts +10 -0
  138. package/lib/types/client/pages/SetupPage/progress-types.d.ts +36 -0
  139. package/lib/types/client/pages/SetupPage/session-binding.d.ts +38 -0
  140. package/lib/types/client/pages/SetupPage/session-store.d.ts +57 -0
  141. package/lib/types/client/pages/SetupPage/sessions-ref.d.ts +5 -0
  142. package/lib/types/client/pages/SetupPage/setup-replan.d.ts +13 -0
  143. package/lib/types/client/pages/SetupPage/wb-api.d.ts +192 -0
  144. package/lib/types/client/pages/list-preview.d.ts +36 -0
  145. package/lib/types/client/permission-mode.d.ts +53 -0
  146. package/lib/types/client/store.d.ts +22 -0
  147. package/lib/types/collect.d.ts +78 -0
  148. package/lib/types/config/account-scope.d.ts +61 -0
  149. package/lib/types/config/advice-findings.d.ts +31 -0
  150. package/lib/types/config/advice-prompt.d.ts +60 -0
  151. package/lib/types/config/advice.d.ts +116 -0
  152. package/lib/types/config/cts.d.ts +30 -0
  153. package/lib/types/config/evidence/rules.d.ts +31 -0
  154. package/lib/types/config/evidence/types.d.ts +103 -0
  155. package/lib/types/config/failure-note.d.ts +46 -0
  156. package/lib/types/config/fingerprint-cache.d.ts +45 -0
  157. package/lib/types/config/identity.d.ts +67 -0
  158. package/lib/types/config/query.d.ts +49 -0
  159. package/lib/types/config/rms.d.ts +412 -0
  160. package/lib/types/config/routes.d.ts +32 -0
  161. package/lib/types/config/types.d.ts +785 -0
  162. package/lib/types/config/views.d.ts +158 -0
  163. package/lib/types/cost/accounts.d.ts +29 -0
  164. package/lib/types/cost/advice-findings.d.ts +77 -0
  165. package/lib/types/cost/advice-model.d.ts +19 -0
  166. package/lib/types/cost/advice-prompt.d.ts +73 -0
  167. package/lib/types/cost/advice-subagent-types.d.ts +6 -0
  168. package/lib/types/cost/advice-subagent.d.ts +116 -0
  169. package/lib/types/cost/advice-types.d.ts +63 -0
  170. package/lib/types/cost/advice.d.ts +125 -0
  171. package/lib/types/cost/aggregate.d.ts +157 -0
  172. package/lib/types/cost/assume.d.ts +43 -0
  173. package/lib/types/cost/bss.d.ts +166 -0
  174. package/lib/types/cost/budget-overview.d.ts +38 -0
  175. package/lib/types/cost/budget.d.ts +56 -0
  176. package/lib/types/cost/cache.d.ts +58 -0
  177. package/lib/types/cost/caliber.d.ts +40 -0
  178. package/lib/types/cost/console-links.d.ts +27 -0
  179. package/lib/types/cost/credentials.d.ts +38 -0
  180. package/lib/types/cost/data-window.d.ts +38 -0
  181. package/lib/types/cost/evidence/catalog.d.ts +35 -0
  182. package/lib/types/cost/evidence/index.d.ts +70 -0
  183. package/lib/types/cost/evidence/inventory.d.ts +44 -0
  184. package/lib/types/cost/evidence/pricing.d.ts +72 -0
  185. package/lib/types/cost/evidence/projects.d.ts +18 -0
  186. package/lib/types/cost/evidence/rules.d.ts +66 -0
  187. package/lib/types/cost/evidence/state.d.ts +38 -0
  188. package/lib/types/cost/evidence/thresholds.d.ts +68 -0
  189. package/lib/types/cost/evidence/types.d.ts +288 -0
  190. package/lib/types/cost/evidence/utilization.d.ts +37 -0
  191. package/lib/types/cost/history.d.ts +36 -0
  192. package/lib/types/cost/ledger.d.ts +97 -0
  193. package/lib/types/cost/normalize.d.ts +37 -0
  194. package/lib/types/cost/period-projection.d.ts +57 -0
  195. package/lib/types/cost/plan-check.d.ts +102 -0
  196. package/lib/types/cost/plan-db.d.ts +73 -0
  197. package/lib/types/cost/plan-types.d.ts +183 -0
  198. package/lib/types/cost/plan.d.ts +63 -0
  199. package/lib/types/cost/quote.d.ts +45 -0
  200. package/lib/types/cost/report.d.ts +136 -0
  201. package/lib/types/cost/resources.d.ts +108 -0
  202. package/lib/types/cost/routes.d.ts +38 -0
  203. package/lib/types/cost/scope.d.ts +42 -0
  204. package/lib/types/cost/types.d.ts +335 -0
  205. package/lib/types/cost/unit-prices-derive.d.ts +19 -0
  206. package/lib/types/cost/unit-prices.d.ts +23 -0
  207. package/lib/types/db.d.ts +228 -0
  208. package/lib/types/host-log.d.ts +7 -0
  209. package/lib/types/http.d.ts +42 -0
  210. package/lib/types/index.d.ts +30 -0
  211. package/lib/types/inventory.d.ts +286 -0
  212. package/lib/types/obs.d.ts +16 -0
  213. package/lib/types/org/aggregate.d.ts +36 -0
  214. package/lib/types/org/churn.d.ts +10 -0
  215. package/lib/types/org/orgs.d.ts +258 -0
  216. package/lib/types/org/routes.d.ts +28 -0
  217. package/lib/types/org-types.d.ts +156 -0
  218. package/lib/types/per-service.d.ts +39 -0
  219. package/lib/types/setup/blueprint-loader.d.ts +81 -0
  220. package/lib/types/setup/caller.d.ts +105 -0
  221. package/lib/types/setup/engine.d.ts +41 -0
  222. package/lib/types/setup/form-store.d.ts +13 -0
  223. package/lib/types/setup/nodes/n1-check.d.ts +14 -0
  224. package/lib/types/setup/nodes/n10-governance.d.ts +6 -0
  225. package/lib/types/setup/nodes/n11-infra.d.ts +6 -0
  226. package/lib/types/setup/nodes/n12-reconcile.d.ts +6 -0
  227. package/lib/types/setup/nodes/n2-region.d.ts +6 -0
  228. package/lib/types/setup/nodes/n3-blueprint.d.ts +6 -0
  229. package/lib/types/setup/nodes/n4-modules.d.ts +6 -0
  230. package/lib/types/setup/nodes/n5-details.d.ts +6 -0
  231. package/lib/types/setup/nodes/n6-plan.d.ts +6 -0
  232. package/lib/types/setup/nodes/n7-verify.d.ts +6 -0
  233. package/lib/types/setup/nodes/n8-approve.d.ts +6 -0
  234. package/lib/types/setup/nodes/n9-buildmode.d.ts +6 -0
  235. package/lib/types/setup/plan-state.d.ts +10 -0
  236. package/lib/types/setup/prompt-loader.d.ts +16 -0
  237. package/lib/types/setup/routes.d.ts +22 -0
  238. package/lib/types/setup/session-notify.d.ts +30 -0
  239. package/lib/types/setup/tools.d.ts +19 -0
  240. package/lib/types/setup/types.d.ts +157 -0
  241. package/lib/types/sse-bus.d.ts +23 -0
  242. package/lib/types/tools/config-facts.d.ts +16 -0
  243. package/lib/types/tools/cost-facts.d.ts +10 -0
  244. package/lib/types/tools/register.d.ts +18 -0
  245. package/lib/types/wb-conventions.d.ts +140 -0
  246. package/package.json +77 -4
@@ -0,0 +1,603 @@
1
+ # 身份中心(identity-center)
2
+
3
+ > Identity Center 提供跨账号统一身份。用户一次登录,按权限集访问多账号。
4
+ > 这是 LZ"人怎么进系统"的核心。
5
+
6
+ ---
7
+
8
+ ## 一、是什么 / 为什么需要
9
+
10
+ Identity Center(IC)让多个账号共享一套身份体系:建用户/组,分配权限集,绑定到账号。用户登录后按权限访问被授权的账号,无需每个账号单独建 IAM 用户。
11
+
12
+ **为什么需要**:多账号场景下,逐账号建用户/管密码不可行;IC 统一身份,改权限只改权限集,不用逐账号调。
13
+
14
+ ## 二、里面应该有什么(子结构)
15
+
16
+ | 资源 | 职责 | 必备 |
17
+ |---|---|---|
18
+ | IC 实例 | 身份中心实例(查 instance_id + identity_store_id) | ✅ |
19
+ | 用户(User) | 如 lzadmin | ✅ |
20
+ | 用户组(Group) | 如 LZ-Administrators | ✅ |
21
+ | 组成员(Membership) | 用户加入组 | ✅ |
22
+ | 权限集(PermissionSet) | 如 LZ-ReadOnly | ✅ |
23
+ | 权限集策略 | 附加系统策略(如 Tenant Guest) | ✅ |
24
+ | 账号分配(AccountAssignment) | 把组+权限集绑到账号 | ✅ |
25
+
26
+ ### 两种身份模式
27
+
28
+ | 模式 | 适用 | 特点 |
29
+ |---|---|---|
30
+ | 本地用户 | 中小、无 IdP | IC 内建用户,最简单 |
31
+ | 企业 SSO 联邦 | 有企业 IdP(AD/OIDC) | 对接现有身份,IC 做联邦代理 |
32
+
33
+ ## 三、注意点 / 最佳实践 / 坑
34
+
35
+ ### 约束(重点!)
36
+ - **IC 涉及两个华为云服务,host 不同,必须分开**:
37
+ - `IdentityCenter`(实例/权限集/账号分配):**全局服务**,host 不带区域前缀
38
+ - `IdentityCenterStore`(用户/组/组成员):**区域服务**,host 带 `identitystore.<region>.`
39
+ - **IdentityCenterStore 的 host 是 `identitystore.` 而非 `identitycenterstore.`** —— 这是特例,**必须走 `apiexplorerHost('IdentityCenterStore', region)` 查,不能靠服务名推导**(推导会得到错误 `identitycenterstore.`)
40
+ - 这正是之前 IC 探测 host bug 的根因(硬编码 `identitycenter.cn-north-4` → NXDOMAIN),知识层记下这个坑,避免重蹈
41
+
42
+ ### 最佳实践
43
+ - **初期只给 ReadOnly**(Tenant Guest),业务上线后再加写权限集
44
+ - **权限集是可复用模板**:一份权限集分配到多账号,改权限只改权限集
45
+ - **用组而非单用户做分配**:组方便批量授权,用户加组即获权
46
+
47
+ ### 坑
48
+ - **权限集改了要重新分配才生效**(某些策略变更需 reassign)
49
+ - **账号分配依赖账号 active**:suspended 账号分配会失败
50
+ - **IC 实例是查询出来的,不是创建的**——组织启用 IC 后实例自动存在,ListInstances 拿 id
51
+ - **创建用户需邮箱**(passwordMode=EMAIL 时,密码发到邮箱)
52
+
53
+ ## 四、创建依赖
54
+
55
+ ### 前置
56
+ - **Organization 已建**(IC 依赖组织)
57
+ - **可信服务 service.IdentityCenter 已 enable**
58
+ - **目标账号已建且 active**(账号分配依赖)
59
+
60
+ ### 被依赖
61
+ - 无(IC 是身份层末端,不被其他块依赖)
62
+
63
+ ### 依赖链
64
+ ```
65
+ Organization → enable IC trusted service → IC 实例(查询)
66
+ → 用户 / 组 / 权限集(并行)
67
+ → 组成员(依赖用户+组)
68
+ → 权限集策略(依赖权限集)
69
+ → 账号分配(依赖权限集策略 + 组 + 账号)
70
+ ```
71
+
72
+ ## 五、怎么查接口(指向 ops-deploy)
73
+
74
+ | 查什么 | productshort | 关键 API |
75
+ |---|---|---|
76
+ | IC 实例 | IdentityCenter | ListInstances |
77
+ | 用户 | IdentityCenterStore | CreateUser / ListUsers |
78
+ | 组 | IdentityCenterStore | CreateGroup / ListGroups |
79
+ | 组成员 | IdentityCenterStore | CreateGroupMembership / ListGroupMemberships |
80
+ | 权限集 | IdentityCenter | CreatePermissionSet / ListPermissionSets |
81
+ | 权限集策略 | IdentityCenter | AttachManagedPolicyToPermissionSet |
82
+ | 账号分配 | IdentityCenter | CreateAccountAssignment / ListAccountAssignments |
83
+
84
+ **查法**:
85
+ - `apiexplorer('IdentityCenter')` / `apiexplorer('IdentityCenterStore')` 列 API
86
+ - `apiexplorer(productshort, apiName, compact=true)` 查契约
87
+ - **host 必须分别查**:`apiexplorerHost('IdentityCenter', region)` + `apiexplorerHost('IdentityCenterStore', region)` —— 两个服务 host 不同,IdentityCenterStore 的 host 不能推导
88
+
89
+ > ⚠️ **关键坑**:绝对不要硬编码 `identitycenter.cn-north-4` 或推导 `identitycenterstore.`。两个 host 都走 apiexplorerHost。
90
+
91
+ ### 特殊参数(模板表 specialParams 对应)
92
+
93
+ 以下参数不能简单从 spec 取,需按规则特殊解析(规则记录在此,代码 resource-types.ts 引用):
94
+
95
+ | 参数字段 | resolver | 说明 |
96
+ |---|---|---|
97
+ | `instance_id` | query-instance-id | 从 IC 实例查询结果取(ListInstances 返回的 instance_id) |
98
+ | `identity_store_id` | query-store-id | 从 IC 实例查询结果取(ListInstances 返回的 identity_store_id) |
99
+ | `permission_set_id` | from-prior-resource | 从前置 permission_set 资源的创建结果取 id |
100
+ | `principal_id` | from-prior-resource | 从前置 ic_group 资源的创建结果取 group_id |
101
+ | `target_id` | from-prior-resource | 从前置 account 资源的创建结果取 account_id |
102
+
103
+ > 这些参数的值依赖"前置资源已建并拿到 id",所以参数解析器在拓扑排序后、按依赖顺序逐个建资源时,从前置结果里取。
104
+
105
+ ## 六、资源探测指引
106
+
107
+ > ⚠️ 本节定义该资源如何探测是否已存在。
108
+ > IC 涉及两个服务:IdentityCenter(全局,实例/权限集)+ IdentityCenterStore(区域,用户/组)。
109
+ > 每个步骤自带 productshort + hostKey,支持多服务探测(缺什么查什么)。
110
+
111
+ ```json
112
+ {
113
+ "probes": [
114
+ {
115
+ "typeId": "ic_instance",
116
+ "service": "IdentityCenter",
117
+ "hostMode": "global",
118
+ "steps": [
119
+ {
120
+ "step": 1,
121
+ "action": "query-host",
122
+ "productshort": "IdentityCenter",
123
+ "via": "apiexplorerHost",
124
+ "output": "icHost"
125
+ },
126
+ {
127
+ "step": 2,
128
+ "action": "query-list",
129
+ "method": "GET",
130
+ "api": "ListInstances",
131
+ "path": "/v1/instances",
132
+ "hostKey": "icHost",
133
+ "output": "instances",
134
+ "save": true,
135
+ "depends": [
136
+ "icHost"
137
+ ]
138
+ }
139
+ ],
140
+ "match": {
141
+ "field": "instances[0].instance_id",
142
+ "expect": "exists-non-empty"
143
+ },
144
+ "existsStatus": "historical_exists",
145
+ "existsDetail": "IC 实例已存在,复用",
146
+ "pendingDetail": "IC 实例未创建,待建"
147
+ },
148
+ {
149
+ "typeId": "ic_user",
150
+ "service": "IdentityCenterStore",
151
+ "hostMode": "regional",
152
+ "steps": [
153
+ {
154
+ "step": 1,
155
+ "action": "query-host",
156
+ "productshort": "IdentityCenterStore",
157
+ "via": "apiexplorerHost",
158
+ "output": "storeHost"
159
+ },
160
+ {
161
+ "step": 2,
162
+ "action": "query-host",
163
+ "productshort": "IdentityCenter",
164
+ "via": "apiexplorerHost",
165
+ "output": "icHost"
166
+ },
167
+ {
168
+ "step": 3,
169
+ "action": "query-list",
170
+ "method": "GET",
171
+ "api": "ListInstances",
172
+ "path": "/v1/instances",
173
+ "hostKey": "icHost",
174
+ "extract": "instances[0].identity_store_id",
175
+ "output": "storeId",
176
+ "save": true,
177
+ "depends": [
178
+ "icHost"
179
+ ]
180
+ },
181
+ {
182
+ "step": 4,
183
+ "action": "query-list",
184
+ "method": "GET",
185
+ "api": "ListUsers",
186
+ "path": "/v1/identity-stores/{storeId}/users",
187
+ "hostKey": "storeHost",
188
+ "output": "users",
189
+ "depends": [
190
+ "storeHost",
191
+ "storeId"
192
+ ]
193
+ }
194
+ ],
195
+ "match": {
196
+ "field": "users[].user_name",
197
+ "expect": "equals-semanticParam",
198
+ "semField": "userName"
199
+ },
200
+ "existsStatus": "historical_exists",
201
+ "existsDetail": "IC 用户 {userName} 已存在,复用",
202
+ "pendingDetail": "IC 用户 {userName} 未创建,待建"
203
+ },
204
+ {
205
+ "typeId": "ic_group",
206
+ "service": "IdentityCenterStore",
207
+ "hostMode": "regional",
208
+ "steps": [
209
+ {
210
+ "step": 1,
211
+ "action": "query-host",
212
+ "productshort": "IdentityCenterStore",
213
+ "via": "apiexplorerHost",
214
+ "output": "storeHost"
215
+ },
216
+ {
217
+ "step": 2,
218
+ "action": "query-host",
219
+ "productshort": "IdentityCenter",
220
+ "via": "apiexplorerHost",
221
+ "output": "icHost"
222
+ },
223
+ {
224
+ "step": 3,
225
+ "action": "query-list",
226
+ "method": "GET",
227
+ "api": "ListInstances",
228
+ "path": "/v1/instances",
229
+ "hostKey": "icHost",
230
+ "extract": "instances[0].identity_store_id",
231
+ "output": "storeId",
232
+ "save": true,
233
+ "depends": [
234
+ "icHost"
235
+ ]
236
+ },
237
+ {
238
+ "step": 4,
239
+ "action": "query-list",
240
+ "method": "GET",
241
+ "api": "ListGroups",
242
+ "path": "/v1/identity-stores/{storeId}/groups",
243
+ "hostKey": "storeHost",
244
+ "output": "groups",
245
+ "depends": [
246
+ "storeHost",
247
+ "storeId"
248
+ ]
249
+ }
250
+ ],
251
+ "match": {
252
+ "field": "groups[].display_name",
253
+ "expect": "equals-semanticParam",
254
+ "semField": "groupName"
255
+ },
256
+ "existsStatus": "historical_exists",
257
+ "existsDetail": "IC 组 {groupName} 已存在,复用",
258
+ "pendingDetail": "IC 组 {groupName} 未创建,待建"
259
+ },
260
+ {
261
+ "typeId": "permission_set",
262
+ "service": "IdentityCenter",
263
+ "hostMode": "global",
264
+ "steps": [
265
+ {
266
+ "step": 1,
267
+ "action": "query-host",
268
+ "productshort": "IdentityCenter",
269
+ "via": "apiexplorerHost",
270
+ "output": "icHost"
271
+ },
272
+ {
273
+ "step": 2,
274
+ "action": "query-list",
275
+ "method": "GET",
276
+ "api": "ListInstances",
277
+ "path": "/v1/instances",
278
+ "hostKey": "icHost",
279
+ "extract": "instances[0].instance_id",
280
+ "output": "instanceId",
281
+ "save": true,
282
+ "depends": [
283
+ "icHost"
284
+ ]
285
+ },
286
+ {
287
+ "step": 3,
288
+ "action": "query-list",
289
+ "method": "GET",
290
+ "api": "ListPermissionSets",
291
+ "path": "/v1/instances/{instanceId}/permission-sets",
292
+ "hostKey": "icHost",
293
+ "output": "permission_sets",
294
+ "depends": [
295
+ "icHost",
296
+ "instanceId"
297
+ ]
298
+ }
299
+ ],
300
+ "match": {
301
+ "field": "permission_sets[].name",
302
+ "expect": "equals-semanticParam",
303
+ "semField": "name"
304
+ },
305
+ "existsStatus": "historical_exists",
306
+ "existsDetail": "权限集 {name} 已存在,复用",
307
+ "pendingDetail": "权限集 {name} 未创建,待建"
308
+ },
309
+ {
310
+ "typeId": "ic_membership",
311
+ "service": "IdentityCenterStore",
312
+ "hostMode": "regional",
313
+ "steps": [
314
+ {
315
+ "step": 1,
316
+ "action": "query-host",
317
+ "productshort": "IdentityCenterStore",
318
+ "via": "apiexplorerHost",
319
+ "output": "storeHost"
320
+ },
321
+ {
322
+ "step": 2,
323
+ "action": "query-host",
324
+ "productshort": "IdentityCenter",
325
+ "via": "apiexplorerHost",
326
+ "output": "icHost"
327
+ },
328
+ {
329
+ "step": 3,
330
+ "action": "query-list",
331
+ "method": "GET",
332
+ "api": "ListInstances",
333
+ "path": "/v1/instances",
334
+ "hostKey": "icHost",
335
+ "extract": "instances[0].identity_store_id",
336
+ "output": "storeId",
337
+ "save": true,
338
+ "depends": [
339
+ "icHost"
340
+ ]
341
+ },
342
+ {
343
+ "step": 4,
344
+ "action": "query-list",
345
+ "method": "GET",
346
+ "api": "ListGroupMemberships",
347
+ "path": "/v1/identity-stores/{storeId}/group-memberships?group_id={groupId}",
348
+ "hostKey": "storeHost",
349
+ "output": "group_memberships",
350
+ "save": true,
351
+ "depends": [
352
+ "storeHost",
353
+ "storeId"
354
+ ],
355
+ "paramSources": {
356
+ "storeId": {
357
+ "source": "priorQuery",
358
+ "queryApi": "ListInstances",
359
+ "extract": "instances[0].identity_store_id"
360
+ },
361
+ "groupId": {
362
+ "source": "priorResult",
363
+ "resourceId": "groupIdRef",
364
+ "field": "cloudId"
365
+ }
366
+ }
367
+ }
368
+ ],
369
+ "match": {
370
+ "field": "group_memberships",
371
+ "expect": "exists-non-empty",
372
+ "idFields": [
373
+ "membership_id"
374
+ ]
375
+ },
376
+ "existsStatus": "historical_exists",
377
+ "existsDetail": "组成员关系({groupIdRef})已存在,复用",
378
+ "pendingDetail": "组成员关系({groupIdRef})未创建,待建"
379
+ },
380
+ {
381
+ "typeId": "ps_policy_attach",
382
+ "service": "IdentityCenter",
383
+ "hostMode": "global",
384
+ "steps": [
385
+ {
386
+ "step": 1,
387
+ "action": "query-host",
388
+ "productshort": "IdentityCenter",
389
+ "via": "apiexplorerHost",
390
+ "output": "icHost"
391
+ },
392
+ {
393
+ "step": 2,
394
+ "action": "query-list",
395
+ "method": "GET",
396
+ "api": "ListInstances",
397
+ "path": "/v1/instances",
398
+ "hostKey": "icHost",
399
+ "extract": "instances[0].instance_id",
400
+ "output": "instanceId",
401
+ "save": true,
402
+ "depends": [
403
+ "icHost"
404
+ ]
405
+ },
406
+ {
407
+ "step": 3,
408
+ "action": "query-list",
409
+ "method": "GET",
410
+ "api": "ListManagedPoliciesInPermissionSet",
411
+ "path": "/v1/instances/{instanceId}/permission-sets/{permissionSetId}/managed-policies",
412
+ "hostKey": "icHost",
413
+ "output": "attached_managed_policies",
414
+ "save": true,
415
+ "depends": [
416
+ "icHost",
417
+ "instanceId",
418
+ "permissionSetId"
419
+ ],
420
+ "paramSources": {
421
+ "instanceId": {
422
+ "source": "priorQuery",
423
+ "queryApi": "ListInstances",
424
+ "extract": "instances[0].instance_id"
425
+ },
426
+ "permissionSetId": {
427
+ "source": "priorResult",
428
+ "resourceId": "psIdRef",
429
+ "field": "cloudId"
430
+ }
431
+ }
432
+ }
433
+ ],
434
+ "match": {
435
+ "field": "attached_managed_policies[].policy_name",
436
+ "expect": "equals-semanticParam",
437
+ "semField": "policyName",
438
+ "idFields": [
439
+ "policy_id"
440
+ ]
441
+ },
442
+ "existsStatus": "historical_exists",
443
+ "existsDetail": "系统策略({policyName})已附加到权限集({psIdRef}),复用",
444
+ "pendingDetail": "系统策略({policyName})未附加,待建"
445
+ },
446
+ {
447
+ "typeId": "account_assignment",
448
+ "service": "IdentityCenter",
449
+ "hostMode": "global",
450
+ "steps": [
451
+ {
452
+ "step": 1,
453
+ "action": "query-host",
454
+ "productshort": "IdentityCenter",
455
+ "via": "apiexplorerHost",
456
+ "output": "icHost"
457
+ },
458
+ {
459
+ "step": 2,
460
+ "action": "query-list",
461
+ "method": "GET",
462
+ "api": "ListInstances",
463
+ "path": "/v1/instances",
464
+ "hostKey": "icHost",
465
+ "extract": "instances[0].instance_id",
466
+ "output": "instanceId",
467
+ "save": true,
468
+ "depends": [
469
+ "icHost"
470
+ ]
471
+ },
472
+ {
473
+ "step": 3,
474
+ "action": "query-list",
475
+ "method": "GET",
476
+ "api": "ListAccountAssignments",
477
+ "path": "/v1/instances/{instanceId}/account-assignments?account_id={accountId}",
478
+ "hostKey": "icHost",
479
+ "output": "account_assignments",
480
+ "save": true,
481
+ "depends": [
482
+ "icHost",
483
+ "instanceId"
484
+ ],
485
+ "paramSources": {
486
+ "instanceId": {
487
+ "source": "priorQuery",
488
+ "queryApi": "ListInstances",
489
+ "extract": "instances[0].instance_id"
490
+ },
491
+ "accountId": {
492
+ "source": "priorResult",
493
+ "resourceId": "targetAccountRef",
494
+ "field": "cloudId"
495
+ }
496
+ }
497
+ }
498
+ ],
499
+ "match": {
500
+ "field": "account_assignments",
501
+ "expect": "exists-non-empty",
502
+ "idFields": [
503
+ "account_id"
504
+ ]
505
+ },
506
+ "existsStatus": "historical_exists",
507
+ "existsDetail": "账号分配({targetAccountRef})已存在,复用",
508
+ "pendingDetail": "账号分配({targetAccountRef})未创建,待建"
509
+ },
510
+ {
511
+ "typeId": "ps_custom_policy",
512
+ "service": "IdentityCenter",
513
+ "hostMode": "global",
514
+ "steps": [
515
+ {
516
+ "step": 1,
517
+ "action": "query-host",
518
+ "productshort": "IdentityCenter",
519
+ "via": "apiexplorerHost",
520
+ "output": "icHost"
521
+ },
522
+ {
523
+ "step": 2,
524
+ "action": "query-list",
525
+ "method": "GET",
526
+ "api": "ListInstances",
527
+ "path": "/v1/instances",
528
+ "hostKey": "icHost",
529
+ "extract": "instances[0].instance_id",
530
+ "output": "instanceId",
531
+ "save": true,
532
+ "depends": [
533
+ "icHost"
534
+ ]
535
+ },
536
+ {
537
+ "step": 3,
538
+ "action": "query-single",
539
+ "method": "GET",
540
+ "api": "GetCustomPolicyForPermissionSet",
541
+ "path": "/v1/instances/{instanceId}/permission-sets/{permissionSetId}/custom-policy",
542
+ "hostKey": "icHost",
543
+ "output": "custom_policy",
544
+ "depends": [
545
+ "icHost",
546
+ "instanceId"
547
+ ],
548
+ "paramSources": {
549
+ "instanceId": {
550
+ "source": "priorQuery",
551
+ "queryApi": "ListInstances",
552
+ "extract": "instances[0].instance_id"
553
+ },
554
+ "permissionSetId": {
555
+ "source": "priorResult",
556
+ "resourceId": "psIdRef",
557
+ "field": "cloudId"
558
+ }
559
+ }
560
+ }
561
+ ],
562
+ "match": {
563
+ "field": "custom_policy",
564
+ "expect": "exists-non-empty"
565
+ },
566
+ "absentWhen": {
567
+ "httpStatus": 404
568
+ },
569
+ "existsStatus": "historical_exists",
570
+ "existsDetail": "权限集自定义策略({policyName})已附加,复用",
571
+ "pendingDetail": "权限集自定义策略({policyName})未附加,待建"
572
+ }
573
+ ]
574
+ }```
575
+
576
+ > 字段说明:
577
+ > - IC 多服务:每个 query-host 步骤存不同 output(icHost/storeHost),query-list 用 hostKey 指定取哪个
578
+ > - ic_user/ic_group 先查 IdentityCenter(ListInstances)拿 identity_store_id,再查 IdentityCenterStore(ListUsers/ListGroups)——自包含,不跨实例依赖
579
+ > - permission_set 先查 ListInstances 拿 instance_id,再查 ListPermissionSets
580
+ > - 匹配字段:ic_user 用 userName、ic_group 用 groupName、permission_set 用 name
581
+ > - **跨实例依赖(ic_membership/ps_policy_attach/account_assignment)**:用 paramSources 声明参数来源,引擎按声明取值:
582
+ > - `priorQuery`:从已查数据(savedQueries)提取(如 ListInstances 的 instance_id/identity_store_id,避免重复查)
583
+ > - `priorResult`:从前序资源探测结果取 cloudId(如 groupIdRef→semanticParams.groupIdRef→groupId(spec id)→priorResults.cloudId)
584
+ > - `semanticParam`:从实例语义参数取(如 name)
585
+ > - 拓扑顺序保证:资源产出顺序 ic_instance→ic_user→ic_group→ic_membership→permission_set→ps_policy_attach→account_assignment,被依赖资源先探测
586
+
587
+ ## 七、演示示例
588
+
589
+ ```
590
+ IC 实例: instance-xxx / identity_store-xxx(查询得到)
591
+ 用户: lzadmin (email: lzadmin@example.com, passwordMode: EMAIL)
592
+ 组: LZ-Administrators
593
+ 组成员: lzadmin → LZ-Administrators
594
+ 权限集: LZ-ReadOnly (附加策略: Tenant Guest)
595
+ 账号分配:
596
+ LZ-Administrators + LZ-ReadOnly → 管理账号
597
+ LZ-Administrators + LZ-ReadOnly → SharedServices
598
+ LZ-Administrators + LZ-ReadOnly → LogArchive
599
+ LZ-Administrators + LZ-ReadOnly → Security
600
+ LZ-Administrators + LZ-ReadOnly → Ops
601
+ LZ-Administrators + LZ-ReadOnly → Dev
602
+ LZ-Administrators + LZ-ReadOnly → Prod
603
+ ```