@empire-builder-kit/nx 1.0.0-rc.47 → 1.0.0-rc.48

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 (764) hide show
  1. package/README.md +14 -169
  2. package/executors.json +24 -79
  3. package/generators.json +8 -18
  4. package/package.json +13 -71
  5. package/src/aws/identity.d.ts +1 -1
  6. package/src/aws-authority/boundary-transforms.d.ts +9 -0
  7. package/src/aws-authority/boundary-transforms.js +78 -0
  8. package/src/aws-authority/contracts.d.ts +116 -0
  9. package/src/aws-authority/contracts.js +40 -0
  10. package/src/aws-authority/deployment-guardrails.d.ts +4 -0
  11. package/src/aws-authority/deployment-guardrails.js +543 -0
  12. package/src/aws-authority/deployment-policy-groups.d.ts +3 -0
  13. package/src/aws-authority/deployment-policy-groups.js +299 -0
  14. package/src/aws-authority/deployment-resources.d.ts +64 -0
  15. package/src/aws-authority/deployment-resources.js +265 -0
  16. package/src/aws-authority/deployment-services.d.ts +3 -0
  17. package/src/aws-authority/deployment-services.js +717 -0
  18. package/src/aws-authority/development-authority.d.ts +11 -0
  19. package/src/aws-authority/development-authority.js +160 -0
  20. package/src/aws-authority/guardrail-actions.d.ts +87 -0
  21. package/src/aws-authority/guardrail-actions.js +463 -0
  22. package/src/aws-authority/policy-document.d.ts +15 -0
  23. package/src/aws-authority/policy-document.js +264 -0
  24. package/src/aws-authority/runtime-boundary.d.ts +7 -0
  25. package/src/aws-authority/runtime-boundary.js +211 -0
  26. package/src/aws-authority/service-actions.d.ts +96 -0
  27. package/src/aws-authority/service-actions.js +512 -0
  28. package/src/aws-authority/stage-authority.d.ts +6 -272
  29. package/src/aws-authority/stage-authority.js +109 -3609
  30. package/src/aws-authority/stage-identity.d.ts +6 -0
  31. package/src/aws-authority/stage-identity.js +134 -0
  32. package/src/cli/bootstrap.d.ts +0 -20
  33. package/src/cli/bootstrap.js +2 -153
  34. package/src/cli/dev-command.d.ts +2 -4
  35. package/src/cli/dev-command.js +1 -19
  36. package/src/cli/main.d.ts +0 -4
  37. package/src/cli/main.js +22 -80
  38. package/src/cli/output.d.ts +2 -4
  39. package/src/cli/output.js +2 -8
  40. package/src/executors/deployment-plan/deployment-plan.d.ts +0 -2
  41. package/src/executors/deployment-plan/deployment-plan.js +3 -68
  42. package/src/executors/dev-doctor/dev-doctor.js +2 -2
  43. package/src/executors/local-deploy/deployed-smoke.d.ts +12 -0
  44. package/src/executors/local-deploy/deployed-smoke.js +115 -0
  45. package/src/executors/local-deploy/deployment-authority.d.ts +24 -0
  46. package/src/executors/local-deploy/deployment-authority.js +81 -0
  47. package/src/executors/local-deploy/deployment-child.d.ts +18 -0
  48. package/src/executors/local-deploy/deployment-child.js +77 -0
  49. package/src/executors/local-deploy/deployment-contracts.d.ts +96 -0
  50. package/src/executors/local-deploy/deployment-contracts.js +3 -0
  51. package/src/executors/local-deploy/deployment-projects.d.ts +4 -0
  52. package/src/executors/local-deploy/deployment-projects.js +16 -0
  53. package/src/executors/local-deploy/deployment-receipt.d.ts +4 -0
  54. package/src/executors/local-deploy/deployment-receipt.js +55 -0
  55. package/src/executors/local-deploy/deployment-scope.d.ts +17 -0
  56. package/src/executors/local-deploy/deployment-scope.js +239 -0
  57. package/src/executors/local-deploy/deployment-source.d.ts +13 -0
  58. package/src/executors/local-deploy/deployment-source.js +86 -0
  59. package/src/executors/local-deploy/local-deploy.d.ts +5 -121
  60. package/src/executors/local-deploy/local-deploy.js +55 -936
  61. package/src/executors/sst-lifecycle/governed-child-process.d.ts +27 -0
  62. package/src/executors/sst-lifecycle/governed-child-process.js +277 -0
  63. package/src/executors/sst-lifecycle/governed-native-operation.js +4 -10
  64. package/src/executors/sst-lifecycle/run-sst-command.d.ts +4 -85
  65. package/src/executors/sst-lifecycle/run-sst-command.js +28 -834
  66. package/src/executors/sst-lifecycle/sst-contracts.d.ts +44 -0
  67. package/src/executors/sst-lifecycle/sst-contracts.js +3 -0
  68. package/src/executors/sst-lifecycle/sst-invocation.d.ts +17 -0
  69. package/src/executors/sst-lifecycle/sst-invocation.js +502 -0
  70. package/src/executors/sst-lifecycle/task-unlock.js +3 -3
  71. package/src/foundation/discovery.d.ts +1 -5
  72. package/src/foundation/discovery.js +0 -2
  73. package/src/foundation/index.d.ts +0 -2
  74. package/src/foundation/index.js +0 -9
  75. package/src/foundation/local-private-smoke-access.d.ts +6 -15
  76. package/src/foundation/local-private-smoke-access.js +8 -192
  77. package/src/foundation/observability.d.ts +16 -26
  78. package/src/foundation/observability.js +34 -135
  79. package/src/foundation/preflight.js +0 -14
  80. package/src/foundation/private-smoke-access.d.ts +7 -14
  81. package/src/foundation/private-smoke-access.js +4 -126
  82. package/src/foundation/root-site-workspace.d.ts +35 -0
  83. package/src/foundation/root-site-workspace.js +80 -0
  84. package/src/foundation/root-site.d.ts +8 -7
  85. package/src/foundation/root-site.js +17 -9
  86. package/src/generators/formatting.js +5 -4
  87. package/src/generators/function/function.d.ts +9 -5
  88. package/src/generators/function/function.js +106 -136
  89. package/src/generators/function/schema.json +2 -2
  90. package/src/generators/function-access/function-access.d.ts +0 -6
  91. package/src/generators/function-access/function-access.js +41 -109
  92. package/src/generators/observability-policy.js +1 -2
  93. package/src/{supply-chain → generators}/pnpm-toolchain-authority.d.ts +3 -3
  94. package/src/{supply-chain → generators}/pnpm-toolchain-authority.js +12 -12
  95. package/src/generators/post-generation-install.d.ts +1 -8
  96. package/src/generators/post-generation-install.js +11 -139
  97. package/src/generators/preset/dependency-overrides.d.ts +13 -19
  98. package/src/generators/preset/dependency-overrides.js +12 -56
  99. package/src/generators/preset/generator.js +0 -3
  100. package/src/generators/preset/workspace-files-foundation-infra.d.ts +6 -0
  101. package/src/generators/preset/workspace-files-foundation-infra.js +586 -0
  102. package/src/generators/preset/workspace-files-foundation-readme.d.ts +5 -0
  103. package/src/generators/preset/workspace-files-foundation-readme.js +90 -0
  104. package/src/generators/preset/workspace-files-foundation.d.ts +3 -0
  105. package/src/generators/preset/workspace-files-foundation.js +170 -0
  106. package/src/generators/preset/workspace-files-ownership.d.ts +9 -0
  107. package/src/generators/preset/workspace-files-ownership.js +124 -0
  108. package/src/generators/preset/workspace-files-root-config.d.ts +32 -0
  109. package/src/generators/preset/workspace-files-root-config.js +356 -0
  110. package/src/generators/preset/workspace-files-root-docs.d.ts +5 -0
  111. package/src/generators/preset/workspace-files-root-docs.js +109 -0
  112. package/src/generators/preset/workspace-files-shared.d.ts +18 -0
  113. package/src/generators/preset/workspace-files-shared.js +7 -0
  114. package/src/generators/preset/workspace-files-workflows.d.ts +39 -0
  115. package/src/generators/preset/workspace-files-workflows.js +306 -0
  116. package/src/generators/preset/workspace-files-workspace-health.d.ts +6 -0
  117. package/src/generators/preset/workspace-files-workspace-health.js +148 -0
  118. package/src/generators/preset/workspace-files.d.ts +10 -24
  119. package/src/generators/preset/workspace-files.js +48 -10705
  120. package/src/generators/site/built-in-site-documentation-files.d.ts +2 -1
  121. package/src/generators/site/built-in-site-documentation-files.js +15 -56
  122. package/src/generators/site/built-in-site-files.d.ts +4 -1
  123. package/src/generators/site/built-in-site-files.js +12 -11
  124. package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -1
  125. package/src/generators/site/built-in-site-infrastructure-files.js +46 -206
  126. package/src/generators/site/built-in-site-plan.d.ts +5 -1
  127. package/src/generators/site/built-in-site-plan.js +7 -5
  128. package/src/generators/site/built-in-site-project-files.d.ts +10 -2
  129. package/src/generators/site/built-in-site-project-files.js +131 -177
  130. package/src/generators/site/built-in-site-script-files.d.ts +2 -0
  131. package/src/generators/site/built-in-site-script-files.js +76 -280
  132. package/src/generators/site/built-in-site-shared.d.ts +64 -4
  133. package/src/generators/site/built-in-site-shared.js +307 -14
  134. package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -1
  135. package/src/generators/site/built-in-site-sst-config-files.js +90 -22
  136. package/src/generators/site/built-in-site-web-files.d.ts +2 -1
  137. package/src/generators/site/built-in-site-web-files.js +19 -225
  138. package/src/generators/site/schema.d.ts +5 -0
  139. package/src/generators/site/schema.json +6 -0
  140. package/src/generators/site/site.d.ts +0 -8
  141. package/src/generators/site/site.js +17 -85
  142. package/src/generators/slice/built-in-plan-api-files.d.ts +1 -2
  143. package/src/generators/slice/built-in-plan-api-files.js +30 -890
  144. package/src/generators/slice/built-in-plan-database-lifecycle-files.js +57 -1851
  145. package/src/generators/slice/built-in-plan-infrastructure-files.d.ts +5 -2
  146. package/src/generators/slice/built-in-plan-infrastructure-files.js +80 -3272
  147. package/src/generators/slice/built-in-plan-key-value-files.d.ts +3 -2
  148. package/src/generators/slice/built-in-plan-key-value-files.js +3 -21
  149. package/src/generators/slice/built-in-plan-project-files.d.ts +5 -3
  150. package/src/generators/slice/built-in-plan-project-files.js +79 -897
  151. package/src/generators/slice/built-in-plan-shared.d.ts +3 -18
  152. package/src/generators/slice/built-in-plan-shared.js +4 -57
  153. package/src/generators/slice/built-in-plan-web-files.d.ts +1 -1
  154. package/src/generators/slice/built-in-plan-web-files.js +14 -540
  155. package/src/generators/slice/built-in-plan.d.ts +2 -3
  156. package/src/generators/slice/built-in-plan.js +79 -277
  157. package/src/{developer-agent/preview-changes.d.ts → generators/slice/generation-tree.d.ts} +1 -5
  158. package/src/generators/slice/generation-tree.js +161 -0
  159. package/src/generators/slice/schema.json +12 -4
  160. package/src/generators/slice/slice-config.d.ts +7 -0
  161. package/src/generators/slice/slice-config.js +125 -0
  162. package/src/generators/slice/slice.js +29 -261
  163. package/src/generators/slice/sql-bootstrap.d.ts +1 -0
  164. package/src/generators/slice/sql-bootstrap.js +505 -0
  165. package/src/generators/slice/sql-client.d.ts +1 -0
  166. package/src/generators/slice/sql-client.js +107 -0
  167. package/src/generators/slice/sql-infrastructure.d.ts +1 -0
  168. package/src/generators/slice/sql-infrastructure.js +225 -0
  169. package/src/generators/slice/sql-logging.d.ts +1 -0
  170. package/src/generators/slice/sql-logging.js +266 -0
  171. package/src/generators/slice/sql-migration.d.ts +2 -0
  172. package/src/generators/slice/sql-migration.js +202 -0
  173. package/src/generators/slice/standard-slice-contract.d.ts +25 -0
  174. package/src/generators/slice/standard-slice-contract.js +64 -0
  175. package/src/generators/sql/schema.json +1 -1
  176. package/src/generators/sql/sql.d.ts +1 -1
  177. package/src/generators/sql/sql.js +13 -7
  178. package/src/generators/upgrade/framework-package-upgrade.d.ts +4 -27
  179. package/src/generators/upgrade/framework-package-upgrade.js +16 -39
  180. package/src/generators/upgrade/framework-packages.d.ts +25 -0
  181. package/src/generators/upgrade/framework-packages.js +138 -0
  182. package/src/generators/upgrade/function-authentication-notice.d.ts +10 -18
  183. package/src/generators/upgrade/function-authentication-notice.js +24 -44
  184. package/src/generators/upgrade/schema.d.ts +0 -3
  185. package/src/generators/upgrade/schema.json +6 -16
  186. package/src/generators/upgrade/slice-compositions.d.ts +20 -0
  187. package/src/generators/upgrade/slice-compositions.js +100 -0
  188. package/src/generators/upgrade/slice-upgrade-guidance.d.ts +19 -0
  189. package/src/generators/upgrade/slice-upgrade-guidance.js +50 -0
  190. package/src/generators/upgrade/slice-upgrade.d.ts +4 -0
  191. package/src/generators/upgrade/slice-upgrade.js +231 -0
  192. package/src/generators/upgrade/upgrade-plan.d.ts +10 -13
  193. package/src/generators/upgrade/upgrade-plan.js +33 -197
  194. package/src/generators/upgrade/upgrade-preflight.d.ts +20 -0
  195. package/src/generators/upgrade/upgrade-preflight.js +64 -0
  196. package/src/generators/upgrade/upgrade.d.ts +8 -53
  197. package/src/generators/upgrade/upgrade.js +23 -1571
  198. package/src/generators/workload/schema.json +2 -2
  199. package/src/generators/workload/workload.d.ts +11 -11
  200. package/src/generators/workload/workload.js +166 -1255
  201. package/src/index.d.ts +0 -5
  202. package/src/index.js +0 -5
  203. package/src/local-dev/browser-verification.d.ts +0 -7
  204. package/src/local-dev/browser-verification.js +0 -136
  205. package/src/local-dev/contracts.d.ts +6 -0
  206. package/src/local-dev/contracts.js +17 -9
  207. package/src/local-dev/environment-checks.d.ts +126 -0
  208. package/src/local-dev/environment-checks.js +81 -0
  209. package/src/local-dev/environment-inspector.d.ts +3 -124
  210. package/src/local-dev/environment-inspector.js +9 -148
  211. package/src/local-dev/private-state.d.ts +1 -0
  212. package/src/local-dev/private-state.js +19 -23
  213. package/src/local-dev/process-identity.js +4 -2
  214. package/src/local-dev/slice-runner-child.d.ts +37 -0
  215. package/src/local-dev/slice-runner-child.js +127 -0
  216. package/src/local-dev/slice-runner-recovery.d.ts +32 -0
  217. package/src/local-dev/slice-runner-recovery.js +216 -0
  218. package/src/local-dev/slice-runner-state.d.ts +82 -0
  219. package/src/local-dev/slice-runner-state.js +265 -0
  220. package/src/local-dev/slice-runner.d.ts +4 -117
  221. package/src/local-dev/slice-runner.js +59 -594
  222. package/src/local-dev/tls.js +8 -97
  223. package/src/ownership/index.d.ts +1 -0
  224. package/src/ownership/index.js +6 -0
  225. package/src/ownership/pnpm-workspace.d.ts +77 -0
  226. package/src/ownership/pnpm-workspace.js +225 -0
  227. package/src/ownership/site-record.d.ts +8 -0
  228. package/src/ownership/site-record.js +17 -2
  229. package/src/repository-policy/capacity-migration.d.ts +1 -1
  230. package/src/repository-policy/capacity-migration.js +1 -1
  231. package/src/repository-policy/foundation-router.d.ts +17 -0
  232. package/src/repository-policy/foundation-router.js +44 -0
  233. package/src/repository-policy/index.d.ts +2 -0
  234. package/src/repository-policy/index.js +2 -0
  235. package/src/repository-policy/policy-accounts.d.ts +22 -0
  236. package/src/repository-policy/policy-accounts.js +134 -0
  237. package/src/repository-policy/policy-files.d.ts +8 -0
  238. package/src/repository-policy/policy-files.js +201 -0
  239. package/src/repository-policy/policy-internal.d.ts +2 -0
  240. package/src/repository-policy/policy-internal.js +11 -0
  241. package/src/repository-policy/policy-model.d.ts +95 -0
  242. package/src/repository-policy/policy-model.js +42 -0
  243. package/src/repository-policy/policy-validation.d.ts +4 -0
  244. package/src/repository-policy/policy-validation.js +308 -0
  245. package/src/repository-policy/policy.d.ts +5 -120
  246. package/src/repository-policy/policy.js +34 -662
  247. package/src/repository-policy/public-dns.d.ts +4 -0
  248. package/src/repository-policy/public-dns.js +102 -5
  249. package/src/{generators/repository-policy → repository-policy}/tree-policy.d.ts +1 -1
  250. package/src/{generators/repository-policy → repository-policy}/tree-policy.js +5 -5
  251. package/src/schemas/repository-policy-v1.json +40 -3
  252. package/src/secrets/index.d.ts +0 -5
  253. package/src/secrets/index.js +0 -5
  254. package/src/slice-infra/index.d.ts +57 -0
  255. package/src/slice-infra/index.js +117 -0
  256. package/src/slice-scripts/build.d.ts +27 -0
  257. package/src/slice-scripts/build.js +120 -0
  258. package/src/slice-scripts/database.d.ts +87 -0
  259. package/src/slice-scripts/database.js +328 -0
  260. package/src/slice-scripts/index.d.ts +11 -0
  261. package/src/slice-scripts/index.js +23 -0
  262. package/src/slice-scripts/root-site-routes.d.ts +11 -0
  263. package/src/slice-scripts/root-site-routes.js +83 -0
  264. package/src/slice-scripts/sql-migration-engine.mjs +180 -0
  265. package/src/workload-roles/effective-policy.d.ts +0 -37
  266. package/src/workload-roles/effective-policy.js +1 -174
  267. package/src/workload-roles/standard-slice.d.ts +2 -19
  268. package/src/workload-roles/standard-slice.js +3 -129
  269. package/src/api-contract/baseline-update.d.ts +0 -82
  270. package/src/api-contract/baseline-update.js +0 -225
  271. package/src/api-contract/compatibility.d.ts +0 -30
  272. package/src/api-contract/compatibility.js +0 -643
  273. package/src/api-contract/contract-graph.d.ts +0 -35
  274. package/src/api-contract/contract-graph.js +0 -141
  275. package/src/api-contract/evidence.d.ts +0 -23
  276. package/src/api-contract/evidence.js +0 -87
  277. package/src/api-contract/index.d.ts +0 -6
  278. package/src/api-contract/index.js +0 -10
  279. package/src/api-contract/model.d.ts +0 -144
  280. package/src/api-contract/model.js +0 -993
  281. package/src/api-contract/rollout.d.ts +0 -32
  282. package/src/api-contract/rollout.js +0 -88
  283. package/src/authorization/compatibility.d.ts +0 -62
  284. package/src/authorization/compatibility.js +0 -175
  285. package/src/authorization/index.d.ts +0 -1
  286. package/src/authorization/index.js +0 -5
  287. package/src/blueprints/execution.d.ts +0 -55
  288. package/src/blueprints/execution.js +0 -329
  289. package/src/blueprints/external-sandbox.d.ts +0 -53
  290. package/src/blueprints/external-sandbox.js +0 -1194
  291. package/src/blueprints/index.d.ts +0 -5
  292. package/src/blueprints/index.js +0 -9
  293. package/src/blueprints/inputs.d.ts +0 -43
  294. package/src/blueprints/inputs.js +0 -103
  295. package/src/blueprints/manifest.d.ts +0 -281
  296. package/src/blueprints/manifest.js +0 -424
  297. package/src/blueprints/resolver.d.ts +0 -37
  298. package/src/blueprints/resolver.js +0 -387
  299. package/src/blueprints/transitions.d.ts +0 -20
  300. package/src/blueprints/transitions.js +0 -61
  301. package/src/cli/agent-command.d.ts +0 -30
  302. package/src/cli/agent-command.js +0 -204
  303. package/src/cli/agent-runtime.d.ts +0 -25
  304. package/src/cli/agent-runtime.js +0 -498
  305. package/src/cli/blueprint-authority.d.ts +0 -9
  306. package/src/cli/blueprint-authority.js +0 -43
  307. package/src/cli/blueprint-command.d.ts +0 -24
  308. package/src/cli/blueprint-command.js +0 -63
  309. package/src/data-lifecycle/index.d.ts +0 -3
  310. package/src/data-lifecycle/index.js +0 -7
  311. package/src/data-lifecycle/model.d.ts +0 -172
  312. package/src/data-lifecycle/model.js +0 -95
  313. package/src/data-lifecycle/sensitive-artifacts.d.ts +0 -28
  314. package/src/data-lifecycle/sensitive-artifacts.js +0 -146
  315. package/src/data-lifecycle/validation.d.ts +0 -32
  316. package/src/data-lifecycle/validation.js +0 -837
  317. package/src/database-retirement/contract.d.ts +0 -68
  318. package/src/database-retirement/contract.js +0 -166
  319. package/src/database-retirement/index.d.ts +0 -1
  320. package/src/database-retirement/index.js +0 -5
  321. package/src/developer-agent/context.d.ts +0 -57
  322. package/src/developer-agent/context.js +0 -662
  323. package/src/developer-agent/generator-planning.d.ts +0 -34
  324. package/src/developer-agent/generator-planning.js +0 -759
  325. package/src/developer-agent/generator-preview.d.ts +0 -8
  326. package/src/developer-agent/generator-preview.js +0 -650
  327. package/src/developer-agent/git-inspection.d.ts +0 -112
  328. package/src/developer-agent/git-inspection.js +0 -887
  329. package/src/developer-agent/handoff.d.ts +0 -43
  330. package/src/developer-agent/handoff.js +0 -713
  331. package/src/developer-agent/index.d.ts +0 -10
  332. package/src/developer-agent/index.js +0 -14
  333. package/src/developer-agent/model.d.ts +0 -497
  334. package/src/developer-agent/model.js +0 -144
  335. package/src/developer-agent/operation-registry.d.ts +0 -61
  336. package/src/developer-agent/operation-registry.js +0 -1591
  337. package/src/developer-agent/ordering.d.ts +0 -9
  338. package/src/developer-agent/ordering.js +0 -15
  339. package/src/developer-agent/planning.d.ts +0 -25
  340. package/src/developer-agent/planning.js +0 -481
  341. package/src/developer-agent/preview-changes.js +0 -225
  342. package/src/developer-agent/preview-source.d.ts +0 -2
  343. package/src/developer-agent/preview-source.js +0 -19
  344. package/src/developer-agent/validation.d.ts +0 -30
  345. package/src/developer-agent/validation.js +0 -2729
  346. package/src/developer-agent/workspace-inspection.d.ts +0 -20
  347. package/src/developer-agent/workspace-inspection.js +0 -1236
  348. package/src/developer-agent/workspace-path.d.ts +0 -6
  349. package/src/developer-agent/workspace-path.js +0 -22
  350. package/src/executors/blueprint-trust/blueprint-trust.d.ts +0 -29
  351. package/src/executors/blueprint-trust/blueprint-trust.js +0 -121
  352. package/src/executors/blueprint-trust/schema.json +0 -27
  353. package/src/executors/blueprint-verification/blueprint-verification.d.ts +0 -13
  354. package/src/executors/blueprint-verification/blueprint-verification.js +0 -110
  355. package/src/executors/blueprint-verification/schema.json +0 -44
  356. package/src/executors/developer-context/developer-context.d.ts +0 -38
  357. package/src/executors/developer-context/developer-context.js +0 -78
  358. package/src/executors/developer-context/schema.json +0 -87
  359. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.d.ts +0 -19
  360. package/src/executors/foundation-profile-preflight/foundation-profile-preflight.js +0 -105
  361. package/src/executors/foundation-profile-preflight/schema.json +0 -32
  362. package/src/executors/github-bootstrap/github-bootstrap.d.ts +0 -13
  363. package/src/executors/github-bootstrap/github-bootstrap.js +0 -62
  364. package/src/executors/github-bootstrap/schema.json +0 -50
  365. package/src/executors/infrastructure-plan/infrastructure-plan.d.ts +0 -37
  366. package/src/executors/infrastructure-plan/infrastructure-plan.js +0 -275
  367. package/src/executors/infrastructure-plan/schema.json +0 -38
  368. package/src/executors/router-waf-rehearsal/router-waf-rehearsal.d.ts +0 -42
  369. package/src/executors/router-waf-rehearsal/router-waf-rehearsal.js +0 -1229
  370. package/src/executors/router-waf-rehearsal/schema.json +0 -29
  371. package/src/executors/secret-guardrails/schema.json +0 -6
  372. package/src/executors/secret-guardrails/secret-guardrails.d.ts +0 -3
  373. package/src/executors/secret-guardrails/secret-guardrails.js +0 -44
  374. package/src/executors/secret-initialize/schema.json +0 -42
  375. package/src/executors/secret-initialize/secret-initialize.d.ts +0 -34
  376. package/src/executors/secret-initialize/secret-initialize.js +0 -297
  377. package/src/executors/secret-metadata/schema.json +0 -36
  378. package/src/executors/secret-metadata/secret-metadata.d.ts +0 -46
  379. package/src/executors/secret-metadata/secret-metadata.js +0 -230
  380. package/src/executors/sst-lifecycle/generated-secret-retirement.d.ts +0 -53
  381. package/src/executors/sst-lifecycle/generated-secret-retirement.js +0 -192
  382. package/src/executors/sst-lifecycle/logging-preflight.d.ts +0 -22
  383. package/src/executors/sst-lifecycle/logging-preflight.js +0 -217
  384. package/src/executors/sst-lifecycle/secret-preflight.d.ts +0 -27
  385. package/src/executors/sst-lifecycle/secret-preflight.js +0 -125
  386. package/src/executors/work-markers/schema.json +0 -14
  387. package/src/executors/work-markers/work-markers.d.ts +0 -6
  388. package/src/executors/work-markers/work-markers.js +0 -20
  389. package/src/foundation/cost-estimate.d.ts +0 -175
  390. package/src/foundation/cost-estimate.js +0 -706
  391. package/src/foundation/private-smoke-admission.d.ts +0 -45
  392. package/src/foundation/private-smoke-admission.js +0 -180
  393. package/src/foundation/private-smoke-control-plane.d.ts +0 -18
  394. package/src/foundation/private-smoke-control-plane.js +0 -184
  395. package/src/foundation/root-site-readiness.d.ts +0 -27
  396. package/src/foundation/root-site-readiness.js +0 -78
  397. package/src/foundation/router-waf-rate-rehearsal.d.ts +0 -97
  398. package/src/foundation/router-waf-rate-rehearsal.js +0 -210
  399. package/src/foundation/router-waf.d.ts +0 -149
  400. package/src/foundation/router-waf.js +0 -809
  401. package/src/frontend-security/index.d.ts +0 -1
  402. package/src/frontend-security/index.js +0 -5
  403. package/src/frontend-security/security-headers.d.ts +0 -50
  404. package/src/frontend-security/security-headers.js +0 -418
  405. package/src/generators/blueprint/blueprint.d.ts +0 -5
  406. package/src/generators/blueprint/blueprint.js +0 -102
  407. package/src/generators/blueprint/files.d.ts +0 -6
  408. package/src/generators/blueprint/files.js +0 -217
  409. package/src/generators/blueprint/schema.d.ts +0 -4
  410. package/src/generators/blueprint/schema.json +0 -18
  411. package/src/generators/feature-registry.d.ts +0 -13
  412. package/src/generators/feature-registry.js +0 -73
  413. package/src/generators/function/function-registration.d.ts +0 -24
  414. package/src/generators/function/function-registration.js +0 -66
  415. package/src/generators/observability-infrastructure.d.ts +0 -2
  416. package/src/generators/observability-infrastructure.js +0 -31
  417. package/src/generators/preset/workspace-files-adopter-skills.d.ts +0 -7
  418. package/src/generators/preset/workspace-files-adopter-skills.js +0 -359
  419. package/src/generators/preset/workspace-files-agent-development.d.ts +0 -9
  420. package/src/generators/preset/workspace-files-agent-development.js +0 -42
  421. package/src/generators/preset/workspace-files-ci-acceptance.d.ts +0 -1
  422. package/src/generators/preset/workspace-files-ci-acceptance.js +0 -791
  423. package/src/generators/preset/workspace-files-ci-install.d.ts +0 -2
  424. package/src/generators/preset/workspace-files-ci-install.js +0 -196
  425. package/src/generators/preset/workspace-files-developer-agent.d.ts +0 -16
  426. package/src/generators/preset/workspace-files-developer-agent.js +0 -644
  427. package/src/generators/preset/workspace-files-ecr-inspector.d.ts +0 -18
  428. package/src/generators/preset/workspace-files-ecr-inspector.js +0 -298
  429. package/src/generators/preset/workspace-files-foundation-workload-roles.d.ts +0 -6
  430. package/src/generators/preset/workspace-files-foundation-workload-roles.js +0 -409
  431. package/src/generators/preset/workspace-files-performance-cost.d.ts +0 -66
  432. package/src/generators/preset/workspace-files-performance-cost.js +0 -866
  433. package/src/generators/preset/workspace-files-performance-load.d.ts +0 -73
  434. package/src/generators/preset/workspace-files-performance-load.js +0 -815
  435. package/src/generators/preset/workspace-files-shared-operation-claims.d.ts +0 -10
  436. package/src/generators/preset/workspace-files-shared-operation-claims.js +0 -59
  437. package/src/generators/preset/workspace-files-stage-authority.d.ts +0 -6
  438. package/src/generators/preset/workspace-files-stage-authority.js +0 -586
  439. package/src/generators/preset/workspace-files-thin-deploy.d.ts +0 -76
  440. package/src/generators/preset/workspace-files-thin-deploy.js +0 -2563
  441. package/src/generators/preset/workspace-files-thin-docs.d.ts +0 -7
  442. package/src/generators/preset/workspace-files-thin-docs.js +0 -386
  443. package/src/generators/preset/workspace-files-thin-release.d.ts +0 -14
  444. package/src/generators/preset/workspace-files-thin-release.js +0 -26
  445. package/src/generators/preset/workspace-files-workload-role-baseline.d.ts +0 -9
  446. package/src/generators/preset/workspace-files-workload-role-baseline.js +0 -1314
  447. package/src/generators/repository-policy/repository-policy.d.ts +0 -4
  448. package/src/generators/repository-policy/repository-policy.js +0 -294
  449. package/src/generators/repository-policy/schema.d.ts +0 -30
  450. package/src/generators/repository-policy/schema.json +0 -127
  451. package/src/generators/site/built-in-site-smoke-files.d.ts +0 -2
  452. package/src/generators/site/built-in-site-smoke-files.js +0 -37
  453. package/src/generators/slice/built-in-plan-alarm-identity.d.ts +0 -182
  454. package/src/generators/slice/built-in-plan-alarm-identity.js +0 -209
  455. package/src/generators/slice/built-in-plan-api-contract-files.d.ts +0 -2
  456. package/src/generators/slice/built-in-plan-api-contract-files.js +0 -2848
  457. package/src/generators/slice/built-in-plan-async-work-files.d.ts +0 -2
  458. package/src/generators/slice/built-in-plan-async-work-files.js +0 -6118
  459. package/src/generators/slice/built-in-plan-authorization-files.d.ts +0 -2
  460. package/src/generators/slice/built-in-plan-authorization-files.js +0 -2082
  461. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.d.ts +0 -2
  462. package/src/generators/slice/built-in-plan-authorization-infrastructure-files.js +0 -1301
  463. package/src/generators/slice/built-in-plan-authorization-storage.d.ts +0 -3
  464. package/src/generators/slice/built-in-plan-authorization-storage.js +0 -119
  465. package/src/generators/slice/built-in-plan-background-work-files.d.ts +0 -2
  466. package/src/generators/slice/built-in-plan-background-work-files.js +0 -99
  467. package/src/generators/slice/built-in-plan-data-deletion-files.d.ts +0 -2
  468. package/src/generators/slice/built-in-plan-data-deletion-files.js +0 -273
  469. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.d.ts +0 -2
  470. package/src/generators/slice/built-in-plan-data-export-infrastructure-files.js +0 -223
  471. package/src/generators/slice/built-in-plan-data-files.d.ts +0 -2
  472. package/src/generators/slice/built-in-plan-data-files.js +0 -618
  473. package/src/generators/slice/built-in-plan-data-lifecycle-files.d.ts +0 -2
  474. package/src/generators/slice/built-in-plan-data-lifecycle-files.js +0 -775
  475. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.d.ts +0 -2
  476. package/src/generators/slice/built-in-plan-data-lifecycle-runtime-files.js +0 -863
  477. package/src/generators/slice/built-in-plan-data-retention-job-files.d.ts +0 -2
  478. package/src/generators/slice/built-in-plan-data-retention-job-files.js +0 -169
  479. package/src/generators/slice/built-in-plan-data-retention-launcher-files.d.ts +0 -2
  480. package/src/generators/slice/built-in-plan-data-retention-launcher-files.js +0 -186
  481. package/src/generators/slice/built-in-plan-data-rights-files.d.ts +0 -2
  482. package/src/generators/slice/built-in-plan-data-rights-files.js +0 -152
  483. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.d.ts +0 -2
  484. package/src/generators/slice/built-in-plan-database-retirement-rehearsal-files.js +0 -508
  485. package/src/generators/slice/built-in-plan-event-contract-literal.d.ts +0 -6
  486. package/src/generators/slice/built-in-plan-event-contract-literal.js +0 -52
  487. package/src/generators/slice/built-in-plan-foundation-files.d.ts +0 -15
  488. package/src/generators/slice/built-in-plan-foundation-files.js +0 -314
  489. package/src/generators/slice/built-in-plan-frontend-files.d.ts +0 -2
  490. package/src/generators/slice/built-in-plan-frontend-files.js +0 -1975
  491. package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +0 -6
  492. package/src/generators/slice/built-in-plan-frontend-header-proof.js +0 -282
  493. package/src/generators/slice/built-in-plan-infrastructure-safety-files.d.ts +0 -2
  494. package/src/generators/slice/built-in-plan-infrastructure-safety-files.js +0 -373
  495. package/src/generators/slice/built-in-plan-key-value-cleanup.d.ts +0 -4
  496. package/src/generators/slice/built-in-plan-key-value-cleanup.js +0 -101
  497. package/src/generators/slice/built-in-plan-key-value-consumer.d.ts +0 -4
  498. package/src/generators/slice/built-in-plan-key-value-consumer.js +0 -151
  499. package/src/generators/slice/built-in-plan-key-value-deletion.d.ts +0 -2
  500. package/src/generators/slice/built-in-plan-key-value-deletion.js +0 -377
  501. package/src/generators/slice/built-in-plan-key-value-delivery.d.ts +0 -2
  502. package/src/generators/slice/built-in-plan-key-value-delivery.js +0 -137
  503. package/src/generators/slice/built-in-plan-key-value-export.d.ts +0 -2
  504. package/src/generators/slice/built-in-plan-key-value-export.js +0 -595
  505. package/src/generators/slice/built-in-plan-key-value-holds.d.ts +0 -2
  506. package/src/generators/slice/built-in-plan-key-value-holds.js +0 -189
  507. package/src/generators/slice/built-in-plan-key-value-infrastructure.d.ts +0 -2
  508. package/src/generators/slice/built-in-plan-key-value-infrastructure.js +0 -102
  509. package/src/generators/slice/built-in-plan-key-value-performance.d.ts +0 -5
  510. package/src/generators/slice/built-in-plan-key-value-performance.js +0 -530
  511. package/src/generators/slice/built-in-plan-key-value-provider.d.ts +0 -4
  512. package/src/generators/slice/built-in-plan-key-value-provider.js +0 -366
  513. package/src/generators/slice/built-in-plan-key-value-records.d.ts +0 -3
  514. package/src/generators/slice/built-in-plan-key-value-records.js +0 -232
  515. package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.d.ts +0 -2
  516. package/src/generators/slice/built-in-plan-key-value-retention-infrastructure.js +0 -103
  517. package/src/generators/slice/built-in-plan-key-value-retention-job-files.d.ts +0 -2
  518. package/src/generators/slice/built-in-plan-key-value-retention-job-files.js +0 -160
  519. package/src/generators/slice/built-in-plan-key-value-retention-maintenance.d.ts +0 -2
  520. package/src/generators/slice/built-in-plan-key-value-retention-maintenance.js +0 -329
  521. package/src/generators/slice/built-in-plan-key-value-retention-worker.d.ts +0 -2
  522. package/src/generators/slice/built-in-plan-key-value-retention-worker.js +0 -477
  523. package/src/generators/slice/built-in-plan-key-value-retention.d.ts +0 -2
  524. package/src/generators/slice/built-in-plan-key-value-retention.js +0 -184
  525. package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +0 -29
  526. package/src/generators/slice/built-in-plan-log-group-helpers.js +0 -130
  527. package/src/generators/slice/built-in-plan-metadata-files.d.ts +0 -3
  528. package/src/generators/slice/built-in-plan-metadata-files.js +0 -401
  529. package/src/generators/slice/built-in-plan-native-runtime-authority-files.d.ts +0 -2
  530. package/src/generators/slice/built-in-plan-native-runtime-authority-files.js +0 -324
  531. package/src/generators/slice/built-in-plan-next-build-authority.d.ts +0 -5
  532. package/src/generators/slice/built-in-plan-next-build-authority.js +0 -124
  533. package/src/generators/slice/built-in-plan-operations-files.d.ts +0 -8
  534. package/src/generators/slice/built-in-plan-operations-files.js +0 -1106
  535. package/src/generators/slice/built-in-plan-performance-files.d.ts +0 -4
  536. package/src/generators/slice/built-in-plan-performance-files.js +0 -2444
  537. package/src/generators/slice/built-in-plan-release-files.d.ts +0 -2
  538. package/src/generators/slice/built-in-plan-release-files.js +0 -6585
  539. package/src/generators/slice/built-in-plan-reliability-files.d.ts +0 -2
  540. package/src/generators/slice/built-in-plan-reliability-files.js +0 -4728
  541. package/src/generators/slice/built-in-plan-secret-runtime-files.d.ts +0 -2
  542. package/src/generators/slice/built-in-plan-secret-runtime-files.js +0 -1015
  543. package/src/generators/slice/built-in-plan-sql-events.d.ts +0 -2
  544. package/src/generators/slice/built-in-plan-sql-events.js +0 -276
  545. package/src/generators/slice/built-in-plan-testing-files.d.ts +0 -2
  546. package/src/generators/slice/built-in-plan-testing-files.js +0 -2618
  547. package/src/generators/slice/built-in-plan-testing-persistence-event-files.d.ts +0 -7
  548. package/src/generators/slice/built-in-plan-testing-persistence-event-files.js +0 -487
  549. package/src/generators/slice/built-in-plan-testing-persistence-files.d.ts +0 -2
  550. package/src/generators/slice/built-in-plan-testing-persistence-files.js +0 -180
  551. package/src/generators/slice/built-in-plan-thin-release-files.d.ts +0 -11
  552. package/src/generators/slice/built-in-plan-thin-release-files.js +0 -162
  553. package/src/generators/slice/built-in-plan-verification-files.d.ts +0 -2
  554. package/src/generators/slice/built-in-plan-verification-files.js +0 -442
  555. package/src/generators/slice/built-in-plan-workload-role-files.d.ts +0 -2
  556. package/src/generators/slice/built-in-plan-workload-role-files.js +0 -2220
  557. package/src/generators/slice/data-policy-review-seed.d.ts +0 -2
  558. package/src/generators/slice/data-policy-review-seed.js +0 -22
  559. package/src/generators/slice/deployed-smoke-diagnostics.d.ts +0 -35
  560. package/src/generators/slice/deployed-smoke-diagnostics.js +0 -189
  561. package/src/generators/slice/deployed-smoke-readiness.d.ts +0 -9
  562. package/src/generators/slice/deployed-smoke-readiness.js +0 -309
  563. package/src/generators/slice/local-source-identity.d.ts +0 -2
  564. package/src/generators/slice/local-source-identity.js +0 -31
  565. package/src/generators/slice/pnpm-launch-script.d.ts +0 -13
  566. package/src/generators/slice/pnpm-launch-script.js +0 -28
  567. package/src/generators/upgrade/custom-domain-notice.d.ts +0 -19
  568. package/src/generators/upgrade/custom-domain-notice.js +0 -38
  569. package/src/generators/upgrade/external-blueprint-compositions.d.ts +0 -84
  570. package/src/generators/upgrade/external-blueprint-compositions.js +0 -478
  571. package/src/generators/upgrade/sql-seeded-reconciliation.d.ts +0 -2
  572. package/src/generators/upgrade/sql-seeded-reconciliation.js +0 -170
  573. package/src/generators/workload/performance-registration.d.ts +0 -33
  574. package/src/generators/workload/performance-registration.js +0 -224
  575. package/src/generators/workload/reliability-registration.d.ts +0 -16
  576. package/src/generators/workload/reliability-registration.js +0 -150
  577. package/src/generators/workload/service-performance-files.d.ts +0 -5
  578. package/src/generators/workload/service-performance-files.js +0 -1883
  579. package/src/git-policy/action-pins.d.ts +0 -43
  580. package/src/git-policy/action-pins.js +0 -50
  581. package/src/git-policy/github-bootstrap.d.ts +0 -95
  582. package/src/git-policy/github-bootstrap.js +0 -1250
  583. package/src/git-policy/index.d.ts +0 -3
  584. package/src/git-policy/index.js +0 -7
  585. package/src/git-policy/routing.d.ts +0 -21
  586. package/src/git-policy/routing.js +0 -138
  587. package/src/infrastructure-change/convergence.d.ts +0 -13
  588. package/src/infrastructure-change/convergence.js +0 -85
  589. package/src/infrastructure-change/drift.d.ts +0 -13
  590. package/src/infrastructure-change/drift.js +0 -112
  591. package/src/infrastructure-change/index.d.ts +0 -7
  592. package/src/infrastructure-change/index.js +0 -11
  593. package/src/infrastructure-change/local-capability.d.ts +0 -73
  594. package/src/infrastructure-change/local-capability.js +0 -114
  595. package/src/infrastructure-change/model.d.ts +0 -274
  596. package/src/infrastructure-change/model.js +0 -29
  597. package/src/infrastructure-change/normalize.d.ts +0 -16
  598. package/src/infrastructure-change/normalize.js +0 -285
  599. package/src/infrastructure-change/plan.d.ts +0 -67
  600. package/src/infrastructure-change/plan.js +0 -671
  601. package/src/infrastructure-change/risk.d.ts +0 -9
  602. package/src/infrastructure-change/risk.js +0 -349
  603. package/src/infrastructure-change/summary.d.ts +0 -20
  604. package/src/infrastructure-change/summary.js +0 -130
  605. package/src/performance/cost-collection.d.ts +0 -225
  606. package/src/performance/cost-collection.js +0 -827
  607. package/src/performance/cost-controls.d.ts +0 -135
  608. package/src/performance/cost-controls.js +0 -347
  609. package/src/performance/evidence.d.ts +0 -140
  610. package/src/performance/evidence.js +0 -601
  611. package/src/performance/index.d.ts +0 -10
  612. package/src/performance/index.js +0 -14
  613. package/src/performance/load-safety.d.ts +0 -84
  614. package/src/performance/load-safety.js +0 -348
  615. package/src/performance/model.d.ts +0 -129
  616. package/src/performance/model.js +0 -451
  617. package/src/performance/pr-artifact-budget.d.ts +0 -42
  618. package/src/performance/pr-artifact-budget.js +0 -151
  619. package/src/performance/runner.d.ts +0 -75
  620. package/src/performance/runner.js +0 -227
  621. package/src/performance/scenario-endpoint.d.ts +0 -1
  622. package/src/performance/scenario-endpoint.js +0 -5
  623. package/src/performance/scenario.d.ts +0 -215
  624. package/src/performance/scenario.js +0 -744
  625. package/src/performance/unit-cost.d.ts +0 -105
  626. package/src/performance/unit-cost.js +0 -364
  627. package/src/release/index.d.ts +0 -2
  628. package/src/release/index.js +0 -6
  629. package/src/release/lifecycle.d.ts +0 -132
  630. package/src/release/lifecycle.js +0 -411
  631. package/src/release/manifest.d.ts +0 -148
  632. package/src/release/manifest.js +0 -503
  633. package/src/release/rollout.d.ts +0 -170
  634. package/src/release/rollout.js +0 -578
  635. package/src/release/source-authority.d.ts +0 -19
  636. package/src/release/source-authority.js +0 -212
  637. package/src/schemas/aggregate-count-evidence-v1.json +0 -135
  638. package/src/schemas/api-contract-baseline-v1.json +0 -674
  639. package/src/schemas/api-contract-compatibility-report-v1.json +0 -126
  640. package/src/schemas/aws-billing-actual-evidence-v1.json +0 -407
  641. package/src/schemas/blueprint-input-schema-v1.json +0 -23
  642. package/src/schemas/blueprint-v1.json +0 -188
  643. package/src/schemas/data-lifecycle-policy-v1.json +0 -517
  644. package/src/schemas/performance-policy-v1.json +0 -335
  645. package/src/schemas/testing-evidence-quarantine-v1.json +0 -168
  646. package/src/schemas/testing-evidence-result-v1.json +0 -319
  647. package/src/secrets/aws-control-plane.d.ts +0 -29
  648. package/src/secrets/aws-control-plane.js +0 -322
  649. package/src/secrets/generated-aws-control-plane.d.ts +0 -33
  650. package/src/secrets/generated-aws-control-plane.js +0 -322
  651. package/src/secrets/guardrails.d.ts +0 -26
  652. package/src/secrets/guardrails.js +0 -328
  653. package/src/secrets/metadata.d.ts +0 -48
  654. package/src/secrets/metadata.js +0 -199
  655. package/src/secrets/operator.d.ts +0 -190
  656. package/src/secrets/operator.js +0 -701
  657. package/src/secrets/verification.d.ts +0 -18
  658. package/src/secrets/verification.js +0 -152
  659. package/src/supply-chain/action-pins.d.ts +0 -26
  660. package/src/supply-chain/action-pins.js +0 -262
  661. package/src/supply-chain/blueprint-trust-git.d.ts +0 -130
  662. package/src/supply-chain/blueprint-trust-git.js +0 -1666
  663. package/src/supply-chain/blueprint-trust-process.d.ts +0 -4
  664. package/src/supply-chain/blueprint-trust-process.js +0 -88
  665. package/src/supply-chain/blueprint-trust.d.ts +0 -354
  666. package/src/supply-chain/blueprint-trust.js +0 -1558
  667. package/src/supply-chain/blueprint-verification-authority.d.ts +0 -62
  668. package/src/supply-chain/blueprint-verification-authority.js +0 -679
  669. package/src/supply-chain/blueprint-verification-execution.d.ts +0 -68
  670. package/src/supply-chain/blueprint-verification-execution.js +0 -639
  671. package/src/supply-chain/build-output-bounds.d.ts +0 -2
  672. package/src/supply-chain/build-output-bounds.js +0 -12
  673. package/src/supply-chain/build-output.d.ts +0 -41
  674. package/src/supply-chain/build-output.js +0 -551
  675. package/src/supply-chain/common.d.ts +0 -21
  676. package/src/supply-chain/common.js +0 -107
  677. package/src/supply-chain/container-artifact-contract.d.ts +0 -23
  678. package/src/supply-chain/container-artifact-contract.js +0 -208
  679. package/src/supply-chain/container-release.d.ts +0 -119
  680. package/src/supply-chain/container-release.js +0 -496
  681. package/src/supply-chain/ecr-applicability.d.ts +0 -19
  682. package/src/supply-chain/ecr-applicability.js +0 -103
  683. package/src/supply-chain/ecr-scanning.d.ts +0 -85
  684. package/src/supply-chain/ecr-scanning.js +0 -325
  685. package/src/supply-chain/ecs-deployed-image.d.ts +0 -87
  686. package/src/supply-chain/ecs-deployed-image.js +0 -302
  687. package/src/supply-chain/errors.d.ts +0 -6
  688. package/src/supply-chain/errors.js +0 -15
  689. package/src/supply-chain/generated-blueprint-trust-command.d.ts +0 -4
  690. package/src/supply-chain/generated-blueprint-trust-command.js +0 -1394
  691. package/src/supply-chain/generated-command.d.ts +0 -1
  692. package/src/supply-chain/generated-command.js +0 -775
  693. package/src/supply-chain/generated-container-release-command.d.ts +0 -16
  694. package/src/supply-chain/generated-container-release-command.js +0 -3248
  695. package/src/supply-chain/generated-ecr-collector-command.d.ts +0 -20
  696. package/src/supply-chain/generated-ecr-collector-command.js +0 -1445
  697. package/src/supply-chain/generated-files.d.ts +0 -13
  698. package/src/supply-chain/generated-files.js +0 -421
  699. package/src/supply-chain/generated-scanner-command.d.ts +0 -1
  700. package/src/supply-chain/generated-scanner-command.js +0 -778
  701. package/src/supply-chain/index.d.ts +0 -28
  702. package/src/supply-chain/index.js +0 -36
  703. package/src/supply-chain/inventory.d.ts +0 -96
  704. package/src/supply-chain/inventory.js +0 -828
  705. package/src/supply-chain/license-expression.d.ts +0 -7
  706. package/src/supply-chain/license-expression.js +0 -128
  707. package/src/supply-chain/policy.d.ts +0 -105
  708. package/src/supply-chain/policy.js +0 -304
  709. package/src/supply-chain/publication.d.ts +0 -48
  710. package/src/supply-chain/publication.js +0 -85
  711. package/src/supply-chain/sbom.d.ts +0 -228
  712. package/src/supply-chain/sbom.js +0 -913
  713. package/src/supply-chain/scanner.d.ts +0 -77
  714. package/src/supply-chain/scanner.js +0 -514
  715. package/src/supply-chain/vendored-source.d.ts +0 -95
  716. package/src/supply-chain/vendored-source.js +0 -315
  717. package/src/testing-evidence/fixture-scope.d.ts +0 -53
  718. package/src/testing-evidence/fixture-scope.js +0 -142
  719. package/src/testing-evidence/index.d.ts +0 -5
  720. package/src/testing-evidence/index.js +0 -9
  721. package/src/testing-evidence/quarantine.d.ts +0 -48
  722. package/src/testing-evidence/quarantine.js +0 -253
  723. package/src/testing-evidence/result.d.ts +0 -109
  724. package/src/testing-evidence/result.js +0 -585
  725. package/src/testing-evidence/runner-adapter.d.ts +0 -51
  726. package/src/testing-evidence/runner-adapter.js +0 -288
  727. package/src/testing-evidence/sensitive-artifacts.d.ts +0 -13
  728. package/src/testing-evidence/sensitive-artifacts.js +0 -93
  729. package/src/work-markers/index.d.ts +0 -1
  730. package/src/work-markers/index.js +0 -5
  731. package/src/work-markers/work-markers.d.ts +0 -39
  732. package/src/work-markers/work-markers.js +0 -363
  733. package/src/workload-roles/account-baseline.d.ts +0 -143
  734. package/src/workload-roles/account-baseline.js +0 -980
  735. package/src/workload-roles/authority.d.ts +0 -40
  736. package/src/workload-roles/authority.js +0 -202
  737. package/src/workload-roles/aws-adapter.d.ts +0 -99
  738. package/src/workload-roles/aws-adapter.js +0 -416
  739. package/src/workload-roles/aws-internal-handler.d.ts +0 -27
  740. package/src/workload-roles/aws-internal-handler.js +0 -58
  741. package/src/workload-roles/aws-s3-state.d.ts +0 -52
  742. package/src/workload-roles/aws-s3-state.js +0 -191
  743. package/src/workload-roles/aws-sdk-control-plane.d.ts +0 -12
  744. package/src/workload-roles/aws-sdk-control-plane.js +0 -291
  745. package/src/workload-roles/boundary.d.ts +0 -34
  746. package/src/workload-roles/boundary.js +0 -137
  747. package/src/workload-roles/convergence.d.ts +0 -66
  748. package/src/workload-roles/convergence.js +0 -186
  749. package/src/workload-roles/handler.d.ts +0 -43
  750. package/src/workload-roles/handler.js +0 -158
  751. package/src/workload-roles/history.d.ts +0 -47
  752. package/src/workload-roles/history.js +0 -324
  753. package/src/workload-roles/injection.d.ts +0 -119
  754. package/src/workload-roles/injection.js +0 -495
  755. package/src/workload-roles/manifest.d.ts +0 -54
  756. package/src/workload-roles/manifest.js +0 -343
  757. package/src/workload-roles/provisioner.d.ts +0 -70
  758. package/src/workload-roles/provisioner.js +0 -239
  759. package/src/workload-roles/registration.d.ts +0 -102
  760. package/src/workload-roles/registration.js +0 -462
  761. package/src/workload-roles/stage-boundary.d.ts +0 -31
  762. package/src/workload-roles/stage-boundary.js +0 -208
  763. /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.d.ts +0 -0
  764. /package/src/executors/{foundation-profile-preflight → local-deploy}/production-database-safeguard.js +0 -0
@@ -1,3530 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES = exports.STAGE_AUTHORITY_WORKLOAD_IDENTITY_POLICY_ACTIONS = exports.STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES = exports.STAGE_RUNTIME_REGIONAL_SERVICE_FAMILIES = exports.STAGE_AUTHORITY_LOGS_MUTATION_FAMILIES = exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES = exports.STAGE_RUNTIME_GLOBAL_ACTIONS = exports.STAGE_RUNTIME_REGIONAL_ACTIONS = exports.STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS = exports.STAGE_AUTHORITY_PUBLIC_HOSTED_ZONE_ID = exports.STAGE_AUTHORITY_PUBLIC_DNS_RECORD_TYPES = exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_TYPES = exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_ACTIONS = exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_ROUTE53_ACTIONS = exports.STAGE_AUTHORITY_UNSUPPORTED_REPLICATION_AND_TOPOLOGY_ACTIONS = exports.STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS = exports.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS = exports.STAGE_AUTHORITY_LAMBDA_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_KMS_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_EC2_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_BACKUP_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_BROAD_REGIONAL_SERVICE_ACTIONS = exports.STAGE_AUTHORITY_EDGE_OBSERVABILITY_READ_ACTIONS = exports.STAGE_AUTHORITY_GLOBAL_READ_ACTIONS = exports.STAGE_AUTHORITY_REGIONAL_READ_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_WRITE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_READ_ACTIONS = exports.STAGE_AUTHORITY_KMS_ROTATION_ACTIONS = exports.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS = exports.STAGE_AUTHORITY_BUDGET_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS = exports.STAGE_AUTHORITY_WAF_LOGGING_ACTIONS = exports.STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS = exports.STAGE_AUTHORITY_LAMBDA_DEPLOYMENT_INVOKE_ACTIONS = exports.STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS = exports.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS = exports.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS = exports.STAGE_AUTHORITY_BOUND_TEMPLATE_BODY_MINIMUM_HEADROOM = exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT = exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM = exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT = exports.STAGE_AUTHORITY_DEPLOYMENT_POLICY_KINDS = exports.STAGE_AUTHORITY_PARTITIONS = exports.STAGE_AUTHORITY_STAGES = exports.STAGE_AUTHORITY_SCHEMA_VERSION = void 0;
4
- exports.STAGE_AUTHORITY_SERVICE_LINKED_ROLES = exports.STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS = exports.STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS = exports.STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS = exports.STAGE_AUTHORITY_REVIEWED_PERMISSION_MANAGEMENT_ACTIONS = exports.STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS = exports.STAGE_AUTHORITY_CROSS_STAGE_DESTRUCTIVE_ACTIONS = exports.STAGE_AUTHORITY_CROSS_ACCOUNT_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_CROSS_ACCOUNT_EC2_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_SST_417_EXTERNAL_AMI_OWNERS_BY_PARTITION = exports.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS = void 0;
5
- exports.createStageAuthorityIdentity = createStageAuthorityIdentity;
3
+ exports.STAGE_AUTHORITY_LAMBDA_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_LAMBDA_DEPLOYMENT_INVOKE_ACTIONS = exports.STAGE_AUTHORITY_KMS_ROTATION_ACTIONS = exports.STAGE_AUTHORITY_KMS_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_GLOBAL_READ_ACTIONS = exports.STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS = exports.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS = exports.STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS = exports.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_EDGE_OBSERVABILITY_READ_ACTIONS = exports.STAGE_AUTHORITY_EC2_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_WRITE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_READ_ACTIONS = exports.STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS = exports.STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS = exports.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS = exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_ROUTE53_ACTIONS = exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_TYPES = exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_ACTIONS = exports.STAGE_AUTHORITY_BUDGET_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_BROAD_REGIONAL_SERVICE_ACTIONS = exports.STAGE_AUTHORITY_BACKUP_INFRASTRUCTURE_ACTIONS = exports.STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS = exports.STAGE_AUTHORITY_WORKLOAD_IDENTITY_POLICY_ACTIONS = exports.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS = exports.STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS = exports.STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS = exports.STAGE_AUTHORITY_SST_417_EXTERNAL_AMI_OWNERS_BY_PARTITION = exports.STAGE_AUTHORITY_SERVICE_LINKED_ROLES = exports.STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES = exports.STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_REVIEWED_PERMISSION_MANAGEMENT_ACTIONS = exports.STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS = exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_CROSS_STAGE_DESTRUCTIVE_ACTIONS = exports.STAGE_AUTHORITY_CROSS_ACCOUNT_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_CROSS_ACCOUNT_EC2_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES = exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT = exports.STAGE_AUTHORITY_STAGES = exports.STAGE_AUTHORITY_SCHEMA_VERSION = exports.STAGE_AUTHORITY_PARTITIONS = exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT = exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM = exports.STAGE_AUTHORITY_DEPLOYMENT_POLICY_KINDS = exports.STAGE_AUTHORITY_BOUND_TEMPLATE_BODY_MINIMUM_HEADROOM = exports.installStageIamBoundaryTransforms = exports.createStageIamBoundaryTransformContract = void 0;
4
+ exports.createStageAuthorityIdentity = exports.STAGE_RUNTIME_REGIONAL_SERVICE_FAMILIES = exports.STAGE_RUNTIME_REGIONAL_ACTIONS = exports.STAGE_RUNTIME_GLOBAL_ACTIONS = exports.STAGE_AUTHORITY_WAF_LOGGING_ACTIONS = exports.STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_UNSUPPORTED_REPLICATION_AND_TOPOLOGY_ACTIONS = exports.STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS = exports.STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS = exports.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS = exports.STAGE_AUTHORITY_REGIONAL_READ_ACTIONS = exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES = exports.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS = exports.STAGE_AUTHORITY_PUBLIC_HOSTED_ZONE_ID = exports.STAGE_AUTHORITY_PUBLIC_DNS_RECORD_TYPES = exports.STAGE_AUTHORITY_LOGS_MUTATION_FAMILIES = void 0;
6
5
  exports.canonicalStageAuthorityTemplate = canonicalStageAuthorityTemplate;
7
6
  exports.digestStageAuthorityTemplate = digestStageAuthorityTemplate;
8
7
  exports.assertBoundStageAuthorityTemplateFitsBodyLimit = assertBoundStageAuthorityTemplateFitsBodyLimit;
9
8
  exports.createStageAuthorityPlan = createStageAuthorityPlan;
10
- exports.createStageIamBoundaryTransformContract = createStageIamBoundaryTransformContract;
11
- exports.installStageIamBoundaryTransforms = installStageIamBoundaryTransforms;
12
9
  const node_crypto_1 = require("node:crypto");
13
- exports.STAGE_AUTHORITY_SCHEMA_VERSION = 1;
14
- exports.STAGE_AUTHORITY_STAGES = [
15
- 'development',
16
- 'staging',
17
- 'production',
18
- ];
19
- exports.STAGE_AUTHORITY_PARTITIONS = [
20
- 'aws',
21
- 'aws-cn',
22
- 'aws-us-gov',
23
- ];
24
- exports.STAGE_AUTHORITY_DEPLOYMENT_POLICY_KINDS = [
25
- 'read',
26
- 'regional-mutation',
27
- 'global-iam-mutation',
28
- 'global-resource-mutation',
29
- 'generated-resource-mutation',
30
- 'stage-containment',
31
- 'permission-guardrails',
32
- 'guardrails',
33
- ];
34
- exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT = 6_144;
35
- exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM = 200;
36
- exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT = 51_200;
37
- exports.STAGE_AUTHORITY_BOUND_TEMPLATE_BODY_MINIMUM_HEADROOM = 256;
38
- const STAGE_AUTHORITY_MAX_AWS_PRINCIPALS = 16;
39
- const STAGE_AUTHORITY_MAX_AWS_PRINCIPAL_ARN_BYTES = 2_048;
40
- // IAM glob syntax cannot validate hexadecimal characters. Framework task
41
- // admission validates exact lowercase hex; this is only a bounded IAM shape.
42
- const TASK_STAGE_IAM_SHAPE = `personal-${'?'.repeat(24)}`;
43
- const TASK_PRINCIPAL_STAGE = '${aws:PrincipalTag/ebk:stage}';
44
- const ACCOUNT_ID = /^\d{12}$/u;
45
- const REGION = /^(?:(?:af|ap|ca|cn|eu|il|me|mx|sa|us)(?:-(?:gov|iso|isob|isoe|isof))?|eusc-[a-z]{2})-[a-z]+-\d$/u;
46
- const AWS_PRINCIPAL_ARN = /^arn:(aws|aws-cn|aws-us-gov):iam::(\d{12}):role\/[A-Za-z0-9+=,.@_/-]+$/u;
47
- const GITHUB_OIDC_PROVIDER_ARN = /^arn:(aws|aws-cn|aws-us-gov):iam::(\d{12}):oidc-provider\/token[.]actions[.]githubusercontent[.]com$/u;
48
- const GITHUB_SUBJECT = /^repo:[A-Za-z0-9_.-]+@[1-9][0-9]{0,19}\/[A-Za-z0-9_.-]+@[1-9][0-9]{0,19}:environment:(development|staging|production)$/u;
49
- /** Native lifecycle required by the generated machine-authorization nested
50
- * stack. Recovery-only and stack-policy mutation APIs remain ungranted. */
51
- exports.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS = Object.freeze([
52
- 'cloudformation:CreateStack',
53
- 'cloudformation:DeleteStack',
54
- 'cloudformation:UpdateStack',
55
- ].sort(compareStrings));
56
- /** EventBridge archives expose no request-tag or resource-tag IAM condition
57
- * keys. Their lifecycle is contained by the exact canonical archive ARN and
58
- * requested Region instead. */
59
- exports.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS = Object.freeze([
60
- 'events:CreateArchive',
61
- ]);
62
- exports.STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS = Object.freeze(['events:DeleteArchive', 'events:UpdateArchive'].sort(compareStrings));
63
- exports.STAGE_AUTHORITY_LAMBDA_DEPLOYMENT_INVOKE_ACTIONS = Object.freeze([
64
- 'lambda:InvokeFunction',
65
- ]);
66
- exports.STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS = Object.freeze([
67
- 'cloudfront:CreateInvalidation',
68
- ]);
69
- exports.STAGE_AUTHORITY_WAF_LOGGING_ACTIONS = Object.freeze([
70
- 'wafv2:PutLoggingConfiguration',
71
- ]);
72
- /** SST's CloudFront-scope WAF logging component owns exactly one generated log
73
- * group in the edge control Region. These resource-capable actions stay bound
74
- * to that generated ARN below. */
75
- exports.STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS = Object.freeze([
76
- 'logs:CreateLogGroup',
77
- 'logs:DeleteLogGroup',
78
- 'logs:DeleteRetentionPolicy',
79
- 'logs:PutRetentionPolicy',
80
- 'logs:TagLogGroup',
81
- 'logs:TagResource',
82
- 'logs:UntagLogGroup',
83
- 'logs:UntagResource',
84
- ].sort(compareStrings));
85
- /** CloudWatch Logs exposes these WAF delivery mutations only at account scope.
86
- * In particular, PutResourcePolicy supports neither resource ARNs nor
87
- * action-specific condition keys. Requested Region and reviewed generated
88
- * source are therefore the strongest honest controls for that one exception. */
89
- exports.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS = Object.freeze([
90
- 'logs:CreateLogDelivery',
91
- 'logs:DeleteLogDelivery',
92
- 'logs:PutResourcePolicy',
93
- ].sort(compareStrings));
94
- exports.STAGE_AUTHORITY_BUDGET_MUTATION_ACTIONS = Object.freeze(['budgets:ModifyBudget', 'budgets:TagResource', 'budgets:UntagResource'].sort(compareStrings));
95
- exports.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS = Object.freeze([
96
- 'rds:AddSourceIdentifierToSubscription',
97
- 'rds:RemoveSourceIdentifierFromSubscription',
98
- ].sort(compareStrings));
99
- exports.STAGE_AUTHORITY_KMS_ROTATION_ACTIONS = Object.freeze([
100
- 'kms:EnableKeyRotation',
101
- ]);
102
- /** Commercial AWS exposes CloudFront, CloudFront-scope WAF, and edge
103
- * certificates through us-east-1 even when the application stage is deployed
104
- * elsewhere. This batch intentionally preserves the selected Region for
105
- * nonstandard partitions; CloudFront is not available inside GovCloud. */
106
- function edgeControlRegion(partition, deploymentRegion) {
107
- return partition === 'aws' ? 'us-east-1' : deploymentRegion;
108
- }
109
- /** Cost Explorer creation is account-global, while existing anomaly controls
110
- * support account-bound ARNs. These exact verbs are admitted only to the
111
- * production stage role below. */
112
- exports.STAGE_AUTHORITY_COST_ANOMALY_READ_ACTIONS = Object.freeze([
113
- 'ce:GetAnomalyMonitors',
114
- 'ce:GetAnomalySubscriptions',
115
- 'ce:ListTagsForResource',
116
- ].sort(compareStrings));
117
- exports.STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS = Object.freeze(['ce:CreateAnomalyMonitor', 'ce:CreateAnomalySubscription'].sort(compareStrings));
118
- exports.STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS = Object.freeze([
119
- 'ce:DeleteAnomalyMonitor',
120
- 'ce:DeleteAnomalySubscription',
121
- 'ce:TagResource',
122
- 'ce:UntagResource',
123
- 'ce:UpdateAnomalyMonitor',
124
- 'ce:UpdateAnomalySubscription',
125
- ].sort(compareStrings));
126
- exports.STAGE_AUTHORITY_COST_ANOMALY_WRITE_ACTIONS = Object.freeze([
127
- ...exports.STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS,
128
- ...exports.STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS,
129
- ].sort(compareStrings));
130
- exports.STAGE_AUTHORITY_REGIONAL_READ_ACTIONS = Object.freeze([
131
- 'access-analyzer:Get*',
132
- 'access-analyzer:List*',
133
- 'acm:Describe*',
134
- 'acm:Get*',
135
- 'acm:List*',
136
- 'application-autoscaling:Describe*',
137
- 'appconfig:Get*',
138
- 'appconfig:List*',
139
- 'backup:Describe*',
140
- 'backup:Get*',
141
- 'backup:List*',
142
- 'cloudformation:Describe*',
143
- 'cloudformation:Get*',
144
- 'cloudformation:List*',
145
- 'cloudformation:ValidateTemplate',
146
- 'cloudwatch:Describe*',
147
- 'cloudwatch:Get*',
148
- 'cloudwatch:List*',
149
- 'cognito-idp:Describe*',
150
- 'cognito-idp:Get*',
151
- 'cognito-idp:List*',
152
- 'dynamodb:Describe*',
153
- 'dynamodb:Get*',
154
- 'dynamodb:List*',
155
- 'ec2:Describe*',
156
- 'ec2:GetInstanceUefiData',
157
- 'ec2:GetResourcePolicy',
158
- 'ecr:Describe*',
159
- 'ecr:Get*',
160
- 'ecr:List*',
161
- 'ecs:Describe*',
162
- 'ecs:List*',
163
- 'elasticloadbalancing:Describe*',
164
- 'events:Describe*',
165
- 'events:List*',
166
- 'kms:Describe*',
167
- 'kms:Get*',
168
- 'kms:List*',
169
- 'lambda:Get*',
170
- 'lambda:List*',
171
- 'logs:Describe*',
172
- 'logs:FilterLogEvents',
173
- 'logs:Get*',
174
- 'logs:List*',
175
- 'rds:Describe*',
176
- 'rds:List*',
177
- 'secretsmanager:Describe*',
178
- 'secretsmanager:Get*',
179
- 'secretsmanager:List*',
180
- 'servicequotas:Get*',
181
- 'servicequotas:List*',
182
- 'servicediscovery:Get*',
183
- 'servicediscovery:List*',
184
- 'sns:Get*',
185
- 'sns:List*',
186
- 'sqs:Get*',
187
- 'sqs:List*',
188
- 'ssm:Describe*',
189
- 'ssm:Get*',
190
- 'ssm:List*',
191
- 'states:Describe*',
192
- 'states:List*',
193
- ].sort(compareStrings));
194
- exports.STAGE_AUTHORITY_GLOBAL_READ_ACTIONS = Object.freeze([
195
- 'apigateway:GET',
196
- 'budgets:Describe*',
197
- 'budgets:List*',
198
- 'budgets:ViewBudget',
199
- 'cloudfront-keyvaluestore:DescribeKeyValueStore',
200
- 'cloudfront-keyvaluestore:GetKey',
201
- 'cloudfront-keyvaluestore:ListKeys',
202
- 'cloudfront:Describe*',
203
- 'cloudfront:Get*',
204
- 'cloudfront:List*',
205
- 'iam:Get*',
206
- 'iam:List*',
207
- 'route53:Get*',
208
- 'route53:List*',
209
- 's3:Get*',
210
- 's3:List*',
211
- 'sts:GetCallerIdentity',
212
- 'tag:GetResources',
213
- 'wafv2:Get*',
214
- 'wafv2:List*',
215
- ].sort(compareStrings));
216
- /** CloudFront-scope WAF publishes its observability signals through the edge
217
- * control Region. Keep this read surface exact instead of broadening every
218
- * regional read when the application Region differs from us-east-1. */
219
- exports.STAGE_AUTHORITY_EDGE_OBSERVABILITY_READ_ACTIONS = Object.freeze([
220
- 'cloudwatch:GetMetricData',
221
- 'logs:DescribeLogGroups',
222
- 'logs:DescribeResourcePolicies',
223
- ].sort(compareStrings));
224
- /** A deployment role is a temporary infrastructure administrator, not a
225
- * runtime workload identity. Routine regional services therefore use one
226
- * stable service-family contract instead of a provider-call inventory. The
227
- * families whose policy, protection, launch, or trust semantics need tighter
228
- * treatment remain on the bounded action sets below. */
229
- exports.STAGE_AUTHORITY_BROAD_REGIONAL_SERVICE_ACTIONS = Object.freeze([
230
- 'acm:*',
231
- 'apigateway:*',
232
- 'appconfig:*',
233
- 'application-autoscaling:*',
234
- 'cloudwatch:*',
235
- 'cognito-idp:*',
236
- 'dynamodb:*',
237
- 'ecr:*',
238
- 'ecs:*',
239
- 'elasticloadbalancing:*',
240
- 'events:*',
241
- 'logs:*',
242
- 'rds:*',
243
- 'secretsmanager:*',
244
- 'servicediscovery:*',
245
- 'sns:*',
246
- 'sqs:*',
247
- 'ssm:*',
248
- 'states:*',
249
- ].sort(compareStrings));
250
- exports.STAGE_AUTHORITY_BACKUP_INFRASTRUCTURE_ACTIONS = Object.freeze([
251
- 'backup:CreateBackupPlan',
252
- 'backup:CreateBackupSelection',
253
- 'backup:CreateBackupVault',
254
- 'backup:DeleteBackupPlan',
255
- 'backup:DeleteBackupSelection',
256
- 'backup:DeleteBackupVault',
257
- 'backup:StartBackupJob',
258
- 'backup:TagResource',
259
- 'backup:UntagResource',
260
- 'backup:UpdateBackupPlan',
261
- ].sort(compareStrings));
262
- exports.STAGE_AUTHORITY_EC2_INFRASTRUCTURE_ACTIONS = Object.freeze([
263
- 'ec2:AllocateAddress',
264
- 'ec2:Associate*',
265
- 'ec2:Attach*',
266
- 'ec2:Authorize*',
267
- 'ec2:Create*',
268
- 'ec2:Delete*',
269
- 'ec2:Detach*',
270
- 'ec2:Disassociate*',
271
- 'ec2:ImportKeyPair',
272
- 'ec2:Modify*',
273
- 'ec2:ReleaseAddress',
274
- 'ec2:Replace*',
275
- 'ec2:Revoke*',
276
- 'ec2:RunInstances',
277
- 'ec2:StartInstances',
278
- 'ec2:StopInstances',
279
- 'ec2:TerminateInstances',
280
- 'ec2:UpdateSecurityGroupRuleDescriptions*',
281
- ].sort(compareStrings));
282
- exports.STAGE_AUTHORITY_KMS_INFRASTRUCTURE_ACTIONS = Object.freeze([
283
- 'kms:CreateAlias',
284
- 'kms:CreateKey',
285
- 'kms:DeleteAlias',
286
- 'kms:TagResource',
287
- 'kms:UntagResource',
288
- 'kms:UpdateAlias',
289
- 'kms:UpdateKeyDescription',
290
- ].sort(compareStrings));
291
- /** AddPermission, RemovePermission, and InvokeFunction remain in exact
292
- * statements so the family allow cannot bypass Lambda resource-policy and
293
- * deployment-smoke constraints. */
294
- exports.STAGE_AUTHORITY_LAMBDA_INFRASTRUCTURE_ACTIONS = Object.freeze([
295
- 'lambda:Create*',
296
- 'lambda:Delete*',
297
- 'lambda:PublishVersion',
298
- 'lambda:Put*',
299
- 'lambda:TagResource',
300
- 'lambda:UntagResource',
301
- 'lambda:Update*',
302
- ].sort(compareStrings));
303
- exports.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS = Object.freeze([
304
- ...exports.STAGE_AUTHORITY_BACKUP_INFRASTRUCTURE_ACTIONS,
305
- ...exports.STAGE_AUTHORITY_BROAD_REGIONAL_SERVICE_ACTIONS,
306
- ...exports.STAGE_AUTHORITY_EC2_INFRASTRUCTURE_ACTIONS,
307
- ...exports.STAGE_AUTHORITY_KMS_INFRASTRUCTURE_ACTIONS,
308
- ...exports.STAGE_AUTHORITY_LAMBDA_INFRASTRUCTURE_ACTIONS,
309
- ].sort(compareStrings));
310
- exports.STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS = Object.freeze([
311
- 'cloudfront:CreateCachePolicy',
312
- 'cloudfront:CreateDistribution',
313
- 'cloudfront:CreateFunction',
314
- 'cloudfront:CreateKeyValueStore',
315
- 'cloudfront:CreateOriginAccessControl',
316
- ].sort(compareStrings));
317
- exports.STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS = Object.freeze([
318
- 's3:AbortMultipartUpload',
319
- 's3:DeleteBucket',
320
- 's3:DeleteBucketPolicy',
321
- 's3:DeleteObject',
322
- 's3:DeleteObjectTagging',
323
- 's3:DeleteObjectVersion',
324
- 's3:PutBucket*',
325
- 's3:PutEncryptionConfiguration',
326
- 's3:PutLifecycleConfiguration',
327
- 's3:PutObject',
328
- 's3:PutObjectTagging',
329
- 's3:RestoreObject',
330
- ].sort(compareStrings));
331
- exports.STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS = Object.freeze([
332
- 'wafv2:AssociateWebACL',
333
- 'wafv2:Create*',
334
- 'wafv2:Delete*',
335
- 'wafv2:DisassociateWebACL',
336
- 'wafv2:TagResource',
337
- 'wafv2:UntagResource',
338
- 'wafv2:Update*',
339
- ].sort(compareStrings));
340
- /** These APIs establish unsupported replicas, global resources, alternate
341
- * database topologies, integrations, or cross-Region copies. The generated
342
- * architecture does not use them. */
343
- exports.STAGE_AUTHORITY_UNSUPPORTED_REPLICATION_AND_TOPOLOGY_ACTIONS = Object.freeze([
344
- 'backup:StartCopyJob',
345
- 'backup:UpdateRegionSettings',
346
- 'dynamodb:AssociateTableReplica',
347
- 'dynamodb:CreateGlobalTable',
348
- 'dynamodb:CreateGlobalTableWitness',
349
- 'dynamodb:CreateTableReplica',
350
- 'dynamodb:DeleteGlobalTableWitness',
351
- 'dynamodb:DeleteTableReplica',
352
- 'dynamodb:UpdateGlobalTable',
353
- 'dynamodb:UpdateGlobalTableSettings',
354
- 'dynamodb:UpdateTableReplicaAutoScaling',
355
- 'ecr:PutReplicationConfiguration',
356
- 'kms:ReplicateKey',
357
- 'kms:UpdatePrimaryRegion',
358
- 'rds:CopyDBClusterSnapshot',
359
- 'rds:CopyDBSnapshot',
360
- 'rds:CreateBlueGreenDeployment',
361
- 'rds:CreateDBInstanceReadReplica',
362
- 'rds:CreateDBShardGroup',
363
- 'rds:CreateGlobalCluster',
364
- 'rds:CreateIntegration',
365
- 'rds:CrossRegionCommunication',
366
- 'rds:DeleteBlueGreenDeployment',
367
- 'rds:DeleteDBShardGroup',
368
- 'rds:DeleteGlobalCluster',
369
- 'rds:DeleteIntegration',
370
- 'rds:FailoverGlobalCluster',
371
- 'rds:ModifyDBShardGroup',
372
- 'rds:ModifyGlobalCluster',
373
- 'rds:ModifyIntegration',
374
- 'rds:PromoteReadReplica',
375
- 'rds:PromoteReadReplicaDBCluster',
376
- 'rds:RebootDBShardGroup',
377
- 'rds:RemoveFromGlobalCluster',
378
- 'rds:StartDBInstanceAutomatedBackupsReplication',
379
- 'rds:StopDBInstanceAutomatedBackupsReplication',
380
- 'rds:SwitchoverBlueGreenDeployment',
381
- 'rds:SwitchoverGlobalCluster',
382
- 'rds:SwitchoverReadReplica',
383
- 's3:PutReplicationConfiguration',
384
- 'secretsmanager:RemoveRegionsFromReplication',
385
- 'secretsmanager:ReplicateSecretToRegions',
386
- 'secretsmanager:StopReplicationToReplica',
387
- ].sort(compareStrings));
388
- /** Route 53 requests that Cloud Map forwards with the stage deployment role's
389
- * own identity (forward access sessions) while it creates the generated
390
- * private DNS namespace. CloudTrail shows the private-zone create and one SOA
391
- * UPSERT per namespace; the zone ID is unknown in advance, so the
392
- * resource stays `*` and the Cloud Map service chain is the control. Cloud
393
- * Map's instance A/SRV records are written by the ECS service-linked role, and
394
- * Route 53 health checks are unsupported in private DNS namespaces, so no
395
- * health-check, tag, or other record authority is granted. */
396
- exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_ROUTE53_ACTIONS = Object.freeze(['route53:ChangeResourceRecordSets', 'route53:CreateHostedZone'].sort(compareStrings));
397
- exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_ACTIONS = Object.freeze(['UPSERT']);
398
- exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_TYPES = Object.freeze([
399
- 'SOA',
400
- ]);
401
- /** Generated stage infrastructure writes only alias records (A and AAAA) and
402
- * each certificate's ACM validation CNAME in the bound zone, for these names:
403
- * - the Foundation Router's root and wildcard aliases
404
- * - `auth.<root>`, the Foundation's Cognito identity domain
405
- * - `api.<root>`, the Foundation's Regional API Gateway domain for Slice APIs
406
- *
407
- * Delegation, zone authority, mail, verification, and certificate-authority
408
- * records stay ungranted even inside the bound zone. */
409
- exports.STAGE_AUTHORITY_PUBLIC_DNS_RECORD_TYPES = Object.freeze(['A', 'AAAA', 'CNAME'].sort(compareStrings));
410
- /** Route 53 hosted-zone IDs are `Z` plus at most 31 upper-case alphanumerics.
411
- * An ARN or `/hostedzone/` prefix is refused rather than normalized. */
412
- exports.STAGE_AUTHORITY_PUBLIC_HOSTED_ZONE_ID = /^Z[A-Z0-9]{1,31}$/u;
413
- exports.STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS = Object.freeze([
414
- 'cloudfront:DeleteCachePolicy',
415
- 'cloudfront:DeleteDistribution',
416
- 'cloudfront:DeleteFunction',
417
- 'cloudfront:DeleteKeyValueStore',
418
- 'cloudfront:DeleteOriginAccessControl',
419
- 'cloudfront:PublishFunction',
420
- 'cloudfront:TagResource',
421
- 'cloudfront:UntagResource',
422
- 'cloudfront:UpdateCachePolicy',
423
- 'cloudfront:UpdateDistribution',
424
- 'cloudfront:UpdateFunction',
425
- 'cloudfront:UpdateKeyValueStore',
426
- 'cloudfront:UpdateOriginAccessControl',
427
- 'cloudfront-keyvaluestore:DeleteKey',
428
- 'cloudfront-keyvaluestore:PutKey',
429
- 'cloudfront-keyvaluestore:UpdateKeys',
430
- ].sort(compareStrings));
431
- exports.STAGE_RUNTIME_REGIONAL_ACTIONS = Object.freeze([
432
- 'appconfig:GetLatestConfiguration',
433
- 'appconfig:StartConfigurationSession',
434
- 'cloudwatch:DescribeAlarms',
435
- 'cloudwatch:PutMetricData',
436
- 'cognito-idp:CreateUserPoolClient',
437
- 'cognito-idp:DeleteUserPoolClient',
438
- 'cognito-idp:DescribeUserPoolClient',
439
- 'cognito-idp:ListUserPoolClients',
440
- 'dynamodb:BatchGetItem',
441
- 'dynamodb:BatchWriteItem',
442
- 'dynamodb:ConditionCheckItem',
443
- 'dynamodb:DeleteItem',
444
- 'dynamodb:DescribeStream',
445
- 'dynamodb:DescribeTable',
446
- 'dynamodb:GetItem',
447
- 'dynamodb:GetRecords',
448
- 'dynamodb:GetShardIterator',
449
- 'dynamodb:ListStreams',
450
- 'dynamodb:PutItem',
451
- 'dynamodb:Query',
452
- 'dynamodb:Scan',
453
- 'dynamodb:TransactWriteItems',
454
- 'dynamodb:UpdateItem',
455
- 'ec2:AssignPrivateIpAddresses',
456
- 'ec2:CreateNetworkInterface',
457
- 'ec2:DeleteNetworkInterface',
458
- 'ec2:DescribeNetworkInterfaces',
459
- 'ec2:DescribeSubnets',
460
- 'ec2:UnassignPrivateIpAddresses',
461
- 'ecr:BatchCheckLayerAvailability',
462
- 'ecr:BatchGetImage',
463
- 'ecr:GetAuthorizationToken',
464
- 'ecr:GetDownloadUrlForLayer',
465
- 'ecs:DescribeTasks',
466
- 'ecs:RunTask',
467
- 'ecs:StopTask',
468
- 'events:DescribeRule',
469
- 'events:PutEvents',
470
- 'events:PutRule',
471
- 'events:PutTargets',
472
- 'kms:Decrypt',
473
- 'kms:DescribeKey',
474
- 'kms:Encrypt',
475
- 'kms:GenerateDataKey',
476
- 'lambda:InvokeFunction',
477
- 'logs:CreateLogDelivery',
478
- 'logs:CreateLogStream',
479
- 'logs:DeleteLogDelivery',
480
- 'logs:DescribeLogGroups',
481
- 'logs:DescribeResourcePolicies',
482
- 'logs:GetLogDelivery',
483
- 'logs:ListLogDeliveries',
484
- 'logs:PutLogEvents',
485
- 'logs:PutResourcePolicy',
486
- 'logs:UpdateLogDelivery',
487
- 'rds-db:connect',
488
- 's3:AbortMultipartUpload',
489
- 's3:DeleteObject',
490
- 's3:DeleteObjectVersion',
491
- 's3:GetObject',
492
- 's3:GetObjectVersion',
493
- 's3:ListBucket',
494
- 's3:ListBucketVersions',
495
- 's3:PutObject',
496
- 'secretsmanager:DeleteSecret',
497
- 'secretsmanager:DescribeSecret',
498
- 'secretsmanager:GetSecretValue',
499
- 'secretsmanager:PutSecretValue',
500
- 'secretsmanager:UpdateSecretVersionStage',
501
- 'sns:Publish',
502
- 'sqs:ChangeMessageVisibility',
503
- 'sqs:DeleteMessage',
504
- 'sqs:GetQueueAttributes',
505
- 'sqs:GetQueueUrl',
506
- 'sqs:ReceiveMessage',
507
- 'sqs:SendMessage',
508
- 'ssmmessages:CreateControlChannel',
509
- 'ssmmessages:CreateDataChannel',
510
- 'ssmmessages:OpenControlChannel',
511
- 'ssmmessages:OpenDataChannel',
512
- 'ssm:GetParameter',
513
- 'ssm:GetParameters',
514
- 'states:DescribeExecution',
515
- 'states:SendTaskFailure',
516
- 'states:SendTaskHeartbeat',
517
- 'states:SendTaskSuccess',
518
- 'states:StartExecution',
519
- ].sort(compareStrings));
520
- exports.STAGE_RUNTIME_GLOBAL_ACTIONS = Object.freeze(['cloudfront:CreateInvalidation'].sort(compareStrings));
521
- exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES = Object.freeze([
522
- ...new Set([
523
- ...exports.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS,
524
- ...exports.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS,
525
- ]
526
- .map((action) => `${action.split(':', 1)[0]}:*`)
527
- .filter((family) => !['acm:*', 'cloudwatch:*', 'logs:*'].includes(family))),
528
- 'cloudwatch:Delete*',
529
- 'cloudwatch:Disable*',
530
- 'cloudwatch:Enable*',
531
- 'cloudwatch:Put*',
532
- 'cloudwatch:Set*',
533
- 'cloudwatch:Start*',
534
- 'cloudwatch:Stop*',
535
- 'cloudwatch:TagResource',
536
- 'cloudwatch:UntagResource',
537
- ].sort(compareStrings));
538
- /** Logs application resources live in the deployment Region, while native WAF
539
- * delivery resources live in the CloudFront edge control Region. The allow
540
- * statements remain separate; this family exists only to deny mutations in a
541
- * third Region. */
542
- exports.STAGE_AUTHORITY_LOGS_MUTATION_FAMILIES = Object.freeze([
543
- 'logs:Associate*',
544
- 'logs:Cancel*',
545
- 'logs:Create*',
546
- 'logs:Delete*',
547
- 'logs:Disassociate*',
548
- 'logs:Put*',
549
- 'logs:Start*',
550
- 'logs:Stop*',
551
- 'logs:Tag*',
552
- 'logs:Untag*',
553
- 'logs:Update*',
554
- ].sort(compareStrings));
555
- exports.STAGE_RUNTIME_REGIONAL_SERVICE_FAMILIES = Object.freeze([
556
- ...new Set(exports.STAGE_RUNTIME_REGIONAL_ACTIONS.map((action) => `${action.split(':', 1)[0]}:*`)),
557
- ].sort(compareStrings));
558
- exports.STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES = Object.freeze([
559
- 'AmazonSSMManagedInstanceCore',
560
- 'service-role/AmazonECSTaskExecutionRolePolicy',
561
- 'service-role/AWSLambdaBasicDurableExecutionRolePolicy',
562
- 'service-role/AWSLambdaBasicExecutionRole',
563
- 'service-role/AWSLambdaVPCAccessExecutionRole',
564
- ]);
565
- exports.STAGE_AUTHORITY_WORKLOAD_IDENTITY_POLICY_ACTIONS = Object.freeze([
566
- 'iam:AttachRolePolicy',
567
- 'iam:DeleteRolePolicy',
568
- 'iam:DetachRolePolicy',
569
- 'iam:PutRolePolicy',
570
- ].sort(compareStrings));
571
- const IAM_AUTHORITY_MUTATION_ACTIONS = Object.freeze([
572
- 'iam:AddRoleToInstanceProfile',
573
- 'iam:AttachRolePolicy',
574
- 'iam:CreatePolicyVersion',
575
- 'iam:DeletePolicy',
576
- 'iam:DeletePolicyVersion',
577
- 'iam:DeleteRole',
578
- 'iam:DeleteRolePermissionsBoundary',
579
- 'iam:DeleteRolePolicy',
580
- 'iam:DetachRolePolicy',
581
- 'iam:PutRolePermissionsBoundary',
582
- 'iam:PutRolePolicy',
583
- 'iam:RemoveRoleFromInstanceProfile',
584
- 'iam:SetDefaultPolicyVersion',
585
- 'iam:TagPolicy',
586
- 'iam:TagRole',
587
- 'iam:UntagPolicy',
588
- 'iam:UntagRole',
589
- 'iam:UpdateAssumeRolePolicy',
590
- 'iam:UpdateRole',
591
- 'iam:UpdateRoleDescription',
592
- ].sort(compareStrings));
593
- /** Compact service-family scope guards keep mutation outside the selected AWS
594
- * account/Region closed. They intentionally do not claim same-account stage
595
- * isolation, because native SST owns account-shared bootstrap resources. */
596
- exports.STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES = Object.freeze([
597
- ...new Set([
598
- ...exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES,
599
- 'acm:*',
600
- 'apigateway:*',
601
- 'cloudfront:*',
602
- 'iam:*',
603
- 'logs:*',
604
- 'route53:*',
605
- 's3:*',
606
- 'wafv2:*',
607
- ]),
608
- ].sort(compareStrings));
609
- exports.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS = Object.freeze([
610
- 'cloudformation:CreateResource',
611
- 'cloudformation:DeleteResource',
612
- 'cloudformation:UpdateResource',
613
- ]);
614
- /** SST 4.17.1 resolves the generated nonproduction VPC's EC2 NAT image from
615
- * this commercial-partition fck-nat publisher. The generated development
616
- * bastion reuses that NAT instance, while production uses managed NAT. No
617
- * publisher is admitted in partitions where the pinned source is unproven. */
618
- exports.STAGE_AUTHORITY_SST_417_EXTERNAL_AMI_OWNERS_BY_PARTITION = Object.freeze({
619
- aws: Object.freeze(['568608671756']),
620
- 'aws-cn': Object.freeze([]),
621
- 'aws-us-gov': Object.freeze([]),
622
- });
623
- /** Preserve the generic cross-account guard for ordinary EC2 mutations while
624
- * routing RunInstances through its resource-aware statements below. A service
625
- * family wildcard would otherwise reject SST's deliberately external AMI. */
626
- exports.STAGE_AUTHORITY_CROSS_ACCOUNT_EC2_MUTATION_ACTIONS = Object.freeze(exports.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS.filter((action) => action.startsWith('ec2:') && action !== 'ec2:RunInstances'));
627
- exports.STAGE_AUTHORITY_CROSS_ACCOUNT_MUTATION_ACTIONS = Object.freeze([
628
- ...exports.STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES.filter((action) => action !== 'ec2:*'),
629
- ...exports.STAGE_AUTHORITY_CROSS_ACCOUNT_EC2_MUTATION_ACTIONS,
630
- ].sort(compareStrings));
631
- /** A deliberately narrow destructive set for same-account stage defense in
632
- * depth. It protects named/tagged production resources without pretending the
633
- * deployment roles form a complete IAM boundary. */
634
- exports.STAGE_AUTHORITY_CROSS_STAGE_DESTRUCTIVE_ACTIONS = Object.freeze([
635
- 'backup:Delete*',
636
- 'budgets:ModifyBudget',
637
- 'budgets:TagResource',
638
- 'budgets:UntagResource',
639
- 'cloudformation:DeleteStack',
640
- 'cloudformation:UpdateStack',
641
- 'cloudfront:CreateInvalidation',
642
- 'cloudfront:Delete*',
643
- 'cloudfront:PublishFunction',
644
- 'cloudfront:TagResource',
645
- 'cloudfront:UntagResource',
646
- 'cloudfront:Update*',
647
- 'cognito-idp:Delete*',
648
- 'dynamodb:Delete*',
649
- 'ec2:Replace*',
650
- 'ecr:BatchDeleteImage',
651
- 'ecr:Delete*',
652
- 'events:DeleteArchive',
653
- 'events:DeleteEventBus',
654
- 'events:DeleteRule',
655
- 'events:RemoveTargets',
656
- 'events:UpdateArchive',
657
- 'events:UpdateEventBus',
658
- 'iam:Delete*',
659
- 'kms:ScheduleKeyDeletion',
660
- 'lambda:Delete*',
661
- 'rds:Delete*',
662
- 'rds:ModifyDBCluster',
663
- 'rds:ModifyDBInstance',
664
- 'rds:AddSourceIdentifierToSubscription',
665
- 'rds:RemoveSourceIdentifierFromSubscription',
666
- 's3:AbortMultipartUpload',
667
- 's3:CreateBucket',
668
- 's3:DeleteBucket',
669
- 's3:DeleteBucketPolicy',
670
- 's3:DeleteObject*',
671
- 's3:PutBucket*',
672
- 's3:PutObject*',
673
- 's3:RestoreObject',
674
- 'secretsmanager:DeleteSecret',
675
- 'servicediscovery:DeleteNamespace',
676
- 'sqs:DeleteQueue',
677
- 'ssm:DeleteParameter*',
678
- 'states:DeleteStateMachine',
679
- 'wafv2:Delete*',
680
- 'wafv2:DisassociateWebACL',
681
- 'wafv2:PutLoggingConfiguration',
682
- 'wafv2:Update*',
683
- ].sort(compareStrings));
684
- /** Existing-resource mutations must either retain the exact stage tag or use a
685
- * generated stage/SST shared resource identity. Initial create/tag calls are
686
- * governed by their request-tag or exact-resource statements instead. */
687
- exports.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS = Object.freeze([
688
- ...exports.STAGE_AUTHORITY_CROSS_STAGE_DESTRUCTIVE_ACTIONS.filter((action) => !action.startsWith('cloudfront:') && action !== 's3:CreateBucket'),
689
- 'cloudfront:DeleteDistribution',
690
- 'cloudfront:DeleteFunction',
691
- 'cloudfront:PublishFunction',
692
- 'cloudfront:UpdateDistribution',
693
- 'cloudfront:UpdateFunction',
694
- ].sort(compareStrings));
695
- /** Operations whose target already exposes a stage tag may use the broader
696
- * deployer contract. A known different-stage tag must still win as an explicit
697
- * deny, including for provider calls that are not destructive by name. */
698
- exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS = Object.freeze([
699
- ...new Set([
700
- ...exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES,
701
- 'acm:*',
702
- 'budgets:*',
703
- 'cloudformation:*',
704
- 'cloudfront:*',
705
- 'iam:*',
706
- 'logs:*',
707
- 's3:*',
708
- 'wafv2:*',
709
- ]),
710
- ].sort(compareStrings));
711
- exports.STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS = Object.freeze(['s3:DeleteBucketPolicy', 's3:PutBucketPolicy'].sort(compareStrings));
712
- const PRIVILEGE_CONSTRUCTION_ACTIONS = Object.freeze([
713
- 'account:*',
714
- 'iam:AttachGroupPolicy',
715
- 'iam:AttachUserPolicy',
716
- 'iam:CreateAccessKey',
717
- 'iam:CreateGroup',
718
- 'iam:CreateLoginProfile',
719
- 'iam:CreatePolicy',
720
- 'iam:CreatePolicyVersion',
721
- 'iam:CreateUser',
722
- 'iam:DeleteRolePermissionsBoundary',
723
- 'iam:PutGroupPolicy',
724
- 'iam:PutUserPermissionsBoundary',
725
- 'iam:PutUserPolicy',
726
- 'iam:SetDefaultPolicyVersion',
727
- 'organizations:*',
728
- 'sts:AssumeRole',
729
- ].sort(compareStrings));
730
- const RUNTIME_PRIVILEGE_ACTIONS = Object.freeze([
731
- ...PRIVILEGE_CONSTRUCTION_ACTIONS,
732
- 'iam:AttachRolePolicy',
733
- 'iam:CreateInstanceProfile',
734
- 'iam:CreateRole',
735
- 'iam:DeleteRole',
736
- 'iam:DeleteRolePolicy',
737
- 'iam:DetachRolePolicy',
738
- 'iam:PutRolePermissionsBoundary',
739
- 'iam:PutRolePolicy',
740
- 'iam:UpdateAssumeRolePolicy',
741
- ].sort(compareStrings));
742
- /** Permission-management actions that the generated lifecycle must call. Each
743
- * exception is named exactly here and remains subject to the resource and
744
- * condition containment statements below. */
745
- exports.STAGE_AUTHORITY_REVIEWED_PERMISSION_MANAGEMENT_ACTIONS = Object.freeze([
746
- 'iam:AttachRolePolicy',
747
- 'iam:DeleteRolePolicy',
748
- 'iam:DetachRolePolicy',
749
- 'iam:PutRolePermissionsBoundary',
750
- 'iam:PutRolePolicy',
751
- 'kms:CreateGrant',
752
- 'lambda:AddPermission',
753
- 'lambda:RemovePermission',
754
- 'logs:PutResourcePolicy',
755
- 's3:DeleteBucketPolicy',
756
- 's3:PutBucketOwnershipControls',
757
- 's3:PutBucketPolicy',
758
- 's3:PutBucketPublicAccessBlock',
759
- 'sns:SetTopicAttributes',
760
- 'sqs:SetQueueAttributes',
761
- ].sort(compareStrings));
762
- /** Compact deny patterns covering permission-management actions admitted by
763
- * wildcard lifecycle grants but not named as reviewed exceptions. The focused
764
- * oracle derives every wildcard service family from the policy and proves each
765
- * currently admitted permission-management action is reviewed or denied, and
766
- * that no compact pattern also captures a retained read-only action. */
767
- exports.STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS = Object.freeze([
768
- 'apigateway:*AccessAssociation',
769
- 'apigateway:*Certificate*Domain',
770
- 'apigateway:DeletePortalProductSharingPolicy',
771
- 'apigateway:PutPortalProductSharingPolicy',
772
- 'apigateway:SetWebACL',
773
- 'apigateway:Update*Policy',
774
- 'backup:DeleteBackupVault*Policy',
775
- 'backup:ListIndexedRecoveryPointsForSearch',
776
- 'backup:PutBackupVault*Policy',
777
- 'backup:SearchRecoveryPoint',
778
- 'cloudfront:AllowVendedLogDeliveryForResource',
779
- 'dynamodb:DeleteResourcePolicy',
780
- 'dynamodb:PutResourcePolicy',
781
- 'dynamodb:UpdateAbacStatus',
782
- 'ec2:*Appliance*NatGateway',
783
- 'ec2:*ImageBlockPublicAccess',
784
- 'ec2:*OdbNetworkPeering',
785
- 'ec2:*Permission',
786
- 'ec2:*Resources*PlacementGroup',
787
- 'ec2:*SnapshotBlockPublicAccess',
788
- 'ec2:DeleteResourcePolicy',
789
- 'ec2:ModifySnapshotAttribute',
790
- 'ec2:ModifyVpcEndpointServicePermissions',
791
- 'ec2:PutResourcePolicy',
792
- 'ec2:ResetSnapshotAttribute',
793
- 'ecr:DeleteRegistryPolicy',
794
- 'ecr:DeleteRepositoryPolicy',
795
- 'ecr:PutRegistryPolicy',
796
- 'ecr:SetRepositoryPolicy',
797
- 'ecs:AllowVendedLogDeliveryForResource',
798
- 'elasticloadbalancing:AllowVendedLogDeliveryForResource',
799
- 'events:*Permission',
800
- 'kms:PutKeyPolicy',
801
- 'kms:RetireGrant',
802
- 'kms:RevokeGrant',
803
- 'lambda:*LayerVersionPermission',
804
- 'lambda:*Replication',
805
- 'lambda:DeleteResourcePolicy',
806
- 'lambda:PutResourcePolicy',
807
- 'logs:DeleteResourcePolicy',
808
- 'rds:AuthorizeDBSecurityGroupIngress',
809
- 's3:AssociateAccessGrantsIdentityCenter',
810
- 's3:BypassGovernanceRetention',
811
- 's3:CreateAccessGrant*',
812
- 's3:Delete*AccessPointPolicy*',
813
- 's3:DeleteAccessGrant*',
814
- 's3:DissociateAccessGrantsIdentityCenter',
815
- 's3:ObjectOwnerOverrideToBucketOwner',
816
- 's3:Put*AccessPointPolicy*',
817
- 's3:Put*Acl',
818
- 's3:PutAccessGrantsInstanceResourcePolicy',
819
- 's3:PutAccessPointPublicAccessBlock',
820
- 's3:PutAccountPublicAccessBlock',
821
- 's3:UpdateAccessGrantsLocation',
822
- 'secretsmanager:DeleteResourcePolicy',
823
- 'secretsmanager:PutResourcePolicy',
824
- 'secretsmanager:ValidateResourcePolicy',
825
- 'sns:*Permission',
826
- 'sqs:*Permission',
827
- 'ssm:*ResourcePolicy',
828
- 'ssm:ModifyDocumentPermission',
829
- 'wafv2:DeletePermissionPolicy',
830
- 'wafv2:PutPermissionPolicy',
831
- ].sort(compareStrings));
832
- const ADDITIONAL_RESOURCE_POLICY_AND_TRUST_EXPANSION_ACTIONS = Object.freeze([
833
- 'ec2:AcceptTransitGatewayPeeringAttachment',
834
- 'ec2:AcceptVpcPeeringConnection',
835
- 'ec2:CreateTransitGatewayPeeringAttachment',
836
- 'ec2:CreateVpcEndpointServiceConfiguration',
837
- 'ec2:CreateVpcPeeringConnection',
838
- 'ec2:DeleteVpcEndpointServiceConfigurations',
839
- 'ec2:ModifyImageAttribute',
840
- 'ec2:ModifyVpcEndpointServiceConfiguration',
841
- 'ec2:ModifyVpcPeeringConnectionOptions',
842
- 'ecr:PutReplicationConfiguration',
843
- 'iam:UpdateAssumeRolePolicy',
844
- 'logs:DeleteAccountPolicy',
845
- 'logs:DeleteDeliveryDestinationPolicy',
846
- 'logs:PutAccountPolicy',
847
- 'logs:PutDeliveryDestinationPolicy',
848
- 'logs:PutDestinationPolicy',
849
- 'rds:ModifyDBClusterSnapshotAttribute',
850
- 'rds:ModifyDBSnapshotAttribute',
851
- 'states:DeleteResourcePolicy',
852
- 'states:PutResourcePolicy',
853
- 'states:RevealSecrets',
854
- 'states:TestState',
855
- ].sort(compareStrings));
856
- const RESOURCE_POLICY_AND_TRUST_EXPANSION_ACTIONS = Object.freeze([
857
- ...exports.STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS,
858
- ...ADDITIONAL_RESOURCE_POLICY_AND_TRUST_EXPANSION_ACTIONS,
859
- ].sort(compareStrings));
860
- /** Stable exclusions from the temporary infrastructure-administrator role.
861
- * These are account administration, direct application data/user mutation,
862
- * message handling, or export paths rather than native stack reconciliation.
863
- * The generated deployed smoke retains only its four exact Cognito admin calls. */
864
- exports.STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS = Object.freeze([
865
- 'acm:*Acme*',
866
- 'acm:ExportCertificate',
867
- 'acm:PutAccountConfiguration',
868
- 'appconfig:UpdateAccountSettings',
869
- 'cognito-idp:AdminConfirmSignUp',
870
- 'cognito-idp:AdminDeleteUserAttributes',
871
- 'cognito-idp:AdminDisable*',
872
- 'cognito-idp:AdminEnableUser',
873
- 'cognito-idp:AdminForgetDevice',
874
- 'cognito-idp:*Auth*',
875
- 'cognito-idp:*Device*',
876
- 'cognito-idp:*UserMFA*',
877
- 'cognito-idp:AdminGetUser',
878
- 'cognito-idp:AdminLinkProviderForUser',
879
- 'cognito-idp:AdminList*',
880
- 'cognito-idp:AdminRemoveUserFromGroup',
881
- 'cognito-idp:AdminResetUserPassword',
882
- 'cognito-idp:AdminSetUserSettings',
883
- 'cognito-idp:AdminUpdateUserAttributes',
884
- 'cognito-idp:AdminUserGlobalSignOut',
885
- 'cognito-idp:ChangePassword',
886
- 'cognito-idp:ConfirmForgotPassword',
887
- 'cognito-idp:ConfirmSignUp',
888
- 'cognito-idp:DeleteUser',
889
- 'cognito-idp:DeleteUserAttributes',
890
- 'cognito-idp:ForgotPassword',
891
- 'cognito-idp:GetTokensFromRefreshToken',
892
- 'cognito-idp:GetUser',
893
- 'cognito-idp:GetUserAttributeVerificationCode',
894
- 'cognito-idp:GlobalSignOut',
895
- 'cognito-idp:ListUsers*',
896
- 'cognito-idp:ResendConfirmationCode',
897
- 'cognito-idp:RevokeToken',
898
- 'cognito-idp:SetUser*',
899
- 'cognito-idp:SignUp',
900
- 'cognito-idp:UpdateUserAttributes',
901
- 'cognito-idp:VerifySoftwareToken',
902
- 'cognito-idp:VerifyUserAttribute',
903
- 'dynamodb:*Item*',
904
- 'dynamodb:ExportTableToPointInTime',
905
- 'dynamodb:GetRecords',
906
- 'dynamodb:GetShardIterator',
907
- 'dynamodb:ImportTable',
908
- 'dynamodb:PartiQL*',
909
- 'dynamodb:PurchaseReservedCapacityOfferings',
910
- 'dynamodb:Query',
911
- 'dynamodb:ReadDataForReplication',
912
- 'dynamodb:RestoreTableFrom*',
913
- 'dynamodb:Scan',
914
- 'dynamodb:WriteDataForReplication',
915
- 'ecr:CreatePullThroughCacheRule',
916
- 'ecr:CreateRepositoryCreationTemplate',
917
- 'ecr:DeletePullThroughCacheRule',
918
- 'ecr:DeleteRepositoryCreationTemplate',
919
- 'ecr:DeleteSigningConfiguration',
920
- 'ecr:PutAccountSetting',
921
- 'ecr:PutRegistryScanningConfiguration',
922
- 'ecr:PutSigningConfiguration',
923
- 'ecr:UpdatePullThroughCacheRule',
924
- 'ecr:UpdateRepositoryCreationTemplate',
925
- 'ecs:DeleteAccountSetting',
926
- 'ecs:ExecuteCommand',
927
- 'ecs:PutAccountSetting',
928
- 'ecs:PutAccountSettingDefault',
929
- 'ecs:RunTask',
930
- 'ecs:StartTask',
931
- 'ecs:StopTask',
932
- 'logs:CancelExportTask',
933
- 'logs:CreateExportTask',
934
- 'rds:CancelExportTask',
935
- 'rds:ModifyCertificates',
936
- 'rds:PurchaseReservedDBInstancesOffering',
937
- 'rds:StartExportTask',
938
- 'secretsmanager:CancelRotateSecret',
939
- 'secretsmanager:RotateSecret',
940
- 'secretsmanager:UpdateSecretVersionStage',
941
- 'sns:*PhoneNumber*',
942
- 'sns:*SMS*',
943
- 'sqs:*Message*',
944
- 'sqs:PurgeQueue',
945
- 'ssm:CreateActivation',
946
- 'ssm:ResumeSession',
947
- 'ssm:SendCommand',
948
- 'ssm:StartAutomationExecution',
949
- 'ssm:StartChangeRequestExecution',
950
- 'ssm:StartSession',
951
- 'ssm:TerminateSession',
952
- ].sort(compareStrings));
953
- const SECRET_BATCH_VALUE_READ_ACTIONS = Object.freeze([
954
- 'secretsmanager:BatchGetSecretValue',
955
- ]);
956
- const GENERATED_FOUNDATION_DATABASE_VALUE_ACTIONS = Object.freeze(['secretsmanager:GetSecretValue', 'secretsmanager:PutSecretValue'].sort(compareStrings));
957
- const STAGE_SECRET_CONTAINER_METADATA_UPDATE_ACTIONS = Object.freeze([
958
- 'secretsmanager:UpdateSecret',
959
- ]);
960
- const GENERATED_FOUNDATION_DATABASE_RECONCILIATION_ACTIONS = Object.freeze([
961
- ...GENERATED_FOUNDATION_DATABASE_VALUE_ACTIONS,
962
- ...STAGE_SECRET_CONTAINER_METADATA_UPDATE_ACTIONS,
963
- ].sort(compareStrings));
964
- const SSM_HISTORY_AND_RECURSIVE_VALUE_READ_ACTIONS = Object.freeze(['ssm:GetParameterHistory', 'ssm:GetParametersByPath'].sort(compareStrings));
965
- const WORKFLOW_EXECUTION_MUTATION_ACTIONS = Object.freeze([
966
- 'states:RedriveExecution',
967
- 'states:StartExecution',
968
- 'states:StartSyncExecution',
969
- 'states:StopExecution',
970
- ].sort(compareStrings));
971
- exports.STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS = Object.freeze([
972
- 'states:RedriveExecution',
973
- 'states:StartSyncExecution',
974
- 'states:StopExecution',
975
- ].sort(compareStrings));
976
- const LAMBDA_INTEGRATION_PRINCIPALS = Object.freeze([
977
- 'apigateway.amazonaws.com',
978
- 'cloudfront.amazonaws.com',
979
- 'events.amazonaws.com',
980
- ].sort(compareStrings));
981
- const REVIEWED_LAMBDA_PERMISSION_PRINCIPALS = Object.freeze([...LAMBDA_INTEGRATION_PRINCIPALS, '*'].sort(compareStrings));
982
- exports.STAGE_AUTHORITY_SERVICE_LINKED_ROLES = Object.freeze([
983
- Object.freeze({
984
- path: 'ecs.amazonaws.com/AWSServiceRoleForECS',
985
- serviceName: 'ecs.amazonaws.com',
986
- }),
987
- Object.freeze({
988
- path: 'ecs.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ECSService',
989
- serviceName: 'ecs.application-autoscaling.amazonaws.com',
990
- }),
991
- Object.freeze({
992
- path: 'rds.amazonaws.com/AWSServiceRoleForRDS',
993
- serviceName: 'rds.amazonaws.com',
994
- }),
995
- Object.freeze({
996
- path: 'rds.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_RDSCluster',
997
- serviceName: 'rds.application-autoscaling.amazonaws.com',
998
- }),
999
- Object.freeze({
1000
- path: 'wafv2.amazonaws.com/AWSServiceRoleForWAFV2Logging',
1001
- serviceName: 'wafv2.amazonaws.com',
1002
- }),
1003
- ]);
1004
- /** A bound stage's Foundation creates a Regional API Gateway custom domain
1005
- * (`api.<root>`), which needs API Gateway's service-linked role in an account
1006
- * that does not have it yet. Rendered only with a committed public DNS
1007
- * binding, so unbound templates are unchanged. Module-private: the exported
1008
- * array constants are digest-pinned. */
1009
- const STAGE_AUTHORITY_BOUND_PUBLIC_DNS_SERVICE_LINKED_ROLES = Object.freeze([
1010
- Object.freeze({
1011
- path: 'ops.apigateway.amazonaws.com/AWSServiceRoleForAPIGateway',
1012
- serviceName: 'ops.apigateway.amazonaws.com',
1013
- }),
1014
- ]);
1015
- const IAM_POLICY_VERSION = '2012-10-17';
1016
- function compareStrings(left, right) {
1017
- return left < right ? -1 : left > right ? 1 : 0;
1018
- }
1019
- function githubOidcAudience(partition) {
1020
- return partition === 'aws-cn' ? 'sts.amazonaws.com.cn' : 'sts.amazonaws.com';
1021
- }
1022
- function canonicalize(value) {
1023
- if (Array.isArray(value))
1024
- return value.map(canonicalize);
1025
- if (!value || typeof value !== 'object')
1026
- return value;
1027
- return Object.fromEntries(Object.entries(value)
1028
- .sort(([left], [right]) => compareStrings(left, right))
1029
- .map(([key, entry]) => [key, canonicalize(entry)]));
1030
- }
1031
- function deepFreeze(value) {
1032
- if (!value || typeof value !== 'object' || Object.isFrozen(value)) {
1033
- return value;
1034
- }
1035
- for (const entry of Object.values(value))
1036
- deepFreeze(entry);
1037
- return Object.freeze(value);
1038
- }
1039
- function policy(statements) {
1040
- return {
1041
- Statement: [...statements].sort((left, right) => compareStrings(left.Sid, right.Sid)),
1042
- Version: IAM_POLICY_VERSION,
1043
- };
1044
- }
1045
- function omitPolicyStatementSids(document, compactActions = false) {
1046
- const record = document;
1047
- const statements = record['Statement'];
1048
- if (!Array.isArray(statements)) {
1049
- throw new Error('Stage authority template policy statements are invalid.');
1050
- }
1051
- const rendered = statements.map((entry) => {
1052
- if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
1053
- throw new Error('Stage authority template policy statement is invalid.');
1054
- }
1055
- return Object.fromEntries(Object.entries(entry).filter(([key]) => key !== 'Sid'));
1056
- });
1057
- if (!compactActions)
1058
- return { ...record, Statement: rendered };
1059
- // Statements with identical effect, resources and conditions differ only in
1060
- // their positive Action sets. Their union is exactly equivalent; NotAction
1061
- // statements are deliberately never merged (union would change semantics).
1062
- const scopes = new Map();
1063
- const compacted = [];
1064
- for (const entry of rendered) {
1065
- if (!Array.isArray(entry['Action'])) {
1066
- compacted.push(entry);
1067
- continue;
1068
- }
1069
- const { Action, ...scope } = entry;
1070
- const key = JSON.stringify(scope);
1071
- const existing = scopes.get(key);
1072
- if (existing)
1073
- existing['Action'] = [
1074
- ...new Set([
1075
- ...existing['Action'],
1076
- ...Action,
1077
- ]),
1078
- ].sort(compareStrings);
1079
- else {
1080
- scopes.set(key, entry);
1081
- compacted.push(entry);
1082
- }
1083
- }
1084
- // IAM accepts a singleton resource as either a string or a one-element
1085
- // list. Keep the executable model as lists; shorten only the rendered JSON.
1086
- return {
1087
- ...record,
1088
- Statement: compacted.map((entry) => Object.fromEntries(Object.entries(entry).map(([key, value]) => [
1089
- key,
1090
- ['Resource', 'NotResource'].includes(key) &&
1091
- Array.isArray(value) &&
1092
- value.length === 1
1093
- ? value[0]
1094
- : value,
1095
- ]))),
1096
- };
1097
- }
1098
- function replaceExactTemplateString(value, expected, replacement) {
1099
- if (value === expected)
1100
- return replacement;
1101
- if (Array.isArray(value)) {
1102
- return value.map((entry) => replaceExactTemplateString(entry, expected, replacement));
1103
- }
1104
- if (!value || typeof value !== 'object')
1105
- return value;
1106
- return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
1107
- key,
1108
- replaceExactTemplateString(entry, expected, replacement),
1109
- ]));
1110
- }
1111
- function compactExactTemplatePolicyStrings(documents, values, compactLists = false) {
1112
- const constants = {};
1113
- const replacements = new Map();
1114
- for (const value of [...new Set(values)].sort(compareStrings)) {
1115
- const key = compactLists
1116
- ? replacements.size.toString(36)
1117
- : `A${replacements.size}`;
1118
- const replacement = Object.freeze({
1119
- 'Fn::FindInMap': Object.freeze(['A', 'V', key]),
1120
- });
1121
- constants[key] = value;
1122
- replacements.set(value, replacement);
1123
- }
1124
- if (replacements.size === 0)
1125
- return Object.freeze({ documents });
1126
- let compactedDocuments = Object.fromEntries(Object.entries(documents).map(([logicalId, document]) => [
1127
- logicalId,
1128
- [...replacements.entries()].reduce((current, [literal, replacement]) => replaceExactTemplateString(current, literal, replacement), document),
1129
- ]));
1130
- if (compactLists) {
1131
- const counts = new Map();
1132
- const collect = (value) => {
1133
- if (Array.isArray(value) &&
1134
- value.every((entry) => typeof entry === 'string')) {
1135
- const key = JSON.stringify(value);
1136
- counts.set(key, (counts.get(key) ?? 0) + 1);
1137
- }
1138
- else if (Array.isArray(value))
1139
- value.forEach(collect);
1140
- else if (value && typeof value === 'object')
1141
- Object.values(value).forEach(collect);
1142
- };
1143
- collect(compactedDocuments);
1144
- const listReferences = new Map();
1145
- for (const [literal, count] of [...counts].sort(([a], [b]) => compareStrings(a, b))) {
1146
- if ((count - 1) * literal.length <= count * 36 + 24)
1147
- continue;
1148
- const key = (replacements.size + listReferences.size).toString(36);
1149
- constants[key] = JSON.parse(literal);
1150
- listReferences.set(literal, { 'Fn::FindInMap': ['A', 'V', key] });
1151
- }
1152
- const replaceLists = (value) => {
1153
- if (Array.isArray(value)) {
1154
- const reference = listReferences.get(JSON.stringify(value));
1155
- return reference ?? value.map(replaceLists);
1156
- }
1157
- if (value && typeof value === 'object')
1158
- return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
1159
- key,
1160
- replaceLists(entry),
1161
- ]));
1162
- return value;
1163
- };
1164
- compactedDocuments = replaceLists(compactedDocuments);
1165
- // Fn::Split is resolved by CloudFormation before IAM evaluates the
1166
- // document. Long literal lists can omit JSON's repeated quotes without
1167
- // introducing wildcards, changing order, or changing a single permission.
1168
- // Mapping values themselves stay literal (intrinsics are not valid there).
1169
- const encodeLiteralLists = (value) => {
1170
- if (Array.isArray(value)) {
1171
- if (value.every((entry) => typeof entry === 'string' && !entry.includes(','))) {
1172
- let encoded = { 'Fn::Split': [',', value.join(',')] };
1173
- // Factor only a literal ARN prefix. CloudFormation expands it back
1174
- // before IAM sees the list; IAM policy variables must stay literal.
1175
- if (value.length > 1 &&
1176
- value.every((entry) => entry.startsWith('arn:') && !entry.includes('${'))) {
1177
- let prefix = value[0];
1178
- for (const entry of value)
1179
- while (!entry.startsWith(prefix))
1180
- prefix = prefix.slice(0, -1);
1181
- const factored = {
1182
- 'Fn::Split': [
1183
- ',',
1184
- {
1185
- 'Fn::Sub': [
1186
- value
1187
- .map((entry) => '${P}' + entry.slice(prefix.length))
1188
- .join(','),
1189
- { P: prefix },
1190
- ],
1191
- },
1192
- ],
1193
- };
1194
- if (JSON.stringify(factored).length < JSON.stringify(encoded).length)
1195
- encoded = factored;
1196
- }
1197
- if (JSON.stringify(encoded).length < JSON.stringify(value).length)
1198
- return encoded;
1199
- }
1200
- return value.map(encodeLiteralLists);
1201
- }
1202
- if (value && typeof value === 'object')
1203
- return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
1204
- key,
1205
- encodeLiteralLists(entry),
1206
- ]));
1207
- return value;
1208
- };
1209
- compactedDocuments = encodeLiteralLists(compactedDocuments);
1210
- }
1211
- if (compactLists) {
1212
- const serialized = JSON.stringify(compactedDocuments);
1213
- for (const key of Object.keys(constants)) {
1214
- if (!serialized.includes(JSON.stringify(['A', 'V', key])))
1215
- delete constants[key];
1216
- }
1217
- }
1218
- return Object.freeze({
1219
- documents: Object.freeze(compactedDocuments),
1220
- // These short, template-private identifiers avoid repeating long exact
1221
- // ARNs in policy documents. Fn::FindInMap resolves to the original literal
1222
- // before IAM sees the policy; the executable policy model stays literal.
1223
- mappings: Object.freeze({
1224
- A: Object.freeze({ V: Object.freeze(constants) }),
1225
- }),
1226
- });
1227
- }
1228
- function repeatedDevelopmentPolicyStrings(documents) {
1229
- const counts = new Map();
1230
- const visit = (value) => {
1231
- if (typeof value === 'string')
1232
- counts.set(value, (counts.get(value) ?? 0) + 1);
1233
- else if (Array.isArray(value))
1234
- value.forEach(visit);
1235
- else if (value && typeof value === 'object')
1236
- Object.values(value).forEach(visit);
1237
- };
1238
- visit(documents);
1239
- // Exact FindInMap substitution only; admit entries whose repeated bytes pay
1240
- // for both the mapping and references. No IAM statement semantics change.
1241
- return [...counts]
1242
- .filter(([value, count]) => (count - 1) * value.length > count * 36 + 24)
1243
- .map(([value]) => value);
1244
- }
1245
- function statement(input) {
1246
- if ((input.Action === undefined) === (input.NotAction === undefined)) {
1247
- throw new Error('Stage authority statements require exactly one Action or NotAction scope.');
1248
- }
1249
- if ((input.Resource === undefined) === (input.NotResource === undefined)) {
1250
- throw new Error('Stage authority statements require exactly one Resource or NotResource scope.');
1251
- }
1252
- return {
1253
- ...input,
1254
- ...(input.Action
1255
- ? { Action: [...input.Action].sort(compareStrings) }
1256
- : { NotAction: [...(input.NotAction ?? [])].sort(compareStrings) }),
1257
- ...(input.Resource
1258
- ? { Resource: [...input.Resource].sort(compareStrings) }
1259
- : {}),
1260
- ...(input.NotResource
1261
- ? { NotResource: [...input.NotResource].sort(compareStrings) }
1262
- : {}),
1263
- };
1264
- }
1265
- function requireIdentity(input) {
1266
- const partition = input.partition ?? 'aws';
1267
- if (!ACCOUNT_ID.test(input.accountId) ||
1268
- !REGION.test(input.region) ||
1269
- !exports.STAGE_AUTHORITY_STAGES.includes(input.stage) ||
1270
- !exports.STAGE_AUTHORITY_PARTITIONS.includes(partition)) {
1271
- throw new Error('Stage authority requires one exact account, Region, partition, and canonical stage.');
1272
- }
1273
- return {
1274
- accountId: input.accountId,
1275
- partition,
1276
- region: input.region,
1277
- stage: input.stage,
1278
- };
1279
- }
1280
- function requirePublicHostedZone(input, partition) {
1281
- const zone = input.publicHostedZoneId;
1282
- if (zone === undefined)
1283
- return undefined;
1284
- if (typeof zone !== 'string' ||
1285
- !exports.STAGE_AUTHORITY_PUBLIC_HOSTED_ZONE_ID.test(zone)) {
1286
- throw new Error('Stage authority public DNS requires one exact Route 53 hosted-zone ID (Z followed by at most 31 upper-case letters or digits), without an ARN or path prefix.');
1287
- }
1288
- if (partition !== 'aws') {
1289
- throw new Error('Stage authority binds a public hosted zone only in the aws partition; remove publicDns for this stage.');
1290
- }
1291
- return zone;
1292
- }
1293
- function createStageAuthorityIdentity(input) {
1294
- const identity = requireIdentity(input);
1295
- const boundaryPath = `/ebk/${identity.stage}/`;
1296
- const boundaryName = `workload-role-boundary-${identity.stage}`;
1297
- const deploymentRolePath = `/ebk/${identity.stage}/deployment/`;
1298
- const deploymentRoleName = `ebk-${identity.stage}-deploy`;
1299
- const deploymentPolicyNames = Object.freeze([
1300
- `stage-deployment-read-${identity.stage}`,
1301
- `stage-deployment-regional-mutation-${identity.stage}`,
1302
- `stage-deployment-global-iam-mutation-${identity.stage}`,
1303
- `stage-deployment-global-resource-mutation-${identity.stage}`,
1304
- `stage-deployment-generated-resource-mutation-${identity.stage}`,
1305
- `stage-deployment-stage-containment-${identity.stage}`,
1306
- `stage-deployment-permission-guardrails-${identity.stage}`,
1307
- `stage-deployment-guardrails-${identity.stage}`,
1308
- ]);
1309
- const workloadRolePath = `/ebk/${identity.stage}/workloads/`;
1310
- const workloadInstanceProfilePath = workloadRolePath;
1311
- return Object.freeze({
1312
- boundaryArn: `arn:${identity.partition}:iam::${identity.accountId}:policy${boundaryPath}${boundaryName}`,
1313
- boundaryName,
1314
- boundaryPath,
1315
- deploymentPolicyArns: Object.freeze(deploymentPolicyNames.map((name) => `arn:${identity.partition}:iam::${identity.accountId}:policy${deploymentRolePath}${name}`)),
1316
- deploymentPolicyNames,
1317
- deploymentRoleArn: `arn:${identity.partition}:iam::${identity.accountId}:role${deploymentRolePath}${deploymentRoleName}`,
1318
- deploymentRoleName,
1319
- deploymentRolePath,
1320
- stackName: `ebk-${identity.stage}-stage-authority`,
1321
- workloadInstanceProfileArnPattern: `arn:${identity.partition}:iam::${identity.accountId}:instance-profile${workloadInstanceProfilePath}*`,
1322
- workloadInstanceProfilePath,
1323
- workloadRoleArnPattern: `arn:${identity.partition}:iam::${identity.accountId}:role${workloadRolePath}*`,
1324
- workloadRolePath,
1325
- });
1326
- }
1327
- function requireTrust(input, identity) {
1328
- const principals = [...new Set(input.awsPrincipalArns ?? [])].sort(compareStrings);
1329
- if (principals.length > STAGE_AUTHORITY_MAX_AWS_PRINCIPALS ||
1330
- principals.some((arn) => {
1331
- const match = AWS_PRINCIPAL_ARN.exec(arn);
1332
- return (Buffer.byteLength(arn, 'utf8') >
1333
- STAGE_AUTHORITY_MAX_AWS_PRINCIPAL_ARN_BYTES ||
1334
- !match ||
1335
- match[1] !== identity.partition);
1336
- })) {
1337
- throw new Error('Stage authority AWS trust must contain at most 16 bounded unique exact principal ARNs in the selected partition.');
1338
- }
1339
- const statements = [];
1340
- if (principals.length > 0) {
1341
- statements.push({
1342
- Action: 'sts:AssumeRole',
1343
- Effect: 'Allow',
1344
- Principal: { AWS: principals },
1345
- Sid: 'AssumeFromReviewedAwsPrincipals',
1346
- });
1347
- }
1348
- if (input.github) {
1349
- const match = GITHUB_OIDC_PROVIDER_ARN.exec(input.github.oidcProviderArn);
1350
- const subjectMatch = GITHUB_SUBJECT.exec(input.github.subject);
1351
- if (!match ||
1352
- match[1] !== identity.partition ||
1353
- match[2] !== identity.accountId ||
1354
- !subjectMatch) {
1355
- throw new Error('Stage authority GitHub trust must use the target account provider and one immutable environment subject.');
1356
- }
1357
- if (subjectMatch[1] !== identity.stage) {
1358
- throw new Error('Stage authority GitHub trust environment must match the selected stage.');
1359
- }
1360
- statements.push({
1361
- Action: 'sts:AssumeRoleWithWebIdentity',
1362
- Condition: {
1363
- StringEquals: {
1364
- 'token.actions.githubusercontent.com:aud': githubOidcAudience(identity.partition),
1365
- 'token.actions.githubusercontent.com:sub': input.github.subject,
1366
- },
1367
- },
1368
- Effect: 'Allow',
1369
- Principal: { Federated: input.github.oidcProviderArn },
1370
- Sid: 'AssumeFromReviewedGithubEnvironment',
1371
- });
1372
- }
1373
- if (statements.length === 0) {
1374
- throw new Error('Stage authority requires at least one reviewed AWS or GitHub trust principal.');
1375
- }
1376
- return {
1377
- Statement: statements.sort((left, right) => compareStrings(String(left['Sid']), String(right['Sid']))),
1378
- Version: IAM_POLICY_VERSION,
1379
- };
1380
- }
1381
- function runtimeBoundaryPolicy(options) {
1382
- const statements = [
1383
- statement({
1384
- Action: exports.STAGE_RUNTIME_REGIONAL_ACTIONS,
1385
- Condition: {
1386
- StringEquals: { 'aws:RequestedRegion': options.region },
1387
- },
1388
- Effect: 'Allow',
1389
- Resource: ['*'],
1390
- Sid: 'AllowFixedRuntimeServicesInStageRegion',
1391
- }),
1392
- statement({
1393
- Action: ['sts:GetCallerIdentity'],
1394
- Effect: 'Allow',
1395
- Resource: ['*'],
1396
- Sid: 'AllowRuntimeCallerIdentity',
1397
- }),
1398
- statement({
1399
- Action: exports.STAGE_RUNTIME_GLOBAL_ACTIONS,
1400
- Effect: 'Allow',
1401
- Resource: ['*'],
1402
- Sid: 'AllowFixedRuntimeGlobalServices',
1403
- }),
1404
- statement({
1405
- Action: ['iam:PassRole'],
1406
- Condition: {
1407
- StringEquals: {
1408
- 'iam:PassedToService': [
1409
- 'appconfig.amazonaws.com',
1410
- 'ec2.amazonaws.com',
1411
- 'ecs-tasks.amazonaws.com',
1412
- 'lambda.amazonaws.com',
1413
- 'states.amazonaws.com',
1414
- ].sort(compareStrings),
1415
- },
1416
- },
1417
- Effect: 'Allow',
1418
- Resource: [options.identity.workloadRoleArnPattern],
1419
- Sid: 'AllowRuntimePassBoundedStageRoles',
1420
- }),
1421
- statement({
1422
- Action: exports.STAGE_RUNTIME_REGIONAL_SERVICE_FAMILIES,
1423
- Condition: {
1424
- StringNotEquals: { 'aws:RequestedRegion': options.region },
1425
- },
1426
- Effect: 'Deny',
1427
- Resource: ['*'],
1428
- Sid: 'DenyRuntimeOutsideStageRegion',
1429
- }),
1430
- statement({
1431
- Action: ['*'],
1432
- Condition: {
1433
- Null: { 'aws:ResourceAccount': 'false' },
1434
- StringNotEquals: { 'aws:ResourceAccount': options.accountId },
1435
- },
1436
- Effect: 'Deny',
1437
- Resource: ['*'],
1438
- Sid: 'DenyRuntimeCrossAccountResources',
1439
- }),
1440
- statement({
1441
- Action: ['*'],
1442
- Condition: {
1443
- Null: { 'aws:ResourceTag/ebk:stage': 'false' },
1444
- StringNotEquals: { 'aws:ResourceTag/ebk:stage': options.stage },
1445
- },
1446
- Effect: 'Deny',
1447
- Resource: ['*'],
1448
- Sid: 'DenyRuntimeKnownOtherStageResources',
1449
- }),
1450
- statement({
1451
- Action: RUNTIME_PRIVILEGE_ACTIONS,
1452
- Effect: 'Deny',
1453
- Resource: ['*'],
1454
- Sid: 'DenyRuntimePrivilegeConstruction',
1455
- }),
1456
- ];
1457
- if (options.stage === 'development') {
1458
- const regionalGuardIndex = statements.findIndex((entry) => entry.Sid === 'DenyRuntimeOutsideStageRegion');
1459
- const regionalGuard = statements[regionalGuardIndex];
1460
- if (!regionalGuard?.Action)
1461
- throw new Error('Runtime Region guard is missing.');
1462
- // Development has only these global runtime exceptions. Denying every
1463
- // other action outside the Region preserves all admitted runtime calls
1464
- // while strengthening the old service-family deny, including AppSync.
1465
- statements[regionalGuardIndex] = statement({
1466
- Sid: regionalGuard.Sid,
1467
- NotAction: [
1468
- ...exports.STAGE_RUNTIME_GLOBAL_ACTIONS,
1469
- 'iam:PassRole',
1470
- 'sts:GetCallerIdentity',
1471
- ],
1472
- Effect: 'Deny',
1473
- Resource: ['*'],
1474
- Condition: regionalGuard.Condition,
1475
- });
1476
- const privilegeGuard = statements.find((entry) => entry.Sid === 'DenyRuntimePrivilegeConstruction');
1477
- if (!privilegeGuard?.Action)
1478
- throw new Error('Runtime privilege guard is missing.');
1479
- // These deny-only patterns cover every original privilege action and no
1480
- // admitted runtime action (notably iam:PassRole). Protected stages retain
1481
- // their byte-identical explicit inventory.
1482
- privilegeGuard.Action = [
1483
- 'account:*',
1484
- 'iam:*Boundary',
1485
- 'iam:*Policy*',
1486
- 'iam:Create*',
1487
- 'iam:Delete*',
1488
- 'organizations:*',
1489
- 'sts:AssumeRole',
1490
- ];
1491
- // Native SST dev uses one untagged account/Region AppSync Events API and
1492
- // its `sst` namespace. IAM cannot isolate nested task channel paths. This
1493
- // is a shared development control plane, not an application event bus.
1494
- // The boundary narrows SST's appsync:* identity grant to transport only.
1495
- statements.push(...nativeDevelopmentTransportStatements({
1496
- accountId: options.accountId,
1497
- partition: options.identity.boundaryArn.split(':')[1],
1498
- region: options.region,
1499
- initialize: false,
1500
- }));
1501
- const canonicalGuard = statements.find((entry) => entry.Sid === 'DenyRuntimeKnownOtherStageResources');
1502
- if (!canonicalGuard)
1503
- throw new Error('Runtime stage guard is missing.');
1504
- canonicalGuard.Condition = {
1505
- ...canonicalGuard.Condition,
1506
- StringEquals: { 'aws:PrincipalTag/ebk:stage': 'development' },
1507
- };
1508
- const taskPrincipal = {
1509
- StringLike: { 'aws:PrincipalTag/ebk:stage': TASK_STAGE_IAM_SHAPE },
1510
- };
1511
- const partition = options.identity.boundaryArn.split(':')[1];
1512
- // Native Lambda creates an untagged ENI against existing Foundation
1513
- // subnets/security groups. Neither VPCs nor existing shared ENIs are
1514
- // exempted. Task-owned VPC topology is not generated by this contract.
1515
- const sharedNetwork = ['subnet', 'security-group'].map((resource) => `arn:${partition}:ec2:${options.region}:${options.accountId}:${resource}/*`);
1516
- const shared = [
1517
- `arn:${partition}:events:${options.region}:${options.accountId}:event-bus/foundation-development-FoundationEventBusBus-*`,
1518
- `arn:${partition}:cognito-idp:${options.region}:${options.accountId}:userpool/*`,
1519
- ...sharedNetwork,
1520
- ];
1521
- const sharedActions = [
1522
- 'ec2:CreateNetworkInterface',
1523
- 'events:PutEvents',
1524
- ...exports.STAGE_RUNTIME_REGIONAL_ACTIONS.filter((action) => action.startsWith('cognito-idp:')),
1525
- ];
1526
- statements.push(statement({
1527
- Sid: 'DenyRuntimeMissingOrInvalidPrincipalStage',
1528
- Action: ['*'],
1529
- Effect: 'Deny',
1530
- Resource: ['*'],
1531
- Condition: {
1532
- StringNotLike: {
1533
- 'aws:PrincipalTag/ebk:stage': ['development', TASK_STAGE_IAM_SHAPE],
1534
- },
1535
- },
1536
- }), statement({
1537
- Sid: 'DenyTaskRuntimeOtherTaggedResources',
1538
- Action: ['*'],
1539
- Effect: 'Deny',
1540
- NotResource: shared,
1541
- Condition: {
1542
- ...taskPrincipal,
1543
- Null: { 'aws:ResourceTag/ebk:stage': 'false' },
1544
- StringNotEquals: {
1545
- 'aws:ResourceTag/ebk:stage': TASK_PRINCIPAL_STAGE,
1546
- },
1547
- },
1548
- }), ...['ebk:stage', 'ebk:owner'].map((key) => statement({
1549
- Sid: `DenyTaskRuntimeUnownedShared${key.split(':')[1]}`,
1550
- Action: ['*'],
1551
- Effect: 'Deny',
1552
- Resource: shared,
1553
- Condition: {
1554
- StringNotEquals: {
1555
- [`aws:ResourceTag/${key}`]: key === 'ebk:stage' ? 'development' : 'foundation',
1556
- },
1557
- },
1558
- })), statement({
1559
- Sid: 'DenyTaskRuntimeUnlinkedSharedActions',
1560
- // The boundary is only a ceiling. Existing native link/VPC identity
1561
- // policies still determine effective permissions. AWS's resource-type
1562
- // contracts prevent this union from granting cross-service operations.
1563
- // Shared guards also constrain canonical-development runtime roles to
1564
- // generated Foundation ownership; protected stages are unchanged.
1565
- NotAction: sharedActions,
1566
- Effect: 'Deny',
1567
- Resource: shared,
1568
- }), statement({
1569
- Sid: 'DenyRuntimeUnownedSharedNetworkWorkspace',
1570
- Action: ['*'],
1571
- Effect: 'Deny',
1572
- Resource: sharedNetwork,
1573
- Condition: {
1574
- StringNotEquals: {
1575
- 'aws:ResourceTag/ebk:workspace': "${aws:PrincipalTag/ebk:workspace, ''}",
1576
- },
1577
- },
1578
- }));
1579
- }
1580
- // Tagless APIs retain their existing exact native-link identity policies;
1581
- // this boundary does not pretend unsupported ResourceTag keys are present.
1582
- return policy(statements);
1583
- }
1584
- function nativeDevelopmentTransportStatements(options) {
1585
- const api = `arn:${options.partition}:appsync:${options.region}:${options.accountId}:apis/*`;
1586
- const Condition = {
1587
- StringEquals: { 'aws:RequestedRegion': options.region },
1588
- };
1589
- return [
1590
- ...(options.initialize
1591
- ? [
1592
- statement({
1593
- // SST supplies neither tags nor a logging role. AWS has no API-name
1594
- // condition for CreateApi, and ListApis requires Resource: *.
1595
- Action: ['appsync:CreateApi', 'appsync:ListApis'],
1596
- Condition,
1597
- Effect: 'Allow',
1598
- Resource: ['*'],
1599
- Sid: 'InitializeNativeDevelopmentTransport',
1600
- }),
1601
- ]
1602
- : []),
1603
- statement({
1604
- Action: [
1605
- 'appsync:EventConnect',
1606
- ...(options.initialize ? ['appsync:GetApi'] : []),
1607
- ],
1608
- ...(options.initialize ? { Condition } : {}),
1609
- Effect: 'Allow',
1610
- Resource: [api],
1611
- Sid: 'ConnectNativeDevelopmentTransport',
1612
- }),
1613
- statement({
1614
- Action: [
1615
- 'appsync:EventPublish',
1616
- 'appsync:EventSubscribe',
1617
- ...(options.initialize ? ['appsync:CreateChannelNamespace'] : []),
1618
- ],
1619
- ...(options.initialize ? { Condition } : {}),
1620
- Effect: 'Allow',
1621
- Resource: [`${api}/channelNamespace/sst`],
1622
- Sid: 'UseNativeDevelopmentNamespace',
1623
- }),
1624
- ];
1625
- }
1626
- const SST_4_17_1_PHYSICAL_NAME_RANDOM_SUFFIX_LENGTH = 9;
1627
- const FOUNDATION_ROUTER_CLOUDFRONT_FUNCTION_NAMES = [
1628
- 'FoundationRouterCloudfrontFunctionRequest',
1629
- 'FoundationRouterCloudfrontFunctionResponse',
1630
- ];
1631
- function sst4171PhysicalNamePattern(input) {
1632
- const maximumPrefixLength = input.maximumLength - SST_4_17_1_PHYSICAL_NAME_RANDOM_SUFFIX_LENGTH;
1633
- const stageLength = input.stage.length;
1634
- const nameLength = input.logicalName.length;
1635
- const prefix = nameLength + 1 >= maximumPrefixLength
1636
- ? input.logicalName.substring(0, maximumPrefixLength)
1637
- : nameLength + stageLength + 2 >= maximumPrefixLength
1638
- ? `${input.stage.substring(0, maximumPrefixLength - nameLength - 1)}-${input.logicalName}`
1639
- : `${input.application.substring(0, maximumPrefixLength - stageLength - nameLength - 2)}-${input.stage}-${input.logicalName}`;
1640
- return `${prefix}-*`;
1641
- }
1642
- function generatedRouterCloudFrontFunctionResources(options, stage) {
1643
- return FOUNDATION_ROUTER_CLOUDFRONT_FUNCTION_NAMES.map((logicalName) => `arn:${options.partition}:cloudfront::${options.accountId}:function/${sst4171PhysicalNamePattern({
1644
- application: 'foundation',
1645
- logicalName,
1646
- maximumLength: 64,
1647
- stage,
1648
- })}`).sort(compareStrings);
1649
- }
1650
- /** Expand only existing task-app namespace contracts, never Foundation names. */
1651
- function taskNamespaceResources(resources) {
1652
- return [
1653
- ...new Set(resources.flatMap((resource) => {
1654
- if (/foundation|Foundation|workspace-owner|:rds:|:backup:|:wafv2:|:iam:/u.test(resource))
1655
- return [resource];
1656
- let task = resource;
1657
- if (resource.includes('/sst/passphrase/')) {
1658
- task = resource.replace(/\/development$/u, `/${TASK_STAGE_IAM_SHAPE}`);
1659
- }
1660
- else if (resource.includes(':parameter/*development*')) {
1661
- // Native task state is not an arbitrary parameter containing "personal".
1662
- return [
1663
- resource,
1664
- resource.replace(':parameter/*development*', `:parameter/sst/passphrase/*/${TASK_STAGE_IAM_SHAPE}`),
1665
- ];
1666
- }
1667
- else {
1668
- task = resource
1669
- .replace(/-development-/gu, `-${TASK_STAGE_IAM_SHAPE}-`)
1670
- .replace(/\/ebk\/development\//gu, `/ebk/${TASK_STAGE_IAM_SHAPE}/`)
1671
- .replace(/:secret:ebk\/development\//gu, `:secret:ebk/${TASK_STAGE_IAM_SHAPE}/`)
1672
- .replace(/:alias\/ebk-development-/gu, `:alias/ebk-${TASK_STAGE_IAM_SHAPE}-`);
1673
- }
1674
- return task === resource ? [resource] : [resource, task];
1675
- })),
1676
- ].sort(compareStrings);
1677
- }
1678
- function admitDevelopmentTaskNamespaces(statements) {
1679
- const tagged = new Set([
1680
- 'MutateFixedRegionalServiceFamilies',
1681
- 'MutateEdgeCertificates',
1682
- 'DenyExplicitOtherStageRequestTag',
1683
- 'DenyKnownOtherStageResourceMutation',
1684
- 'DescribeOnlyTaggedStageWorkflowExecutions',
1685
- 'DenyWorkflowExecutionReadWithoutStageTag',
1686
- 'StartOnlyTaggedStageWorkflowExecutions',
1687
- 'CreateTaggedMachineAuthorizationStacks',
1688
- 'MutateTaggedMachineAuthorizationStacks',
1689
- 'CreateOnlyAwsResourceKmsGrants',
1690
- 'EnableRotationOnStageKmsKeys',
1691
- 'RetireOnlyTaggedNonProductionKmsKeys',
1692
- 'InvalidateOnlyStageCloudFrontDistributions',
1693
- 'InvokeOnlyStageLambdaFunctions',
1694
- 'AddOnlyReviewedStageLambdaIntegrations',
1695
- 'AddOnlyPublicStageLambdaFunctionUrlAccess',
1696
- 'AddOnlyPublicStageLambdaFunctionUrlInvoke',
1697
- 'RemoveOnlyStageLambdaIntegrations',
1698
- ]);
1699
- const named = new Set([
1700
- 'SetOnlyStageQueueAttributes',
1701
- 'DenyQueueAttributeMutationOutsideStage',
1702
- 'SetOnlyStageTopicAttributes',
1703
- 'DenyTopicAttributeMutationOutsideStage',
1704
- 'DenyUntaggedMutationOutsideStageAndSstResources',
1705
- 'DenyBucketPolicyMutationOutsideStageAndSstBootstrap',
1706
- 'DenyUnapprovedSsmValueReads',
1707
- 'DenySecretMetadataUpdateOutsideStageContainers',
1708
- 'DenyEdgeLogGroupMutationOutsideGeneratedStageLogs',
1709
- ]);
1710
- for (const sid of new Set([...tagged, ...named])) {
1711
- if (statements.filter((entry) => entry.Sid === sid).length !== 1) {
1712
- throw new Error(`Task authority propagation requires exactly one ${sid} statement.`);
1713
- }
1714
- }
1715
- for (const entry of statements) {
1716
- if (tagged.has(entry.Sid) && entry.Condition) {
1717
- const conditions = {};
1718
- for (const [operator, values] of Object.entries(entry.Condition)) {
1719
- for (const [key, value] of Object.entries(values)) {
1720
- const taskTag = ['aws:RequestTag/ebk:stage', 'aws:ResourceTag/ebk:stage'].includes(key) && value === 'development';
1721
- const taskOperator = taskTag
1722
- ? operator.replace('Equals', 'Like')
1723
- : operator;
1724
- (conditions[taskOperator] ??= {})[key] = taskTag
1725
- ? ['development', TASK_STAGE_IAM_SHAPE]
1726
- : value;
1727
- }
1728
- }
1729
- entry.Condition = conditions;
1730
- }
1731
- if (named.has(entry.Sid)) {
1732
- if (entry.Resource)
1733
- entry.Resource = taskNamespaceResources(entry.Resource);
1734
- if (entry.NotResource)
1735
- entry.NotResource = taskNamespaceResources(entry.NotResource);
1736
- }
1737
- }
1738
- }
10
+ const contracts_js_1 = require("./contracts.js");
11
+ const deployment_guardrails_js_1 = require("./deployment-guardrails.js");
12
+ const deployment_policy_groups_js_1 = require("./deployment-policy-groups.js");
13
+ const deployment_resources_js_1 = require("./deployment-resources.js");
14
+ const deployment_services_js_1 = require("./deployment-services.js");
15
+ const policy_document_js_1 = require("./policy-document.js");
16
+ const runtime_boundary_js_1 = require("./runtime-boundary.js");
17
+ const service_actions_js_1 = require("./service-actions.js");
18
+ const stage_identity_js_1 = require("./stage-identity.js");
1739
19
  function deploymentPolicy(options) {
1740
- const edgeRegion = edgeControlRegion(options.partition, options.region);
1741
- const managedPolicies = exports.STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES.map((name) => `arn:${options.partition}:iam::aws:policy/${name}`);
1742
- const productionDatabaseResources = [
1743
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:cluster:*`,
1744
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:db:*`,
1745
- ];
1746
- const productionRetentionResources = [
1747
- `arn:${options.partition}:backup:${options.region}:${options.accountId}:backup-plan:*`,
1748
- `arn:${options.partition}:backup:${options.region}:${options.accountId}:backup-vault:*`,
1749
- `arn:${options.partition}:backup:${options.region}:${options.accountId}:recovery-point:*`,
1750
- ];
1751
- const productionDataExportBucketResources = [
1752
- `arn:${options.partition}:s3:::ebk-${options.accountId}-production-*-data-export`,
1753
- `arn:${options.partition}:s3:::ebk-${options.accountId}-production-*-data-export/*`,
1754
- ];
1755
- const productionDataExportAliasResources = [
1756
- `arn:${options.partition}:kms:${options.region}:${options.accountId}:alias/ebk-production-*-data-export`,
1757
- ];
1758
- const stageLambdaResources = [
1759
- `arn:${options.partition}:lambda:${options.region}:${options.accountId}:function:*`,
1760
- ];
1761
- const foundationNatWorkloadRoleResources = [
1762
- `arn:${options.partition}:iam::${options.accountId}:role${options.identity.workloadRolePath}ebk-${options.stage}-foundation-nat`,
1763
- ];
1764
- const stageCloudFrontDistributionResources = [
1765
- `arn:${options.partition}:cloudfront::${options.accountId}:distribution/*`,
1766
- ];
1767
- const stageRouterWebAclResources = [
1768
- `arn:${options.partition}:wafv2:${edgeRegion}:${options.accountId}:global/webacl/*-${options.stage}-*/*`,
1769
- ];
1770
- const stageRouterCloudFrontFunctionResources = generatedRouterCloudFrontFunctionResources(options, options.stage);
1771
- const productionRouterCloudFrontFunctionResources = generatedRouterCloudFrontFunctionResources(options, 'production');
1772
- const stageRouterWafLogDestinationResources = [
1773
- `arn:${options.partition}:logs:${edgeRegion}:${options.accountId}:log-group:aws-waf-logs-foundation-${options.stage}-FoundationRouter-*`,
1774
- ];
1775
- const generatedEdgeLogGroupMutationResources = [
1776
- ...stageRouterWafLogDestinationResources,
1777
- ...(options.region === edgeRegion
1778
- ? [
1779
- `arn:${options.partition}:logs:${options.region}:${options.accountId}:log-group:/aws/vendedlogs/apis/*-${options.stage}-*`,
1780
- `arn:${options.partition}:logs:${options.region}:${options.accountId}:log-group:/ebk/${options.stage}/*`,
1781
- ]
1782
- : []),
1783
- ].sort(compareStrings);
1784
- const productionEventSubscriptionResources = [
1785
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:es:*`,
1786
- ];
1787
- const stageAccountBudgetResources = [
1788
- `arn:${options.partition}:budgets::${options.accountId}:budget/*`,
1789
- ];
1790
- const stageTopicResources = [
1791
- `arn:${options.partition}:sns:${options.region}:${options.accountId}:*-${options.stage}-*`,
1792
- ];
1793
- const generatedFoundationAlertTopicResources = [
1794
- `arn:${options.partition}:sns:${options.region}:${options.accountId}:foundation-${options.stage}-FoundationAlertsTopic-*`,
1795
- ];
1796
- const stageQueueResources = [
1797
- `arn:${options.partition}:sqs:${options.region}:${options.accountId}:*-${options.stage}-*`,
1798
- ];
1799
- const stageReadableSsmValueResources = [
1800
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/ebk/${options.stage}/workspace-owner`,
1801
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/ebk/${options.stage}/foundation/*`,
1802
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/sst/bootstrap`,
1803
- // SST 4.17.1 reads both /sst/bootstrap and /sst/bootstrap/asset on every
1804
- // deploy; a fresh stage refuses its first Foundation deploy without the
1805
- // asset parameter (EBK-INT-2026-078).
1806
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/sst/bootstrap/asset`,
1807
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/sst/passphrase/*/${options.stage}`,
1808
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/sst/vpc/vpc-*/private-key-value`,
1809
- ].sort(compareStrings);
1810
- const immutableWorkspaceOwnerResources = [
1811
- 'development',
1812
- 'production',
1813
- 'staging',
1814
- ]
1815
- .map((stage) => `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/ebk/${stage}/workspace-owner`)
1816
- .sort(compareStrings);
1817
- // SST 4.17.1 models the generated Aurora credential as a managed
1818
- // SecretVersion. The pinned AWS provider needs PutSecretValue to create it
1819
- // and GetSecretValue to reconcile its AWSCURRENT version during removal.
1820
- // Keep those value operations bound to the one Foundation-owned
1821
- // physical-name and stage-tag contract; operator/generated paths and every
1822
- // other secret value remain explicitly outside this exception.
1823
- const generatedFoundationDatabaseCredentialResources = [
1824
- `arn:${options.partition}:secretsmanager:${options.region}:${options.accountId}:secret:foundation-${options.stage}-FoundationDatabaseProxySecret-*`,
1825
- ];
1826
- // Native providers reconcile an EBK-owned Secret container through
1827
- // UpdateSecret regardless of whether it holds a generated database
1828
- // credential, a machine credential, or operator-supplied material. Bind that
1829
- // metadata lifecycle to the stable stage-owned namespace instead of
1830
- // enumerating today's generated container purposes. UpdateSecret can itself
1831
- // carry plaintext, so reviewed generated source, temporary deployer
1832
- // credentials, and CloudTrail remain the honest controls. GetSecretValue and
1833
- // PutSecretValue stay excluded from every Slice container.
1834
- const stageOwnedSecretContainerResources = [
1835
- `arn:${options.partition}:secretsmanager:${options.region}:${options.accountId}:secret:ebk/${options.stage}/*`,
1836
- ];
1837
- const stageSecretContainerMetadataUpdateResources = [
1838
- ...generatedFoundationDatabaseCredentialResources,
1839
- ...stageOwnedSecretContainerResources,
1840
- ].sort(compareStrings);
1841
- const machineAuthorizationStackResources = [
1842
- `arn:${options.partition}:cloudformation:${options.region}:${options.accountId}:stack/*MachineAuthorization*/*`,
1843
- ];
1844
- const costAnomalyMonitorResources = [
1845
- `arn:${options.partition}:ce::${options.accountId}:anomalymonitor/*`,
1846
- ];
1847
- const costAnomalySubscriptionResources = [
1848
- `arn:${options.partition}:ce::${options.accountId}:anomalysubscription/*`,
1849
- ];
1850
- const costAnomalyResources = [
1851
- ...costAnomalyMonitorResources,
1852
- ...costAnomalySubscriptionResources,
1853
- ].sort(compareStrings);
1854
- const productionCostScope = '*/account/production';
1855
- const eventArchiveResources = [
1856
- `arn:${options.partition}:events:${options.region}:${options.accountId}:archive/ebk-${options.stage}-foundation-events`,
1857
- ];
1858
- const foundationEventBusResources = [
1859
- `arn:${options.partition}:events:${options.region}:${options.accountId}:event-bus/foundation-${options.stage}-FoundationEventBusBus-*`,
1860
- ];
1861
- const stageKmsKeyResources = [
1862
- `arn:${options.partition}:kms:${options.region}:${options.accountId}:key/*`,
1863
- ];
1864
- const stageKmsAliasResources = [
1865
- `arn:${options.partition}:kms:${options.region}:${options.accountId}:alias/ebk-${options.stage}-*-data-export`,
1866
- ];
1867
- const stageStateMachineResources = [
1868
- `arn:${options.partition}:states:${options.region}:${options.accountId}:stateMachine:*-${options.stage}-*`,
1869
- ];
1870
- // Native SST physical state-machine names are derived from Pulumi logical
1871
- // names and do not necessarily contain the stage. Step Functions exposes the
1872
- // state machine's resource tags while authorizing both the state machine and
1873
- // its Standard executions, so the governed execution path uses the exact
1874
- // account/Region namespace plus the stage tag instead of a name convention.
1875
- const accountStateMachineResources = [
1876
- `arn:${options.partition}:states:${options.region}:${options.accountId}:stateMachine:*`,
1877
- ];
1878
- const accountExecutionResources = [
1879
- `arn:${options.partition}:states:${options.region}:${options.accountId}:execution:*:*`,
1880
- ];
1881
- const serviceLinkedRoles = [
1882
- ...exports.STAGE_AUTHORITY_SERVICE_LINKED_ROLES,
1883
- ...(options.publicHostedZoneId
1884
- ? STAGE_AUTHORITY_BOUND_PUBLIC_DNS_SERVICE_LINKED_ROLES
1885
- : []),
1886
- ].sort((left, right) => compareStrings(left.serviceName, right.serviceName));
1887
- const serviceLinkedRoleResources = serviceLinkedRoles.map(({ path }) => `arn:${options.partition}:iam::${options.accountId}:role/aws-service-role/${path}`);
1888
- const stageAndSharedMutationResources = [
1889
- `arn:${options.partition}:backup:${options.region}:${options.accountId}:*:*${options.stage}*`,
1890
- `arn:${options.partition}:budgets::${options.accountId}:budget/*`,
1891
- ...stageRouterCloudFrontFunctionResources,
1892
- `arn:${options.partition}:dynamodb:${options.region}:${options.accountId}:table/*-${options.stage}-*`,
1893
- `arn:${options.partition}:ecr:${options.region}:${options.accountId}:repository/ebk/${options.stage}/*`,
1894
- `arn:${options.partition}:events:${options.region}:${options.accountId}:archive/ebk-${options.stage}-*`,
1895
- `arn:${options.partition}:events:${options.region}:${options.accountId}:event-bus/*-${options.stage}-*`,
1896
- `arn:${options.partition}:events:${options.region}:${options.accountId}:rule/*-${options.stage}-*`,
1897
- `arn:${options.partition}:iam::${options.accountId}:instance-profile/ebk/${options.stage}/workloads/*`,
1898
- `arn:${options.partition}:iam::${options.accountId}:role/ebk/${options.stage}/workloads/*`,
1899
- ...stageKmsAliasResources,
1900
- `arn:${options.partition}:lambda:${options.region}:${options.accountId}:function:*-${options.stage}-*`,
1901
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:cluster:*-${options.stage}-*`,
1902
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:db:*-${options.stage}-*`,
1903
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:snapshot:*-${options.stage}-*`,
1904
- `arn:${options.partition}:s3:::*-${options.stage}-*`,
1905
- `arn:${options.partition}:s3:::*-${options.stage}-*/*`,
1906
- `arn:${options.partition}:s3:::sst-asset-*`,
1907
- `arn:${options.partition}:s3:::sst-asset-*/*`,
1908
- `arn:${options.partition}:s3:::sst-state-*`,
1909
- `arn:${options.partition}:s3:::sst-state-*/*`,
1910
- `arn:${options.partition}:secretsmanager:${options.region}:${options.accountId}:secret:ebk/${options.stage}/*`,
1911
- `arn:${options.partition}:sns:${options.region}:${options.accountId}:*-${options.stage}-*`,
1912
- `arn:${options.partition}:sqs:${options.region}:${options.accountId}:*-${options.stage}-*`,
1913
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/*${options.stage}*`,
1914
- ...stageStateMachineResources,
1915
- `arn:${options.partition}:wafv2:${edgeRegion}:${options.accountId}:global/webacl/*-${options.stage}-*/*`,
1916
- ].sort(compareStrings);
1917
- const namedProductionResources = [
1918
- `arn:${options.partition}:backup:${options.region}:${options.accountId}:backup-vault:*production*`,
1919
- `arn:${options.partition}:cloudwatch:${options.region}:${options.accountId}:alarm:*production*`,
1920
- `arn:${options.partition}:cloudwatch::${options.accountId}:dashboard/*production*`,
1921
- ...productionRouterCloudFrontFunctionResources,
1922
- `arn:${options.partition}:dynamodb:${options.region}:${options.accountId}:table/*-production-*`,
1923
- `arn:${options.partition}:ecr:${options.region}:${options.accountId}:repository/ebk/production/*`,
1924
- `arn:${options.partition}:ecs:${options.region}:${options.accountId}:cluster/*production*`,
1925
- `arn:${options.partition}:ecs:${options.region}:${options.accountId}:service/*production*/*`,
1926
- `arn:${options.partition}:elasticloadbalancing:${options.region}:${options.accountId}:loadbalancer/*/*production*/*`,
1927
- `arn:${options.partition}:elasticloadbalancing:${options.region}:${options.accountId}:targetgroup/*production*/*`,
1928
- `arn:${options.partition}:events:${options.region}:${options.accountId}:event-bus/*-production-*`,
1929
- `arn:${options.partition}:events:${options.region}:${options.accountId}:rule/*-production-*`,
1930
- `arn:${options.partition}:iam::${options.accountId}:instance-profile/ebk/production/*`,
1931
- `arn:${options.partition}:iam::${options.accountId}:policy/ebk/production/*`,
1932
- `arn:${options.partition}:iam::${options.accountId}:role/ebk/production/*`,
1933
- `arn:${options.partition}:kms:${options.region}:${options.accountId}:alias/ebk-production-*-data-export`,
1934
- `arn:${options.partition}:lambda:${options.region}:${options.accountId}:function:*-production-*`,
1935
- `arn:${options.partition}:logs:${options.region}:${options.accountId}:log-group:*production*`,
1936
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:cluster:*-production-*`,
1937
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:db:*-production-*`,
1938
- `arn:${options.partition}:rds:${options.region}:${options.accountId}:snapshot:*-production-*`,
1939
- `arn:${options.partition}:s3:::*-production-*`,
1940
- `arn:${options.partition}:s3:::*-production-*/*`,
1941
- `arn:${options.partition}:secretsmanager:${options.region}:${options.accountId}:secret:ebk/production/*`,
1942
- `arn:${options.partition}:sns:${options.region}:${options.accountId}:*-production-*`,
1943
- `arn:${options.partition}:sqs:${options.region}:${options.accountId}:*-production-*`,
1944
- `arn:${options.partition}:ssm:${options.region}:${options.accountId}:parameter/*production*`,
1945
- `arn:${options.partition}:states:${options.region}:${options.accountId}:stateMachine:*-production-*`,
1946
- `arn:${options.partition}:wafv2:${edgeRegion}:${options.accountId}:global/webacl/*-production-*/*`,
1947
- ].sort(compareStrings);
1948
- const stageAndSharedSstBucketResources = [
1949
- `arn:${options.partition}:s3:::*-${options.stage}-*`,
1950
- `arn:${options.partition}:s3:::sst-asset-*`,
1951
- `arn:${options.partition}:s3:::sst-state-*`,
1952
- ].sort(compareStrings);
1953
- const runInstancesExternalReferenceResources = [
1954
- `arn:${options.partition}:ec2:${options.region}::image/ami-*`,
1955
- `arn:${options.partition}:ec2:${options.region}::snapshot/snap-*`,
1956
- ].sort(compareStrings);
1957
- const runInstancesApprovedReferenceOwners = [
1958
- options.accountId,
1959
- ...(options.stage === 'production'
1960
- ? []
1961
- : exports.STAGE_AUTHORITY_SST_417_EXTERNAL_AMI_OWNERS_BY_PARTITION[options.partition]),
1962
- ].sort(compareStrings);
20
+ const resources = (0, deployment_resources_js_1.deploymentResources)(options);
1963
21
  const statements = [
1964
- statement({
1965
- Action: exports.STAGE_AUTHORITY_REGIONAL_READ_ACTIONS,
1966
- Condition: {
1967
- StringEquals: { 'aws:RequestedRegion': options.region },
1968
- },
1969
- Effect: 'Allow',
1970
- Resource: ['*'],
1971
- Sid: 'ReadFixedRegionalServiceFamilies',
1972
- }),
1973
- statement({
1974
- Action: ['acm:Describe*', 'acm:Get*', 'acm:List*'],
1975
- Condition: {
1976
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
1977
- },
1978
- Effect: 'Allow',
1979
- Resource: ['*'],
1980
- Sid: 'ReadEdgeCertificateControlPlane',
1981
- }),
1982
- statement({
1983
- Action: exports.STAGE_AUTHORITY_EDGE_OBSERVABILITY_READ_ACTIONS,
1984
- Condition: {
1985
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
1986
- },
1987
- Effect: 'Allow',
1988
- Resource: ['*'],
1989
- Sid: 'ReadEdgeObservabilityControlPlane',
1990
- }),
1991
- statement({
1992
- Action: exports.STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS,
1993
- Condition: {
1994
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
1995
- },
1996
- Effect: 'Allow',
1997
- Resource: stageRouterWafLogDestinationResources,
1998
- Sid: 'ManageOnlyGeneratedEdgeWafLogGroup',
1999
- }),
2000
- // CloudWatch Logs models these native WAF delivery calls as account-level
2001
- // operations. PutResourcePolicy exposes neither a resource ARN nor an
2002
- // action-specific condition key; reviewed generated source is the control
2003
- // for its uninspectable payload, and the request remains edge-Region-bound.
2004
- statement({
2005
- Action: [
2006
- ...exports.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS,
2007
- // Cloud Control has no resource-level or TypeName condition support.
2008
- // Use the caller's temporary session, never a service RoleArn. The
2009
- // underlying resource operations retain the deployer's guardrails.
2010
- ...exports.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS,
2011
- // The ordinary regional read grant already covers a same-Region
2012
- // deployment. CloudFront still needs these exact reads at the edge
2013
- // endpoint when application resources live elsewhere.
2014
- ...(options.region === edgeRegion
2015
- ? []
2016
- : [
2017
- 'cloudformation:DescribeType',
2018
- 'cloudformation:GetResource',
2019
- 'cloudformation:GetResourceRequestStatus',
2020
- ]),
2021
- ],
2022
- Condition: {
2023
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
2024
- },
2025
- Effect: 'Allow',
2026
- Resource: ['*'],
2027
- Sid: 'ManageEdgeWafLogDeliveryControlPlane',
2028
- }),
2029
- statement({
2030
- Action: exports.STAGE_AUTHORITY_GLOBAL_READ_ACTIONS,
2031
- Effect: 'Allow',
2032
- Resource: ['*'],
2033
- Sid: 'ReadFixedGlobalServiceFamilies',
2034
- }),
2035
- statement({
2036
- Action: ['states:DescribeExecution'],
2037
- Condition: {
2038
- StringEquals: {
2039
- 'aws:RequestedRegion': options.region,
2040
- 'aws:ResourceTag/ebk:stage': options.stage,
2041
- },
2042
- },
2043
- Effect: 'Allow',
2044
- Resource: accountExecutionResources,
2045
- Sid: 'DescribeOnlyTaggedStageWorkflowExecutions',
2046
- }),
2047
- statement({
2048
- Action: ['states:DescribeExecution'],
2049
- Condition: {
2050
- StringNotEquals: {
2051
- 'aws:ResourceTag/ebk:stage': options.stage,
2052
- },
2053
- },
2054
- Effect: 'Deny',
2055
- Resource: accountExecutionResources,
2056
- Sid: 'DenyWorkflowExecutionReadWithoutStageTag',
2057
- }),
2058
- statement({
2059
- Action: ['states:DescribeExecution'],
2060
- Effect: 'Deny',
2061
- NotResource: accountExecutionResources,
2062
- Sid: 'DenyWorkflowExecutionReadOutsideAccount',
2063
- }),
2064
- statement({
2065
- Action: exports.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS,
2066
- Condition: {
2067
- StringEquals: { 'aws:RequestedRegion': options.region },
2068
- StringEqualsIfExists: {
2069
- 'aws:RequestTag/ebk:stage': options.stage,
2070
- 'aws:ResourceAccount': options.accountId,
2071
- 'aws:ResourceTag/ebk:stage': options.stage,
2072
- },
2073
- },
2074
- Effect: 'Allow',
2075
- Resource: ['*'],
2076
- Sid: 'MutateFixedRegionalServiceFamilies',
2077
- }),
2078
- statement({
2079
- Action: ['acm:*'],
2080
- Condition: {
2081
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
2082
- StringEqualsIfExists: {
2083
- 'aws:RequestTag/ebk:stage': options.stage,
2084
- 'aws:ResourceAccount': options.accountId,
2085
- 'aws:ResourceTag/ebk:stage': options.stage,
2086
- },
2087
- },
2088
- Effect: 'Allow',
2089
- Resource: ['*'],
2090
- Sid: 'MutateEdgeCertificates',
2091
- }),
2092
- statement({
2093
- Action: exports.STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS,
2094
- Condition: {
2095
- StringEquals: { 'aws:RequestedRegion': options.region },
2096
- },
2097
- Effect: 'Allow',
2098
- Resource: ['*'],
2099
- Sid: 'MutateStageBucketsInStageRegion',
2100
- }),
2101
- statement({
2102
- Action: ['s3:CreateBucket'],
2103
- Condition: options.region === 'us-east-1'
2104
- ? {
2105
- Null: { 's3:LocationConstraint': 'true' },
2106
- StringEquals: { 'aws:RequestedRegion': options.region },
2107
- }
2108
- : {
2109
- StringEquals: {
2110
- 'aws:RequestedRegion': options.region,
2111
- 's3:LocationConstraint': options.region,
2112
- },
2113
- },
2114
- Effect: 'Allow',
2115
- Resource: ['*'],
2116
- Sid: 'CreateBucketOnlyInStageRegion',
2117
- }),
2118
- // The generated architecture does not synthesize a stable Grant resource
2119
- // whose grantee and operation set can be enumerated here. Follow AWS KMS's
2120
- // integrated-service contract instead: a user cannot call CreateGrant
2121
- // directly, and the grant remains bound to this account's stage key.
2122
- statement({
2123
- Action: ['kms:CreateGrant'],
2124
- Condition: {
2125
- Bool: { 'kms:GrantIsForAWSResource': 'true' },
2126
- StringEquals: {
2127
- 'aws:RequestedRegion': options.region,
2128
- 'aws:ResourceTag/ebk:stage': options.stage,
2129
- },
2130
- StringEqualsIfExists: {
2131
- 'aws:ResourceAccount': options.accountId,
2132
- },
2133
- },
2134
- Effect: 'Allow',
2135
- Resource: stageKmsKeyResources,
2136
- Sid: 'CreateOnlyAwsResourceKmsGrants',
2137
- }),
2138
- statement({
2139
- Action: ['ec2:RunInstances'],
2140
- Condition: {
2141
- StringEquals: { 'aws:RequestedRegion': options.region },
2142
- },
2143
- Effect: 'Allow',
2144
- Resource: ['*'],
2145
- Sid: 'LaunchStageInfrastructureFromApprovedReferences',
2146
- }),
2147
- statement({
2148
- Action: SECRET_BATCH_VALUE_READ_ACTIONS,
2149
- Effect: 'Deny',
2150
- Resource: ['*'],
2151
- Sid: 'DenySecretsManagerBatchValueReads',
2152
- }),
2153
- statement({
2154
- Action: GENERATED_FOUNDATION_DATABASE_VALUE_ACTIONS,
2155
- Effect: 'Deny',
2156
- NotResource: generatedFoundationDatabaseCredentialResources,
2157
- Sid: 'DenySecretValueAccessOutsideGeneratedFoundationDatabase',
2158
- }),
2159
- statement({
2160
- Action: GENERATED_FOUNDATION_DATABASE_RECONCILIATION_ACTIONS,
2161
- Condition: {
2162
- StringNotEquals: {
2163
- 'aws:ResourceTag/ebk:stage': options.stage,
2164
- },
2165
- },
2166
- Effect: 'Deny',
2167
- Resource: generatedFoundationDatabaseCredentialResources,
2168
- Sid: 'DenyGeneratedDatabaseValueAccessWithWrongStageTag',
2169
- }),
2170
- statement({
2171
- Action: STAGE_SECRET_CONTAINER_METADATA_UPDATE_ACTIONS,
2172
- Effect: 'Deny',
2173
- NotResource: stageSecretContainerMetadataUpdateResources,
2174
- Sid: 'DenySecretMetadataUpdateOutsideStageContainers',
2175
- }),
2176
- statement({
2177
- Action: ['ssm:GetParameter', 'ssm:GetParameters'],
2178
- Effect: 'Deny',
2179
- NotResource: stageReadableSsmValueResources,
2180
- Sid: 'DenyUnapprovedSsmValueReads',
2181
- }),
2182
- statement({
2183
- Action: SSM_HISTORY_AND_RECURSIVE_VALUE_READ_ACTIONS,
2184
- Effect: 'Deny',
2185
- Resource: ['*'],
2186
- Sid: 'DenySsmHistoryAndRecursiveValueReads',
2187
- }),
2188
- statement({
2189
- Action: [
2190
- 'ssm:AddTagsToResource',
2191
- 'ssm:DeleteParameter',
2192
- 'ssm:DeleteParameters',
2193
- 'ssm:LabelParameterVersion',
2194
- 'ssm:PutParameter',
2195
- 'ssm:RemoveTagsFromResource',
2196
- 'ssm:UnlabelParameterVersion',
2197
- ],
2198
- Effect: 'Deny',
2199
- Resource: immutableWorkspaceOwnerResources,
2200
- Sid: 'DenyOwnerMutation',
2201
- }),
2202
- statement({
2203
- Action: exports.STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS,
2204
- Effect: 'Deny',
2205
- Resource: ['*'],
2206
- Sid: 'DenyNonDeploymentControlOperations',
2207
- }),
2208
- statement({
2209
- Action: WORKFLOW_EXECUTION_MUTATION_ACTIONS,
2210
- Effect: 'Deny',
2211
- NotResource: [
2212
- ...accountExecutionResources,
2213
- ...accountStateMachineResources,
2214
- ],
2215
- Sid: 'DenyUnscopedWorkflowExecutionMutation',
2216
- }),
2217
- statement({
2218
- Action: exports.STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS,
2219
- Effect: 'Deny',
2220
- Resource: ['*'],
2221
- Sid: 'DenyUnsupportedWorkflowExecutionMutation',
2222
- }),
2223
- statement({
2224
- Action: ['states:StartExecution'],
2225
- Condition: {
2226
- Null: { 'aws:ResourceTag/ebk:stage': 'true' },
2227
- },
2228
- Effect: 'Deny',
2229
- Resource: accountStateMachineResources,
2230
- Sid: 'DenyUntaggedWorkflowExecutionStart',
2231
- }),
2232
- statement({
2233
- Action: ['states:StartExecution'],
2234
- Condition: {
2235
- StringEquals: {
2236
- 'aws:RequestedRegion': options.region,
2237
- 'aws:ResourceTag/ebk:stage': options.stage,
2238
- },
2239
- },
2240
- Effect: 'Allow',
2241
- Resource: accountStateMachineResources,
2242
- Sid: 'StartOnlyTaggedStageWorkflowExecutions',
2243
- }),
2244
- statement({
2245
- Action: ['cloudformation:CreateStack'],
2246
- Condition: {
2247
- StringEquals: {
2248
- 'aws:RequestTag/ebk:stage': options.stage,
2249
- 'aws:RequestedRegion': options.region,
2250
- },
2251
- },
2252
- Effect: 'Allow',
2253
- Resource: machineAuthorizationStackResources,
2254
- Sid: 'CreateTaggedMachineAuthorizationStacks',
2255
- }),
2256
- statement({
2257
- Action: ['cloudformation:DeleteStack', 'cloudformation:UpdateStack'],
2258
- Condition: {
2259
- StringEquals: {
2260
- 'aws:RequestedRegion': options.region,
2261
- 'aws:ResourceTag/ebk:stage': options.stage,
2262
- },
2263
- },
2264
- Effect: 'Allow',
2265
- Resource: machineAuthorizationStackResources,
2266
- Sid: 'MutateTaggedMachineAuthorizationStacks',
2267
- }),
2268
- statement({
2269
- Action: exports.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS,
2270
- Condition: {
2271
- StringEquals: {
2272
- 'aws:RequestedRegion': options.region,
2273
- },
2274
- },
2275
- Effect: 'Allow',
2276
- Resource: eventArchiveResources,
2277
- Sid: 'CreateNamedFoundationEventArchive',
2278
- }),
2279
- statement({
2280
- Action: exports.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS,
2281
- Condition: {
2282
- StringEquals: {
2283
- 'aws:RequestedRegion': options.region,
2284
- 'aws:ResourceTag/ebk:stage': options.stage,
2285
- },
2286
- },
2287
- Effect: 'Allow',
2288
- Resource: foundationEventBusResources,
2289
- Sid: 'CreateArchiveFromTaggedFoundationEventBus',
2290
- }),
2291
- statement({
2292
- Action: exports.STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS,
2293
- Condition: {
2294
- StringEquals: {
2295
- 'aws:RequestedRegion': options.region,
2296
- },
2297
- },
2298
- Effect: 'Allow',
2299
- Resource: eventArchiveResources,
2300
- Sid: 'MutateNamedFoundationEventArchive',
2301
- }),
2302
- statement({
2303
- Action: [
2304
- ...exports.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS,
2305
- ...exports.STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS,
2306
- ],
2307
- Effect: 'Deny',
2308
- NotResource: [...eventArchiveResources, ...foundationEventBusResources],
2309
- Sid: 'DenyEventArchiveMutationOutsideGeneratedFoundationArchive',
2310
- }),
2311
- statement({
2312
- Action: exports.STAGE_AUTHORITY_KMS_ROTATION_ACTIONS,
2313
- Condition: {
2314
- StringEquals: {
2315
- 'aws:RequestedRegion': options.region,
2316
- 'aws:ResourceTag/ebk:stage': options.stage,
2317
- },
2318
- },
2319
- Effect: 'Allow',
2320
- Resource: stageKmsKeyResources,
2321
- Sid: 'EnableRotationOnStageKmsKeys',
2322
- }),
2323
- statement({
2324
- Action: ['iam:CreateServiceLinkedRole'],
2325
- Condition: {
2326
- StringEquals: {
2327
- 'iam:AWSServiceName': serviceLinkedRoles.map(({ serviceName }) => serviceName),
2328
- },
2329
- },
2330
- Effect: 'Allow',
2331
- Resource: serviceLinkedRoleResources,
2332
- Sid: 'CreateOnlyRequiredServiceLinkedRoles',
2333
- }),
2334
- statement({
2335
- Action: exports.STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS,
2336
- Condition: {
2337
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
2338
- },
2339
- Effect: 'Allow',
2340
- Resource: ['*'],
2341
- Sid: 'CreateOnlyGeneratedCloudFrontResources',
2342
- }),
2343
- // Direct Route 53 record writes exist only for a committed public DNS
2344
- // binding: one exact hosted zone, Router alias and ACM validation types
2345
- // only. ForAllValues is true for an absent key, so the Null guard keeps a
2346
- // request without record-type context denied.
2347
- ...(options.publicHostedZoneId
2348
- ? [
2349
- statement({
2350
- Action: ['route53:ChangeResourceRecordSets'],
2351
- Condition: {
2352
- 'ForAllValues:StringEquals': {
2353
- 'route53:ChangeResourceRecordSetsRecordTypes': exports.STAGE_AUTHORITY_PUBLIC_DNS_RECORD_TYPES,
2354
- },
2355
- Null: {
2356
- 'route53:ChangeResourceRecordSetsRecordTypes': 'false',
2357
- },
2358
- },
2359
- Effect: 'Allow',
2360
- Resource: [
2361
- `arn:${options.partition}:route53:::hostedzone/${options.publicHostedZoneId}`,
2362
- ],
2363
- Sid: 'ChangeOnlyBoundPublicZoneAliasRecords',
2364
- }),
2365
- ]
2366
- : []),
2367
- statement({
2368
- Action: exports.STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS,
2369
- Condition: {
2370
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
2371
- },
2372
- Effect: 'Allow',
2373
- Resource: ['*'],
2374
- Sid: 'MutateCloudFrontScopeWafInEdgeRegion',
2375
- }),
2376
- // Cloud Map forwards its private-zone create and one SOA UPSERT per
2377
- // namespace with this role's identity. Neither request can be issued
2378
- // directly or through another service. CreateHostedZone carries no record
2379
- // keys, so ForAllValues admits it unchanged; a forwarded record change must
2380
- // be an SOA UPSERT whenever Route 53 supplies the record keys. A Null guard
2381
- // would refuse CreateHostedZone in this shared statement, and a separate
2382
- // guarded statement exceeds the bound-template floor (see the issue #137
2383
- // ledger), so absent keys fall back to the reviewed Cloud Map-only scope.
2384
- statement({
2385
- Action: exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_ROUTE53_ACTIONS,
2386
- Condition: {
2387
- Bool: { 'aws:ViaAWSService': 'true' },
2388
- 'ForAllValues:StringEquals': {
2389
- 'route53:ChangeResourceRecordSetsActions': exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_ACTIONS,
2390
- 'route53:ChangeResourceRecordSetsRecordTypes': exports.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_TYPES,
2391
- },
2392
- StringEquals: {
2393
- 'aws:CalledViaLast': 'servicediscovery.amazonaws.com',
2394
- },
2395
- },
2396
- Effect: 'Allow',
2397
- Resource: ['*'],
2398
- Sid: 'ChangeOnlyCloudMapForwardedNamespaceZones',
2399
- }),
2400
- statement({
2401
- Action: exports.STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS,
2402
- Condition: {
2403
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
2404
- },
2405
- Effect: 'Allow',
2406
- Resource: [
2407
- `arn:${options.partition}:cloudfront::${options.accountId}:*/*`,
2408
- ],
2409
- Sid: 'MutateAccountCloudFront',
2410
- }),
2411
- // A bound stage's Cognito custom domain (`auth.<root>`) is served by a
2412
- // CloudFront distribution that AWS owns. Cognito checks the role twice:
2413
- // its documented prerequisite, cloudfront:UpdateDistribution on Resource
2414
- // "*", which only this grant satisfies, and a forwarded UpdateDistribution
2415
- // on that distribution's concrete ARN, which carries this account, so
2416
- // the account-scoped grant above also admits it. Bound renders only, this
2417
- // one action only. CloudFront distributions carry no resource policy, so
2418
- // the grant reaches no other account's distribution by a direct call. The
2419
- // edge-Region condition matches the edge-Region deny that already applies
2420
- // to this action, so it removes nothing.
2421
- ...(options.publicHostedZoneId
2422
- ? [
2423
- statement({
2424
- Action: ['cloudfront:UpdateDistribution'],
2425
- Condition: {
2426
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
2427
- },
2428
- Effect: 'Allow',
2429
- Resource: ['*'],
2430
- Sid: 'UpdateDistributionForBoundIdentityDomain',
2431
- }),
2432
- ]
2433
- : []),
2434
- statement({
2435
- Action: exports.STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS,
2436
- Condition: {
2437
- StringEquals: {
2438
- 'aws:RequestedRegion': edgeRegion,
2439
- 'aws:ResourceTag/ebk:stage': options.stage,
2440
- },
2441
- },
2442
- Effect: 'Allow',
2443
- Resource: stageCloudFrontDistributionResources,
2444
- Sid: 'InvalidateOnlyStageCloudFrontDistributions',
2445
- }),
2446
- statement({
2447
- Action: exports.STAGE_AUTHORITY_LAMBDA_DEPLOYMENT_INVOKE_ACTIONS,
2448
- Condition: {
2449
- StringEquals: {
2450
- 'aws:RequestedRegion': options.region,
2451
- 'aws:ResourceTag/ebk:stage': options.stage,
2452
- },
2453
- },
2454
- Effect: 'Allow',
2455
- Resource: stageLambdaResources,
2456
- Sid: 'InvokeOnlyStageLambdaFunctions',
2457
- }),
2458
- statement({
2459
- Action: ['lambda:AddPermission'],
2460
- Condition: {
2461
- StringEquals: {
2462
- 'aws:RequestedRegion': options.region,
2463
- 'aws:ResourceTag/ebk:stage': options.stage,
2464
- 'lambda:Principal': LAMBDA_INTEGRATION_PRINCIPALS,
2465
- },
2466
- },
2467
- Effect: 'Allow',
2468
- Resource: stageLambdaResources,
2469
- Sid: 'AddOnlyReviewedStageLambdaIntegrations',
2470
- }),
2471
- statement({
2472
- Action: ['lambda:AddPermission'],
2473
- Condition: {
2474
- StringEquals: {
2475
- 'aws:RequestedRegion': options.region,
2476
- 'aws:ResourceTag/ebk:stage': options.stage,
2477
- 'lambda:FunctionUrlAuthType': 'NONE',
2478
- 'lambda:Principal': '*',
2479
- },
2480
- },
2481
- Effect: 'Allow',
2482
- Resource: stageLambdaResources,
2483
- Sid: 'AddOnlyPublicStageLambdaFunctionUrlAccess',
2484
- }),
2485
- statement({
2486
- Action: ['lambda:AddPermission'],
2487
- Condition: {
2488
- // AddPermission accepts InvokedViaFunctionUrl, but Lambda does not
2489
- // expose that request member as a caller-side authorization context.
2490
- // The companion request is distinguishable from the public
2491
- // InvokeFunctionUrl permission by the absence of FunctionUrlAuthType.
2492
- Null: {
2493
- 'lambda:FunctionUrlAuthType': 'true',
2494
- },
2495
- StringEquals: {
2496
- 'aws:RequestedRegion': options.region,
2497
- 'aws:ResourceTag/ebk:stage': options.stage,
2498
- 'lambda:Principal': '*',
2499
- },
2500
- },
2501
- Effect: 'Allow',
2502
- Resource: stageLambdaResources,
2503
- Sid: 'AddOnlyPublicStageLambdaFunctionUrlInvoke',
2504
- }),
2505
- statement({
2506
- Action: exports.STAGE_AUTHORITY_WAF_LOGGING_ACTIONS,
2507
- Condition: {
2508
- ArnLike: {
2509
- 'wafv2:LogDestinationResource': stageRouterWafLogDestinationResources,
2510
- },
2511
- StringEquals: {
2512
- 'aws:RequestedRegion': edgeRegion,
2513
- 'aws:ResourceTag/ebk:stage': options.stage,
2514
- 'wafv2:LogScope': 'CUSTOMER',
2515
- },
2516
- },
2517
- Effect: 'Allow',
2518
- Resource: stageRouterWebAclResources,
2519
- Sid: 'PutOnlyStageRouterWafLogging',
2520
- }),
2521
- statement({
2522
- Action: ['budgets:ModifyBudget', 'budgets:TagResource'],
2523
- Condition: {
2524
- StringEquals: {
2525
- 'aws:RequestTag/ebk:stage': options.stage,
2526
- },
2527
- },
2528
- Effect: 'Allow',
2529
- Resource: stageAccountBudgetResources,
2530
- Sid: 'CreateOnlyTaggedStageAccountBudget',
2531
- }),
2532
- statement({
2533
- Action: exports.STAGE_AUTHORITY_BUDGET_MUTATION_ACTIONS,
2534
- Condition: {
2535
- StringEquals: {
2536
- 'aws:ResourceTag/ebk:stage': options.stage,
2537
- },
2538
- },
2539
- Effect: 'Allow',
2540
- Resource: stageAccountBudgetResources,
2541
- Sid: 'MutateOnlyTaggedStageAccountBudget',
2542
- }),
2543
- statement({
2544
- Action: exports.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS,
2545
- Condition: {
2546
- Null: { 'aws:ResourceTag/ebk:stage': 'true' },
2547
- },
2548
- Effect: 'Deny',
2549
- Resource: productionEventSubscriptionResources,
2550
- Sid: 'DenyUnscopedDatabaseEventSubscriptionSourceMutation',
2551
- }),
2552
- statement({
2553
- Action: ['lambda:RemovePermission'],
2554
- Condition: {
2555
- StringEquals: {
2556
- 'aws:RequestedRegion': options.region,
2557
- 'aws:ResourceTag/ebk:stage': options.stage,
2558
- },
2559
- },
2560
- Effect: 'Allow',
2561
- Resource: stageLambdaResources,
2562
- Sid: 'RemoveOnlyStageLambdaIntegrations',
2563
- }),
2564
- statement({
2565
- Action: ['lambda:AddPermission', 'lambda:RemovePermission'],
2566
- Condition: {
2567
- Null: { 'aws:ResourceTag/ebk:stage': 'true' },
2568
- },
2569
- Effect: 'Deny',
2570
- Resource: ['*'],
2571
- Sid: 'DenyUnscopedLambdaPermissions',
2572
- }),
2573
- statement({
2574
- Action: ['sns:SetTopicAttributes'],
2575
- Condition: {
2576
- StringEquals: {
2577
- 'aws:RequestedRegion': options.region,
2578
- },
2579
- },
2580
- Effect: 'Allow',
2581
- Resource: stageTopicResources,
2582
- Sid: 'SetOnlyStageTopicAttributes',
2583
- }),
2584
- // RDS validates that the CreateEventSubscription caller can publish to
2585
- // its destination topic. The regional service-family allow admits that
2586
- // control-plane check; this exact deny keeps every other topic closed.
2587
- // Runtime workloads retain their separately generated least-privilege roles.
2588
- statement({
2589
- Action: ['sns:Publish'],
2590
- Effect: 'Deny',
2591
- NotResource: generatedFoundationAlertTopicResources,
2592
- Sid: 'DenyPublishOutsideGeneratedFoundationAlerts',
2593
- }),
2594
- statement({
2595
- Action: ['sqs:SetQueueAttributes'],
2596
- Condition: {
2597
- StringEquals: {
2598
- 'aws:RequestedRegion': options.region,
2599
- },
2600
- },
2601
- Effect: 'Allow',
2602
- Resource: stageQueueResources,
2603
- Sid: 'SetOnlyStageQueueAttributes',
2604
- }),
2605
- statement({
2606
- Action: ['sns:SetTopicAttributes'],
2607
- Effect: 'Deny',
2608
- NotResource: stageTopicResources,
2609
- Sid: 'DenyTopicAttributeMutationOutsideStage',
2610
- }),
2611
- statement({
2612
- Action: ['sqs:SetQueueAttributes'],
2613
- Effect: 'Deny',
2614
- NotResource: stageQueueResources,
2615
- Sid: 'DenyQueueAttributeMutationOutsideStage',
2616
- }),
2617
- statement({
2618
- Action: [
2619
- 'iam:AddRoleToInstanceProfile',
2620
- 'iam:CreateInstanceProfile',
2621
- 'iam:DeleteInstanceProfile',
2622
- 'iam:DeleteRole',
2623
- 'iam:DeleteRolePolicy',
2624
- 'iam:PutRolePolicy',
2625
- 'iam:RemoveRoleFromInstanceProfile',
2626
- 'iam:TagInstanceProfile',
2627
- 'iam:TagRole',
2628
- 'iam:UntagInstanceProfile',
2629
- 'iam:UntagRole',
2630
- 'iam:UpdateRole',
2631
- 'iam:UpdateRoleDescription',
2632
- ],
2633
- Effect: 'Allow',
2634
- Resource: [
2635
- options.identity.workloadInstanceProfileArnPattern,
2636
- options.identity.workloadRoleArnPattern,
2637
- ],
2638
- Sid: 'ManageStageWorkloadIdentities',
2639
- }),
2640
- statement({
2641
- Action: ['iam:CreateRole'],
2642
- Condition: {
2643
- StringEquals: {
2644
- 'iam:PermissionsBoundary': options.identity.boundaryArn,
2645
- },
2646
- },
2647
- Effect: 'Allow',
2648
- Resource: [options.identity.workloadRoleArnPattern],
2649
- Sid: 'CreateOnlyBoundaryConstrainedStageWorkloadRoles',
2650
- }),
2651
- statement({
2652
- Action: ['iam:PutRolePermissionsBoundary'],
2653
- Condition: {
2654
- StringEquals: {
2655
- 'iam:PermissionsBoundary': options.identity.boundaryArn,
2656
- },
2657
- },
2658
- Effect: 'Allow',
2659
- Resource: [options.identity.workloadRoleArnPattern],
2660
- Sid: 'ApplyExactStageRuntimeBoundary',
2661
- }),
2662
- statement({
2663
- Action: ['iam:AttachRolePolicy', 'iam:DetachRolePolicy'],
2664
- Condition: {
2665
- ArnEquals: {
2666
- 'iam:PermissionsBoundary': options.identity.boundaryArn,
2667
- 'iam:PolicyARN': managedPolicies,
2668
- },
2669
- },
2670
- Effect: 'Allow',
2671
- Resource: [options.identity.workloadRoleArnPattern],
2672
- Sid: 'AttachOnlyPinnedAwsRuntimePolicies',
2673
- }),
2674
- statement({
2675
- Action: ['iam:PassRole'],
2676
- Condition: {
2677
- StringEquals: {
2678
- 'iam:PassedToService': [
2679
- 'appconfig.amazonaws.com',
2680
- 'ec2.amazonaws.com',
2681
- 'ecs-tasks.amazonaws.com',
2682
- 'lambda.amazonaws.com',
2683
- 'states.amazonaws.com',
2684
- ].sort(compareStrings),
2685
- },
2686
- },
2687
- Effect: 'Allow',
2688
- Resource: [options.identity.workloadRoleArnPattern],
2689
- Sid: 'PassOnlyStageWorkloadRoles',
2690
- }),
2691
- statement({
2692
- Action: ['iam:PassRole'],
2693
- Condition: {
2694
- StringNotEquals: {
2695
- 'iam:PassedToService': 'ec2.amazonaws.com',
2696
- },
2697
- },
2698
- Effect: 'Deny',
2699
- Resource: foundationNatWorkloadRoleResources,
2700
- Sid: 'DenyFoundationNatRolePassOutsideEc2',
2701
- }),
2702
- statement({
2703
- Action: PRIVILEGE_CONSTRUCTION_ACTIONS,
2704
- Effect: 'Deny',
2705
- Resource: ['*'],
2706
- Sid: 'DenyAccountAndPrivilegeAdministration',
2707
- }),
2708
- // A bound stage's Foundation creates and deletes one Regional API Gateway
2709
- // custom domain (`api.<root>`). The service reference lists
2710
- // AddCertificateToDomain as an authorized action of CreateDomainName and
2711
- // RemoveCertificateFromDomain as one of DeleteDomainName, and marks both
2712
- // permission management because they also govern mutual TLS. Bound renders
2713
- // therefore move them out of the unconditional deny and deny them whenever
2714
- // the request or the domain carries a mutual-TLS truststore, so only the
2715
- // non-mTLS case is admitted (by the Regional apigateway:* lifecycle grant).
2716
- // Unbound renders keep the unconditional deny. The domain-name policy
2717
- // actions (apigateway:Update*Policy) stay denied in every render.
2718
- statement({
2719
- Action: options.publicHostedZoneId
2720
- ? RESOURCE_POLICY_AND_TRUST_EXPANSION_ACTIONS.filter((action) => action !== 'apigateway:*Certificate*Domain')
2721
- : RESOURCE_POLICY_AND_TRUST_EXPANSION_ACTIONS,
2722
- Effect: 'Deny',
2723
- Resource: ['*'],
2724
- Sid: 'DenyUnreviewableResourcePolicyAndTrustExpansion',
2725
- }),
2726
- ...(options.publicHostedZoneId
2727
- ? [
2728
- statement({
2729
- Action: [
2730
- 'apigateway:AddCertificateToDomain',
2731
- 'apigateway:RemoveCertificateFromDomain',
2732
- ],
2733
- Condition: {
2734
- Null: { 'apigateway:Request/MtlsTrustStoreUri': 'false' },
2735
- },
2736
- Effect: 'Deny',
2737
- Resource: ['*'],
2738
- Sid: 'DenyMutualTlsDomainCertificateRequest',
2739
- }),
2740
- statement({
2741
- Action: [
2742
- 'apigateway:AddCertificateToDomain',
2743
- 'apigateway:RemoveCertificateFromDomain',
2744
- ],
2745
- Condition: {
2746
- Null: { 'apigateway:Resource/MtlsTrustStoreUri': 'false' },
2747
- },
2748
- Effect: 'Deny',
2749
- Resource: ['*'],
2750
- Sid: 'DenyMutualTlsDomainCertificateResource',
2751
- }),
2752
- ]
2753
- : []),
2754
- statement({
2755
- Action: exports.STAGE_AUTHORITY_UNSUPPORTED_REPLICATION_AND_TOPOLOGY_ACTIONS,
2756
- Effect: 'Deny',
2757
- Resource: ['*'],
2758
- Sid: 'DenyUnsupportedReplicationAndTopology',
2759
- }),
2760
- statement({
2761
- Action: [
2762
- 'servicediscovery:CreateHttpNamespace',
2763
- 'servicediscovery:CreatePublicDnsNamespace',
2764
- ],
2765
- Effect: 'Deny',
2766
- Resource: ['*'],
2767
- Sid: 'DenyNonPrivateServiceDiscoveryNamespaces',
2768
- }),
2769
- statement({
2770
- Action: exports.STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS,
2771
- Effect: 'Deny',
2772
- NotResource: stageAndSharedSstBucketResources,
2773
- Sid: 'DenyBucketPolicyMutationOutsideStageAndSstBootstrap',
2774
- }),
2775
- statement({
2776
- Action: ['lambda:AddPermission'],
2777
- Condition: {
2778
- StringNotEquals: {
2779
- 'lambda:Principal': REVIEWED_LAMBDA_PERMISSION_PRINCIPALS,
2780
- },
2781
- },
2782
- Effect: 'Deny',
2783
- Resource: stageLambdaResources,
2784
- Sid: 'DenyUnreviewedLambdaIntegrationPrincipal',
2785
- }),
2786
- statement({
2787
- Action: ['budgets:UntagResource'],
2788
- Condition: {
2789
- 'ForAnyValue:StringEquals': {
2790
- 'aws:TagKeys': 'ebk:stage',
2791
- },
2792
- },
2793
- Effect: 'Deny',
2794
- Resource: stageAccountBudgetResources,
2795
- Sid: 'DenyStageAccountBudgetStageTagRemoval',
2796
- }),
2797
- statement({
2798
- Action: IAM_AUTHORITY_MUTATION_ACTIONS,
2799
- Effect: 'Deny',
2800
- Resource: [
2801
- options.identity.boundaryArn,
2802
- ...options.identity.deploymentPolicyArns,
2803
- options.identity.deploymentRoleArn,
2804
- ],
2805
- Sid: 'DenyStageAuthorityMutation',
2806
- }),
2807
- statement({
2808
- Action: ['iam:DeleteRolePermissionsBoundary'],
2809
- Effect: 'Deny',
2810
- Resource: [options.identity.workloadRoleArnPattern],
2811
- Sid: 'DenyRuntimeBoundaryRemoval',
2812
- }),
2813
- statement({
2814
- Action: ['iam:UpdateAssumeRolePolicy'],
2815
- Effect: 'Deny',
2816
- Resource: [options.identity.workloadRoleArnPattern],
2817
- Sid: 'DenyRuntimeTrustPolicyMutation',
2818
- }),
2819
- statement({
2820
- Action: ['iam:PutRolePermissionsBoundary'],
2821
- Condition: {
2822
- ArnNotEquals: {
2823
- 'iam:PermissionsBoundary': options.identity.boundaryArn,
2824
- },
2825
- },
2826
- Effect: 'Deny',
2827
- Resource: [options.identity.workloadRoleArnPattern],
2828
- Sid: 'DenyRuntimeBoundarySubstitution',
2829
- }),
2830
- statement({
2831
- Action: exports.STAGE_AUTHORITY_WORKLOAD_IDENTITY_POLICY_ACTIONS,
2832
- Condition: {
2833
- ArnNotEquals: {
2834
- 'iam:PermissionsBoundary': options.identity.boundaryArn,
2835
- },
2836
- },
2837
- Effect: 'Deny',
2838
- Resource: [options.identity.workloadRoleArnPattern],
2839
- Sid: 'DenyUnboundedStageWorkloadIdentityPolicyMutation',
2840
- }),
2841
- statement({
2842
- Action: ['iam:AttachRolePolicy'],
2843
- Condition: {
2844
- ArnNotEquals: { 'iam:PolicyARN': managedPolicies },
2845
- },
2846
- Effect: 'Deny',
2847
- Resource: [options.identity.workloadRoleArnPattern],
2848
- Sid: 'DenyUnapprovedManagedPolicyAttachment',
2849
- }),
2850
- statement({
2851
- Action: ['acm:*'],
2852
- Condition: {
2853
- StringNotEquals: {
2854
- 'aws:RequestedRegion': [options.region, edgeRegion],
2855
- },
2856
- },
2857
- Effect: 'Deny',
2858
- Resource: ['*'],
2859
- Sid: 'DenyAcmMutationOutsideStageAndEdgeRegions',
2860
- }),
2861
- statement({
2862
- Action: [
2863
- ...exports.STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS,
2864
- 's3:CreateBucket',
2865
- ],
2866
- Condition: {
2867
- StringNotEquals: { 'aws:RequestedRegion': options.region },
2868
- },
2869
- Effect: 'Deny',
2870
- Resource: ['*'],
2871
- Sid: 'DenyS3MutationOutsideStageRegion',
2872
- }),
2873
- statement({
2874
- Action: [
2875
- ...exports.STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS,
2876
- ...exports.STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS,
2877
- ...exports.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS,
2878
- ...exports.STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS,
2879
- ...exports.STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS,
2880
- ...exports.STAGE_AUTHORITY_WAF_LOGGING_ACTIONS,
2881
- ],
2882
- Condition: {
2883
- StringNotEquals: { 'aws:RequestedRegion': edgeRegion },
2884
- },
2885
- Effect: 'Deny',
2886
- Resource: ['*'],
2887
- Sid: 'DenyEdgeControlMutationOutsideEdgeRegion',
2888
- }),
2889
- statement({
2890
- Action: [
2891
- ...exports.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES.filter((family) => family !== 'cloudformation:*'),
2892
- ...exports.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS,
2893
- ],
2894
- Condition: {
2895
- StringNotEquals: { 'aws:RequestedRegion': options.region },
2896
- },
2897
- Effect: 'Deny',
2898
- Resource: ['*'],
2899
- Sid: 'DenyMutationOutsideStageRegion',
2900
- }),
2901
- statement({
2902
- Action: exports.STAGE_AUTHORITY_LOGS_MUTATION_FAMILIES,
2903
- Condition: {
2904
- StringNotEquals: {
2905
- 'aws:RequestedRegion': [options.region, edgeRegion],
2906
- },
2907
- },
2908
- Effect: 'Deny',
2909
- Resource: ['*'],
2910
- Sid: 'DenyLogsMutationOutsideStageAndEdgeRegions',
2911
- }),
2912
- // When the application and CloudFront edge control planes share a Region,
2913
- // RequestedRegion cannot distinguish their log groups. In that case admit
2914
- // only the generated application and API execution-log namespaces so both
2915
- // create-time and existing-resource lifecycle calls remain bounded.
2916
- statement({
2917
- Action: exports.STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS,
2918
- Condition: {
2919
- StringEquals: { 'aws:RequestedRegion': edgeRegion },
2920
- },
2921
- Effect: 'Deny',
2922
- NotResource: generatedEdgeLogGroupMutationResources,
2923
- Sid: 'DenyEdgeLogGroupMutationOutsideGeneratedStageLogs',
2924
- }),
2925
- statement({
2926
- Action: exports.STAGE_AUTHORITY_CROSS_ACCOUNT_MUTATION_ACTIONS,
2927
- Condition: {
2928
- Null: { 'aws:ResourceAccount': 'false' },
2929
- StringNotEquals: { 'aws:ResourceAccount': options.accountId },
2930
- },
2931
- Effect: 'Deny',
2932
- Resource: ['*'],
2933
- Sid: 'DenyCrossAccountMutationWhenResourceAccountIsKnown',
2934
- }),
2935
- statement({
2936
- Action: ['ec2:RunInstances'],
2937
- Condition: {
2938
- Null: { 'aws:ResourceAccount': 'false' },
2939
- StringNotEquals: { 'aws:ResourceAccount': options.accountId },
2940
- },
2941
- Effect: 'Deny',
2942
- NotResource: runInstancesExternalReferenceResources,
2943
- Sid: 'DenyCrossAccountRunInstancesTargets',
2944
- }),
2945
- statement({
2946
- Action: ['ec2:RunInstances'],
2947
- Condition: {
2948
- StringNotEquals: {
2949
- 'ec2:Owner': runInstancesApprovedReferenceOwners,
2950
- },
2951
- },
2952
- Effect: 'Deny',
2953
- Resource: runInstancesExternalReferenceResources,
2954
- Sid: 'DenyRunInstancesFromUnapprovedReferenceOwners',
2955
- }),
2956
- statement({
2957
- Action: exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS,
2958
- Condition: {
2959
- Null: { 'aws:ResourceTag/ebk:stage': 'false' },
2960
- StringNotEquals: { 'aws:ResourceTag/ebk:stage': options.stage },
2961
- },
2962
- Effect: 'Deny',
2963
- Resource: ['*'],
2964
- Sid: 'DenyKnownOtherStageResourceMutation',
2965
- }),
2966
- statement({
2967
- Action: options.publicHostedZoneId
2968
- ? exports.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS.filter((action) => action !== 'cloudfront:UpdateDistribution')
2969
- : exports.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS,
2970
- Condition: {
2971
- Null: { 'aws:ResourceTag/ebk:stage': 'true' },
2972
- },
2973
- Effect: 'Deny',
2974
- NotResource: stageAndSharedMutationResources,
2975
- Sid: 'DenyUntaggedMutationOutsideStageAndSstResources',
2976
- }),
2977
- // Bound renders only: cloudfront:UpdateDistribution leaves the statement
2978
- // above, and an update of an untagged distribution ARN is denied here, in
2979
- // any account, whatever the account key, unless the last service in the
2980
- // request's chain is Cognito. aws:CalledViaLast is absent for a direct
2981
- // call; for a forwarded call it names the last forwarding service or is
2982
- // absent. A negated operator is true when its key is absent, so this deny
2983
- // applies unless the key names Cognito. Cognito configures the AWS-owned
2984
- // distribution behind auth.<root> with a forwarded UpdateDistribution under
2985
- // this role's identity, on an ARN that carries this account (observed live,
2986
- // 2026-11-08); that call is let through to the other denies. Every other
2987
- // forwarding chain the role could drive (a CloudFormation stack, Cloud
2988
- // Control, including the disable that precedes a Cloud Control delete, an
2989
- // API Gateway edge domain, an AWS MCP server) stays denied by this one
2990
- // condition. What this admits beyond Cognito's own domains: a forwarded
2991
- // update from Cognito on any untagged pool of this account and Region or
2992
- // from a Cognito domain in a stage-tagged stack, and, in theory, another
2993
- // account's untagged distribution when CloudFront omits the account key.
2994
- // What it does not bind: tagging an untagged distribution with this stage's
2995
- // tag and then updating it directly (cloudfront:TagResource is a separate
2996
- // grant). No NotResource list is needed: no shared stage resource is a
2997
- // distribution.
2998
- ...(options.publicHostedZoneId
2999
- ? [
3000
- statement({
3001
- Action: ['cloudfront:UpdateDistribution'],
3002
- Condition: {
3003
- Null: { 'aws:ResourceTag/ebk:stage': 'true' },
3004
- StringNotEquals: {
3005
- 'aws:CalledViaLast': 'cognito-idp.amazonaws.com',
3006
- },
3007
- },
3008
- Effect: 'Deny',
3009
- Resource: [`arn:${options.partition}:cloudfront::*:distribution/*`],
3010
- Sid: 'DenyUntaggedStageAccountDistributionUpdate',
3011
- }),
3012
- ]
3013
- : []),
3014
- statement({
3015
- Action: ['*'],
3016
- Condition: {
3017
- Null: { 'aws:RequestTag/ebk:stage': 'false' },
3018
- StringNotEquals: { 'aws:RequestTag/ebk:stage': options.stage },
3019
- },
3020
- Effect: 'Deny',
3021
- Resource: ['*'],
3022
- Sid: 'DenyExplicitOtherStageRequestTag',
3023
- }),
22
+ ...(0, deployment_services_js_1.deploymentServiceStatements)(options, resources),
23
+ ...(0, deployment_guardrails_js_1.deploymentGuardrails)(options, resources),
3024
24
  ];
3025
- if (options.stage !== 'production') {
3026
- statements.push(statement({
3027
- Action: ['kms:ScheduleKeyDeletion'],
3028
- Condition: {
3029
- StringEquals: {
3030
- 'aws:RequestedRegion': options.region,
3031
- 'aws:ResourceTag/ebk:management': 'standard-data-export',
3032
- 'aws:ResourceTag/ebk:stage': options.stage,
3033
- },
3034
- },
3035
- Effect: 'Allow',
3036
- Resource: stageKmsKeyResources,
3037
- Sid: 'RetireOnlyTaggedNonProductionKmsKeys',
3038
- }), statement({
3039
- Action: exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS,
3040
- Condition: {
3041
- StringEquals: { 'aws:ResourceTag/ebk:stage': 'production' },
3042
- },
3043
- Effect: 'Deny',
3044
- Resource: ['*'],
3045
- Sid: 'DenyNonProductionAccessToProductionTaggedResources',
3046
- }), statement({
3047
- Action: exports.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS,
3048
- Effect: 'Deny',
3049
- Resource: namedProductionResources,
3050
- Sid: 'DenyNonProductionAccessToNamedProductionResources',
3051
- }), statement({
3052
- Action: exports.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS,
3053
- Effect: 'Deny',
3054
- Resource: ['*'],
3055
- Sid: 'DenyNonProductionDatabaseEventSubscriptionSourceMutation',
3056
- }));
3057
- }
3058
- if (options.stage === 'production') {
3059
- statements.push(statement({
3060
- Action: ['kms:ScheduleKeyDeletion'],
3061
- Effect: 'Deny',
3062
- Resource: stageKmsKeyResources,
3063
- Sid: 'DenyProtectedProductionKmsKeyDeletion',
3064
- }), statement({
3065
- Action: ['kms:DeleteAlias'],
3066
- Effect: 'Deny',
3067
- Resource: productionDataExportAliasResources,
3068
- Sid: 'DenyProtectedProductionDataExportAliasDeletion',
3069
- }), statement({
3070
- Action: [
3071
- 's3:DeleteBucket',
3072
- 's3:DeleteBucketPolicy',
3073
- 's3:DeleteObject',
3074
- 's3:DeleteObjectVersion',
3075
- ],
3076
- Effect: 'Deny',
3077
- Resource: productionDataExportBucketResources,
3078
- Sid: 'DenyProtectedProductionDataExportDeletion',
3079
- }), statement({
3080
- Action: exports.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS,
3081
- Condition: {
3082
- StringEquals: {
3083
- 'aws:RequestedRegion': options.region,
3084
- 'aws:ResourceTag/ebk:stage': 'production',
3085
- },
3086
- },
3087
- Effect: 'Allow',
3088
- Resource: productionEventSubscriptionResources,
3089
- Sid: 'MutateOnlyProductionDatabaseEventSubscriptionSources',
3090
- }), statement({
3091
- Action: exports.STAGE_AUTHORITY_COST_ANOMALY_READ_ACTIONS,
3092
- Condition: {
3093
- StringLike: {
3094
- 'aws:ResourceTag/ebk:cost-scope': productionCostScope,
3095
- },
3096
- },
3097
- Effect: 'Allow',
3098
- Resource: costAnomalyResources,
3099
- Sid: 'ReadProductionCostAnomalyControl',
3100
- }), statement({
3101
- Action: exports.STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS,
3102
- Condition: {
3103
- StringEquals: {
3104
- 'aws:RequestTag/ebk:stage': options.stage,
3105
- },
3106
- StringLike: {
3107
- 'aws:RequestTag/ebk:cost-scope': productionCostScope,
3108
- },
3109
- },
3110
- Effect: 'Allow',
3111
- Resource: ['*'],
3112
- Sid: 'CreateProductionCostAnomalyControl',
3113
- }), statement({
3114
- Action: exports.STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS,
3115
- Condition: {
3116
- StringLike: {
3117
- 'aws:ResourceTag/ebk:cost-scope': productionCostScope,
3118
- },
3119
- },
3120
- Effect: 'Allow',
3121
- Resource: costAnomalyResources,
3122
- Sid: 'MutateProductionCostAnomalyControl',
3123
- }), statement({
3124
- Action: ['ce:TagResource'],
3125
- Condition: {
3126
- Null: { 'aws:RequestTag/ebk:cost-scope': 'false' },
3127
- StringNotLike: {
3128
- 'aws:RequestTag/ebk:cost-scope': productionCostScope,
3129
- },
3130
- },
3131
- Effect: 'Deny',
3132
- Resource: costAnomalyResources,
3133
- Sid: 'DenyProductionCostScopeSubstitution',
3134
- }), statement({
3135
- Action: ['ce:UntagResource'],
3136
- Condition: {
3137
- 'ForAnyValue:StringEquals': {
3138
- 'aws:TagKeys': 'ebk:cost-scope',
3139
- },
3140
- },
3141
- Effect: 'Deny',
3142
- Resource: costAnomalyResources,
3143
- Sid: 'DenyProductionCostScopeRemoval',
3144
- }), statement({
3145
- Action: [
3146
- 'backup:DeleteRecoveryPoint',
3147
- 'rds:DeleteDBCluster',
3148
- 'rds:DeleteDBClusterAutomatedBackup',
3149
- 'rds:DeleteDBInstance',
3150
- 'rds:DeleteDBSnapshot',
3151
- ],
3152
- Effect: 'Deny',
3153
- Resource: productionDatabaseResources,
3154
- Sid: 'DenyProtectedProductionDatabaseDeletion',
3155
- }), statement({
3156
- Action: [
3157
- 'backup:DeleteBackupPlan',
3158
- 'backup:DeleteBackupSelection',
3159
- 'backup:DeleteBackupVault',
3160
- 'backup:DeleteRecoveryPoint',
3161
- ],
3162
- Effect: 'Deny',
3163
- Resource: productionRetentionResources,
3164
- Sid: 'DenyProtectedProductionRetentionDeletion',
3165
- }));
3166
- }
3167
- if (options.stage === 'development') {
3168
- admitDevelopmentTaskNamespaces(statements);
3169
- const privilege = statements.find(({ Sid }) => Sid === 'DenyAccountAndPrivilegeAdministration');
3170
- if (!privilege?.Action)
3171
- throw new Error('Deployment privilege guard is missing.');
3172
- privilege.Action = privilege.Action.filter((action) => action !== 'sts:AssumeRole');
3173
- // Native SST EnvFor assumes the SSR dev-server role, not the deployment
3174
- // identity, for local application code. Preserve every other assumption
3175
- // deny, protected-stage policy, created-role boundary and trust control.
3176
- // Native physical names can truncate even the component suffix for long
3177
- // valid Slice names. Bind purpose by a generated role tag, not that suffix.
3178
- const nativeWebRoles = [options.identity.workloadRoleArnPattern];
3179
- statements.push(...Object.entries({
3180
- Region: ['aws:RequestedRegion', options.region],
3181
- Session: ['sts:RoleSessionName', 'sst-dev'],
3182
- Purpose: ['aws:ResourceTag/ebk:dev-runtime', 'web'],
3183
- }).map(([label, [key, value]]) => statement({
3184
- Sid: `DenyDevAssume${label}`,
3185
- Effect: 'Deny',
3186
- Action: ['sts:AssumeRole'],
3187
- Resource: nativeWebRoles,
3188
- // Negated conditions also deny a missing key. Separate statements
3189
- // encode OR: any invalid attribute blocks an unrelated attached Allow.
3190
- Condition: { StringNotEquals: { [key]: value } },
3191
- })), statement({
3192
- Sid: 'DenyDevAssumeStage',
3193
- Effect: 'Deny',
3194
- Action: ['sts:AssumeRole'],
3195
- Resource: nativeWebRoles,
3196
- Condition: {
3197
- StringNotLike: {
3198
- 'aws:ResourceTag/ebk:stage': ['development', TASK_STAGE_IAM_SHAPE],
3199
- },
3200
- },
3201
- }), statement({
3202
- Sid: 'AssumeNativeDevelopmentWebRuntime',
3203
- Effect: 'Allow',
3204
- Action: ['sts:AssumeRole'],
3205
- Resource: nativeWebRoles,
3206
- Condition: {
3207
- StringEquals: {
3208
- 'aws:RequestedRegion': options.region,
3209
- 'sts:RoleSessionName': 'sst-dev',
3210
- 'aws:ResourceTag/ebk:dev-runtime': 'web',
3211
- },
3212
- StringLike: {
3213
- 'aws:ResourceTag/ebk:stage': ['development', TASK_STAGE_IAM_SHAPE],
3214
- },
3215
- },
3216
- }), statement({
3217
- Sid: 'DenyAssumptionOutsideNativeDevelopmentWebRuntime',
3218
- Effect: 'Deny',
3219
- Action: ['sts:AssumeRole'],
3220
- NotResource: nativeWebRoles,
3221
- }));
3222
- statements.push(...nativeDevelopmentTransportStatements({
3223
- accountId: options.accountId,
3224
- partition: options.partition,
3225
- region: options.region,
3226
- initialize: true,
3227
- }));
3228
- }
3229
- let groups = [
3230
- {
3231
- kind: 'read',
3232
- logicalId: 'StageDeploymentReadPolicy',
3233
- sids: [
3234
- 'DenyGeneratedDatabaseValueAccessWithWrongStageTag',
3235
- 'DenyNonPrivateServiceDiscoveryNamespaces',
3236
- 'DenyRuntimeBoundaryRemoval',
3237
- 'DenySecretsManagerBatchValueReads',
3238
- 'DenySecretValueAccessOutsideGeneratedFoundationDatabase',
3239
- 'DenySsmHistoryAndRecursiveValueReads',
3240
- 'DenyWorkflowExecutionReadOutsideAccount',
3241
- 'DenyUnapprovedSsmValueReads',
3242
- 'CreateOnlyAwsResourceKmsGrants',
3243
- 'ManageOnlyGeneratedEdgeWafLogGroup',
3244
- 'PutOnlyStageRouterWafLogging',
3245
- 'ReadFixedGlobalServiceFamilies',
3246
- 'ReadFixedRegionalServiceFamilies',
3247
- ...(options.stage === 'development'
3248
- ? [
3249
- 'InitializeNativeDevelopmentTransport',
3250
- 'ConnectNativeDevelopmentTransport',
3251
- 'UseNativeDevelopmentNamespace',
3252
- ]
3253
- : []),
3254
- 'DenyWorkflowExecutionReadWithoutStageTag',
3255
- 'DescribeOnlyTaggedStageWorkflowExecutions',
3256
- ...(options.stage === 'production'
3257
- ? ['ReadProductionCostAnomalyControl']
3258
- : []),
3259
- ],
3260
- },
3261
- {
3262
- kind: 'regional-mutation',
3263
- logicalId: 'StageDeploymentRegionalMutationPolicy',
3264
- sids: [
3265
- 'CreateBucketOnlyInStageRegion',
3266
- 'DenyAcmMutationOutsideStageAndEdgeRegions',
3267
- 'DenyEdgeControlMutationOutsideEdgeRegion',
3268
- 'DenyMutationOutsideStageRegion',
3269
- 'DenyS3MutationOutsideStageRegion',
3270
- 'DenySecretMetadataUpdateOutsideStageContainers',
3271
- 'DenyUnscopedWorkflowExecutionMutation',
3272
- 'InvokeOnlyStageLambdaFunctions',
3273
- 'MutateEdgeCertificates',
3274
- 'MutateFixedRegionalServiceFamilies',
3275
- 'MutateStageBucketsInStageRegion',
3276
- ],
3277
- },
3278
- {
3279
- kind: 'global-iam-mutation',
3280
- logicalId: 'StageDeploymentGlobalIamMutationPolicy',
3281
- sids: [
3282
- 'AddOnlyReviewedStageLambdaIntegrations',
3283
- 'ApplyExactStageRuntimeBoundary',
3284
- 'AttachOnlyPinnedAwsRuntimePolicies',
3285
- 'CreateOnlyBoundaryConstrainedStageWorkloadRoles',
3286
- 'DenyFoundationNatRolePassOutsideEc2',
3287
- 'DenyQueueAttributeMutationOutsideStage',
3288
- 'DenyStageAuthorityMutation',
3289
- 'DenyTopicAttributeMutationOutsideStage',
3290
- 'DenyUnscopedLambdaPermissions',
3291
- 'ManageStageWorkloadIdentities',
3292
- ...(options.stage === 'development'
3293
- ? ['AssumeNativeDevelopmentWebRuntime']
3294
- : []),
3295
- 'PassOnlyStageWorkloadRoles',
3296
- 'RemoveOnlyStageLambdaIntegrations',
3297
- 'SetOnlyStageQueueAttributes',
3298
- 'SetOnlyStageTopicAttributes',
3299
- ],
3300
- },
3301
- {
3302
- kind: 'global-resource-mutation',
3303
- logicalId: 'StageDeploymentGlobalResourceMutationPolicy',
3304
- sids: [
3305
- 'DenyCrossAccountMutationWhenResourceAccountIsKnown',
3306
- ...(options.stage === 'development'
3307
- ? ['DenyRuntimeTrustPolicyMutation']
3308
- : []),
3309
- ...(options.stage === 'development'
3310
- ? ['ReadEdgeCertificateControlPlane']
3311
- : []),
3312
- ...(options.stage === 'development'
3313
- ? ['ReadEdgeObservabilityControlPlane']
3314
- : []),
3315
- 'DenyCrossAccountRunInstancesTargets',
3316
- 'DenyLogsMutationOutsideStageAndEdgeRegions',
3317
- 'DenyRunInstancesFromUnapprovedReferenceOwners',
3318
- 'DenyUnsupportedReplicationAndTopology',
3319
- 'LaunchStageInfrastructureFromApprovedReferences',
3320
- 'MutateAccountCloudFront',
3321
- ...(options.publicHostedZoneId
3322
- ? ['UpdateDistributionForBoundIdentityDomain']
3323
- : []),
3324
- 'MutateCloudFrontScopeWafInEdgeRegion',
3325
- 'ManageEdgeWafLogDeliveryControlPlane',
3326
- 'ChangeOnlyCloudMapForwardedNamespaceZones',
3327
- 'CreateOnlyTaggedStageAccountBudget',
3328
- 'DenyStageAccountBudgetStageTagRemoval',
3329
- 'MutateOnlyTaggedStageAccountBudget',
3330
- ],
3331
- },
3332
- {
3333
- kind: 'generated-resource-mutation',
3334
- logicalId: 'StageDeploymentGeneratedResourceMutationPolicy',
3335
- sids: [
3336
- ...(options.stage === 'development'
3337
- ? ['DenyKnownOtherStageResourceMutation']
3338
- : []),
3339
- 'AddOnlyPublicStageLambdaFunctionUrlAccess',
3340
- 'AddOnlyPublicStageLambdaFunctionUrlInvoke',
3341
- 'CreateOnlyRequiredServiceLinkedRoles',
3342
- 'CreateArchiveFromTaggedFoundationEventBus',
3343
- 'CreateNamedFoundationEventArchive',
3344
- 'CreateTaggedMachineAuthorizationStacks',
3345
- 'DenyPublishOutsideGeneratedFoundationAlerts',
3346
- 'EnableRotationOnStageKmsKeys',
3347
- 'InvalidateOnlyStageCloudFrontDistributions',
3348
- 'MutateNamedFoundationEventArchive',
3349
- 'MutateTaggedMachineAuthorizationStacks',
3350
- 'DenyOwnerMutation',
3351
- ...(options.stage !== 'production'
3352
- ? ['RetireOnlyTaggedNonProductionKmsKeys']
3353
- : []),
3354
- 'DenyUntaggedWorkflowExecutionStart',
3355
- 'StartOnlyTaggedStageWorkflowExecutions',
3356
- ...(options.stage === 'production'
3357
- ? [
3358
- 'CreateProductionCostAnomalyControl',
3359
- 'DenyProductionCostScopeRemoval',
3360
- 'DenyProductionCostScopeSubstitution',
3361
- 'MutateOnlyProductionDatabaseEventSubscriptionSources',
3362
- 'MutateProductionCostAnomalyControl',
3363
- ]
3364
- : []),
3365
- ],
3366
- },
3367
- {
3368
- kind: 'stage-containment',
3369
- logicalId: 'StageDeploymentStageContainmentPolicy',
3370
- sids: [
3371
- ...(options.publicHostedZoneId
3372
- ? ['ChangeOnlyBoundPublicZoneAliasRecords']
3373
- : []),
3374
- 'CreateOnlyGeneratedCloudFrontResources',
3375
- 'DenyBucketPolicyMutationOutsideStageAndSstBootstrap',
3376
- 'DenyEventArchiveMutationOutsideGeneratedFoundationArchive',
3377
- 'DenyExplicitOtherStageRequestTag',
3378
- ...(options.stage === 'development'
3379
- ? []
3380
- : ['DenyKnownOtherStageResourceMutation']),
3381
- ...(options.stage !== 'production'
3382
- ? ['DenyNonProductionDatabaseEventSubscriptionSourceMutation']
3383
- : []),
3384
- ...(options.stage === 'development'
3385
- ? []
3386
- : ['DenyRuntimeTrustPolicyMutation']),
3387
- 'DenyUnscopedDatabaseEventSubscriptionSourceMutation',
3388
- 'DenyUntaggedMutationOutsideStageAndSstResources',
3389
- ...(options.publicHostedZoneId
3390
- ? ['DenyUntaggedStageAccountDistributionUpdate']
3391
- : []),
3392
- ],
3393
- },
3394
- {
3395
- kind: 'permission-guardrails',
3396
- logicalId: 'StageDeploymentPermissionGuardrailsPolicy',
3397
- sids: [
3398
- 'DenyNonDeploymentControlOperations',
3399
- 'DenyUnboundedStageWorkloadIdentityPolicyMutation',
3400
- 'DenyUnsupportedWorkflowExecutionMutation',
3401
- 'DenyUnreviewableResourcePolicyAndTrustExpansion',
3402
- ],
3403
- },
3404
- {
3405
- kind: 'guardrails',
3406
- logicalId: 'StageDeploymentGuardrailsPolicy',
3407
- sids: [
3408
- ...statements
3409
- .filter((entry) => entry.Sid.startsWith('Deny') &&
3410
- ![
3411
- 'DenyCrossAccountMutationWhenResourceAccountIsKnown',
3412
- 'DenyCrossAccountRunInstancesTargets',
3413
- 'DenyEdgeControlMutationOutsideEdgeRegion',
3414
- 'DenyAcmMutationOutsideStageAndEdgeRegions',
3415
- 'DenyBucketPolicyMutationOutsideStageAndSstBootstrap',
3416
- 'DenyEventArchiveMutationOutsideGeneratedFoundationArchive',
3417
- 'DenyExplicitOtherStageRequestTag',
3418
- 'DenyFoundationNatRolePassOutsideEc2',
3419
- 'DenyGeneratedDatabaseValueAccessWithWrongStageTag',
3420
- 'DenyKnownOtherStageResourceMutation',
3421
- 'DenyLogsMutationOutsideStageAndEdgeRegions',
3422
- 'DenyMutationOutsideStageRegion',
3423
- 'DenyNonDeploymentControlOperations',
3424
- 'DenyNonPrivateServiceDiscoveryNamespaces',
3425
- 'DenyOwnerMutation',
3426
- 'DenyNonProductionDatabaseEventSubscriptionSourceMutation',
3427
- 'DenyProductionCostScopeRemoval',
3428
- 'DenyProductionCostScopeSubstitution',
3429
- 'DenyPublishOutsideGeneratedFoundationAlerts',
3430
- 'DenyQueueAttributeMutationOutsideStage',
3431
- 'DenyRuntimeBoundaryRemoval',
3432
- 'DenyRuntimeTrustPolicyMutation',
3433
- 'DenySecretsManagerBatchValueReads',
3434
- 'DenySecretMetadataUpdateOutsideStageContainers',
3435
- 'DenySecretValueAccessOutsideGeneratedFoundationDatabase',
3436
- 'DenySsmHistoryAndRecursiveValueReads',
3437
- 'DenyStageAccountBudgetStageTagRemoval',
3438
- 'DenyStageAuthorityMutation',
3439
- 'DenyTopicAttributeMutationOutsideStage',
3440
- 'DenyUnapprovedSsmValueReads',
3441
- 'DenyUnreviewableResourcePolicyAndTrustExpansion',
3442
- 'DenyUnscopedDatabaseEventSubscriptionSourceMutation',
3443
- 'DenyUnscopedLambdaPermissions',
3444
- 'DenyUnboundedStageWorkloadIdentityPolicyMutation',
3445
- 'DenyUnscopedWorkflowExecutionMutation',
3446
- 'DenyUnsupportedWorkflowExecutionMutation',
3447
- 'DenyUntaggedWorkflowExecutionStart',
3448
- 'DenyUntaggedMutationOutsideStageAndSstResources',
3449
- 'DenyUntaggedStageAccountDistributionUpdate',
3450
- 'DenyWorkflowExecutionReadWithoutStageTag',
3451
- 'DenyWorkflowExecutionReadOutsideAccount',
3452
- 'DenyRunInstancesFromUnapprovedReferenceOwners',
3453
- 'DenyUnsupportedReplicationAndTopology',
3454
- 'DenyS3MutationOutsideStageRegion',
3455
- ].includes(entry.Sid))
3456
- .map((entry) => entry.Sid),
3457
- ...(options.stage === 'development'
3458
- ? []
3459
- : ['ReadEdgeCertificateControlPlane']),
3460
- ...(options.stage === 'development'
3461
- ? []
3462
- : ['ReadEdgeObservabilityControlPlane']),
3463
- ],
3464
- },
3465
- ];
3466
- if (options.stage === 'development') {
3467
- // Co-locate equivalent scopes so rendering can union only their Action
3468
- // sets. Every statement remains in one existing, attached policy.
3469
- const relocation = {
3470
- DenyRuntimeBoundarySubstitution: 'permission-guardrails',
3471
- DenyDevAssumeRegion: 'regional-mutation',
3472
- DenyDevAssumeSession: 'regional-mutation',
3473
- DenyDevAssumePurpose: 'regional-mutation',
3474
- InvokeOnlyStageLambdaFunctions: 'global-iam-mutation',
3475
- DenyLogsMutationOutsideStageAndEdgeRegions: 'regional-mutation',
3476
- DenyRuntimeTrustPolicyMutation: 'read',
3477
- CreateOnlyGeneratedCloudFrontResources: 'global-resource-mutation',
3478
- MutateStageBucketsInStageRegion: 'global-resource-mutation',
3479
- };
3480
- for (const sid of Object.keys(relocation)) {
3481
- if (groups.flatMap((group) => group.sids).filter((value) => value === sid)
3482
- .length !== 1)
3483
- throw new Error(`Task authority compaction requires exactly one ${sid}.`);
3484
- }
3485
- groups = groups.map((group) => ({
3486
- ...group,
3487
- sids: [
3488
- ...group.sids.filter((sid) => !relocation[sid]),
3489
- ...Object.entries(relocation)
3490
- .filter(([, kind]) => kind === group.kind)
3491
- .map(([sid]) => sid),
3492
- ],
3493
- }));
3494
- }
3495
- const assigned = new Set(groups.flatMap((group) => group.sids));
3496
- const assignmentCount = groups.reduce((total, group) => total + group.sids.length, 0);
3497
- const unassigned = statements.filter((entry) => !assigned.has(entry.Sid));
3498
- if (unassigned.length > 0 ||
3499
- assigned.size !== statements.length ||
3500
- assignmentCount !== statements.length) {
3501
- throw new Error(`Stage authority policy groups must assign every statement exactly once; unassigned: ${unassigned.map((entry) => entry.Sid).join(', ') ||
3502
- 'duplicate assignment'}.`);
3503
- }
3504
- return Object.freeze(groups.map((group, index) => {
3505
- const document = policy(statements.filter((entry) => group.sids.includes(entry.Sid)));
3506
- const characters = JSON.stringify(omitPolicyStatementSids(document, options.stage === 'development')).length;
3507
- if (characters >
3508
- exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT -
3509
- exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM) {
3510
- throw new Error(`Stage authority ${group.kind} policy has ${characters} characters; it must retain ${exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM} characters below the IAM managed-policy limit of ${exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT}.`);
3511
- }
3512
- const name = options.identity.deploymentPolicyNames[index];
3513
- const arn = options.identity.deploymentPolicyArns[index];
3514
- if (!name || !arn) {
3515
- throw new Error(`Stage authority ${group.kind} identity is incomplete.`);
3516
- }
3517
- return Object.freeze({
3518
- arn,
3519
- document,
3520
- kind: group.kind,
3521
- logicalId: group.logicalId,
3522
- name,
3523
- });
3524
- }));
25
+ (0, deployment_guardrails_js_1.applyStageGuardrails)(options, resources, statements);
26
+ return (0, deployment_policy_groups_js_1.packageDeploymentPolicies)(options, statements);
3525
27
  }
3526
28
  function canonicalStageAuthorityTemplate(template) {
3527
- return `${JSON.stringify(canonicalize(template))}\n`;
29
+ return `${JSON.stringify((0, policy_document_js_1.canonicalize)(template))}\n`;
3528
30
  }
3529
31
  function digestStageAuthorityTemplate(template) {
3530
32
  return (0, node_crypto_1.createHash)('sha256')
@@ -3533,25 +35,25 @@ function digestStageAuthorityTemplate(template) {
3533
35
  }
3534
36
  function assertBoundStageAuthorityTemplateFitsBodyLimit(template) {
3535
37
  const templateBytes = Buffer.byteLength(canonicalStageAuthorityTemplate(template), 'utf8');
3536
- if (templateBytes > exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT) {
3537
- throw new Error(`Workspace-bound stage authority template has ${templateBytes} bytes; the direct CloudFormation TemplateBody limit is ${exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT}.`);
38
+ if (templateBytes > contracts_js_1.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT) {
39
+ throw new Error(`Workspace-bound stage authority template has ${templateBytes} bytes; the direct CloudFormation TemplateBody limit is ${contracts_js_1.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT}.`);
3538
40
  }
3539
41
  return templateBytes;
3540
42
  }
3541
43
  function createStageAuthorityPlan(input) {
3542
- const target = requireIdentity(input);
3543
- const publicHostedZoneId = requirePublicHostedZone(input, target.partition);
3544
- const identity = createStageAuthorityIdentity(target);
3545
- const assumeRolePolicy = requireTrust(input, target);
3546
- const boundary = runtimeBoundaryPolicy({
44
+ const target = (0, stage_identity_js_1.requireIdentity)(input);
45
+ const publicHostedZoneId = (0, stage_identity_js_1.requirePublicHostedZone)(input, target.partition);
46
+ const identity = (0, stage_identity_js_1.createStageAuthorityIdentity)(target);
47
+ const assumeRolePolicy = (0, stage_identity_js_1.requireTrust)(input, target);
48
+ const boundary = (0, runtime_boundary_js_1.runtimeBoundaryPolicy)({
3547
49
  accountId: target.accountId,
3548
50
  identity,
3549
51
  region: target.region,
3550
52
  stage: target.stage,
3551
53
  });
3552
- const boundaryCharacters = JSON.stringify(omitPolicyStatementSids(boundary, target.stage === 'development')).length;
3553
- if (boundaryCharacters > exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT) {
3554
- throw new Error(`Stage runtime boundary has ${boundaryCharacters} characters; the IAM managed-policy limit is ${exports.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT}.`);
54
+ const boundaryCharacters = JSON.stringify((0, policy_document_js_1.omitPolicyStatementSids)(boundary, target.stage === 'development')).length;
55
+ if (boundaryCharacters > contracts_js_1.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT) {
56
+ throw new Error(`Stage runtime boundary has ${boundaryCharacters} characters; the IAM managed-policy limit is ${contracts_js_1.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT}.`);
3555
57
  }
3556
58
  const deployment = deploymentPolicy({
3557
59
  accountId: target.accountId,
@@ -3562,25 +64,24 @@ function createStageAuthorityPlan(input) {
3562
64
  stage: target.stage,
3563
65
  });
3564
66
  const renderedDeploymentPolicyDocuments = Object.fromEntries(deployment.map((entry) => {
3565
- let document = replaceExactTemplateString(replaceExactTemplateString(omitPolicyStatementSids(entry.document, target.stage === 'development'), identity.boundaryArn, { Ref: 'StageRuntimeBoundary' }), identity.deploymentRoleArn, { 'Fn::GetAtt': ['StageDeploymentRole', 'Arn'] });
67
+ let document = (0, policy_document_js_1.replaceExactTemplateString)((0, policy_document_js_1.replaceExactTemplateString)((0, policy_document_js_1.omitPolicyStatementSids)(entry.document, target.stage === 'development'), identity.boundaryArn, { Ref: 'StageRuntimeBoundary' }), identity.deploymentRoleArn, { 'Fn::GetAtt': ['StageDeploymentRole', 'Arn'] });
3566
68
  if (entry.logicalId === 'StageDeploymentGlobalIamMutationPolicy') {
3567
69
  for (const sibling of deployment) {
3568
70
  if (sibling.logicalId === entry.logicalId)
3569
71
  continue;
3570
- document = replaceExactTemplateString(document, sibling.arn, {
72
+ document = (0, policy_document_js_1.replaceExactTemplateString)(document, sibling.arn, {
3571
73
  Ref: sibling.logicalId,
3572
74
  });
3573
75
  }
3574
76
  }
3575
77
  return [entry.logicalId, document];
3576
78
  }));
3577
- const edgeRegion = edgeControlRegion(target.partition, target.region);
3578
- const templatePolicyDocuments = compactExactTemplatePolicyStrings({
79
+ const edgeRegion = (0, service_actions_js_1.edgeControlRegion)(target.partition, target.region);
80
+ const templatePolicyDocuments = (0, policy_document_js_1.compactExactTemplatePolicyStrings)({
3579
81
  ...renderedDeploymentPolicyDocuments,
3580
- StageRuntimeBoundary: omitPolicyStatementSids(boundary, target.stage === 'development'),
82
+ StageRuntimeBoundary: (0, policy_document_js_1.omitPolicyStatementSids)(boundary, target.stage === 'development'),
3581
83
  }, [
3582
84
  identity.workloadRoleArnPattern,
3583
- `arn:${target.partition}:cloudformation:${target.region}:${target.accountId}:stack/*MachineAuthorization*/*`,
3584
85
  `arn:${target.partition}:events:${target.region}:${target.accountId}:archive/ebk-${target.stage}-foundation-events`,
3585
86
  `arn:${target.partition}:events:${target.region}:${target.accountId}:event-bus/foundation-${target.stage}-FoundationEventBusBus-*`,
3586
87
  `arn:${target.partition}:lambda:${target.region}:${target.accountId}:function:*`,
@@ -3588,7 +89,7 @@ function createStageAuthorityPlan(input) {
3588
89
  `arn:${target.partition}:secretsmanager:${target.region}:${target.accountId}:secret:foundation-${target.stage}-FoundationDatabaseProxySecret-*`,
3589
90
  `arn:${target.partition}:states:${target.region}:${target.accountId}:execution:*:*`,
3590
91
  ...(target.stage === 'development'
3591
- ? repeatedDevelopmentPolicyStrings({
92
+ ? (0, policy_document_js_1.repeatedDevelopmentPolicyStrings)({
3592
93
  ...renderedDeploymentPolicyDocuments,
3593
94
  boundary,
3594
95
  })
@@ -3631,7 +132,7 @@ function createStageAuthorityPlan(input) {
3631
132
  ...deploymentPolicyResources,
3632
133
  StageDeploymentRole: {
3633
134
  Properties: {
3634
- AssumeRolePolicyDocument: omitPolicyStatementSids(assumeRolePolicy),
135
+ AssumeRolePolicyDocument: (0, policy_document_js_1.omitPolicyStatementSids)(assumeRolePolicy),
3635
136
  Description: `Stable Empire Builder Kit ${target.stage} deployment role.`,
3636
137
  MaxSessionDuration: 3_600,
3637
138
  Path: identity.deploymentRolePath,
@@ -3655,10 +156,10 @@ function createStageAuthorityPlan(input) {
3655
156
  },
3656
157
  };
3657
158
  const templateBytes = Buffer.byteLength(canonicalStageAuthorityTemplate(template), 'utf8');
3658
- if (templateBytes > exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT) {
3659
- throw new Error(`Stage authority template has ${templateBytes} bytes; the direct CloudFormation TemplateBody limit is ${exports.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT}.`);
159
+ if (templateBytes > contracts_js_1.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT) {
160
+ throw new Error(`Stage authority template has ${templateBytes} bytes; the direct CloudFormation TemplateBody limit is ${contracts_js_1.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT}.`);
3660
161
  }
3661
- return deepFreeze({
162
+ return (0, policy_document_js_1.deepFreeze)({
3662
163
  deploymentPolicies: deployment,
3663
164
  digest: digestStageAuthorityTemplate(template),
3664
165
  identity,
@@ -3674,80 +175,79 @@ function createStageAuthorityPlan(input) {
3674
175
  workloadTrust: 'iam-cannot-inspect-create-role-trust-reviewed-generated-source-is-control',
3675
176
  }),
3676
177
  runtimeBoundaryPolicy: boundary,
3677
- schemaVersion: exports.STAGE_AUTHORITY_SCHEMA_VERSION,
178
+ schemaVersion: contracts_js_1.STAGE_AUTHORITY_SCHEMA_VERSION,
3678
179
  template,
3679
180
  });
3680
181
  }
3681
- function createStageIamBoundaryTransformContract(input) {
3682
- const identity = createStageAuthorityIdentity({
3683
- ...input,
3684
- region: 'us-east-1',
3685
- });
3686
- return Object.freeze({
3687
- boundaryArn: identity.boundaryArn,
3688
- instanceProfilePath: identity.workloadInstanceProfilePath,
3689
- rolePath: identity.workloadRolePath,
3690
- });
3691
- }
3692
- function requireTransformArgs(value, label) {
3693
- if (!value || typeof value !== 'object' || Array.isArray(value)) {
3694
- throw new Error(`${label} transform arguments must be an object.`);
3695
- }
3696
- return value;
3697
- }
3698
- function refuseSubstitution(existing, expected, label) {
3699
- if (existing !== undefined && existing !== expected) {
3700
- throw new Error(`${label} attempted to substitute stable stage authority.`);
3701
- }
3702
- }
3703
- /**
3704
- * Installs ordinary Pulumi resource transforms before generated SST components
3705
- * are constructed. SST remains responsible for creating its roles and NAT
3706
- * instance profiles; this helper contributes only the stable stage path and
3707
- * permissions boundary.
3708
- */
3709
- function installStageIamBoundaryTransforms(input) {
3710
- if (typeof input.registerTransform !== 'function' ||
3711
- input.roleResource === undefined ||
3712
- input.instanceProfileResource === undefined) {
3713
- throw new Error('Stage IAM boundary transforms require the ordinary Pulumi role and instance-profile resource types.');
3714
- }
3715
- const resourceStage = input.resourceStage ?? input.stage;
3716
- if (resourceStage !== input.stage &&
3717
- !(input.stage === 'development' &&
3718
- /^personal-[a-f0-9]{24}$/u.test(resourceStage))) {
3719
- throw new Error('IAM resource stage must be canonical or the exact development task.');
3720
- }
3721
- const contract = createStageIamBoundaryTransformContract(input);
3722
- input.registerTransform(input.roleResource, (value) => {
3723
- const args = requireTransformArgs(value, 'IAM role');
3724
- let stageTags;
3725
- if (input.stage === 'development') {
3726
- const tags = args.tags;
3727
- if (tags !== undefined &&
3728
- (!tags ||
3729
- typeof tags !== 'object' ||
3730
- Array.isArray(tags) ||
3731
- ![Object.prototype, null].includes(Object.getPrototypeOf(tags)) ||
3732
- Object.values(tags).some((value) => typeof value !== 'string'))) {
3733
- throw new Error('IAM role stage tags must be a literal string record.');
3734
- }
3735
- const literalTags = (tags ?? {});
3736
- refuseSubstitution(literalTags['ebk:stage'], resourceStage, 'IAM role stage tag');
3737
- stageTags = { ...literalTags, 'ebk:stage': resourceStage };
3738
- }
3739
- refuseSubstitution(args.permissionsBoundary, contract.boundaryArn, 'IAM role permissions boundary');
3740
- refuseSubstitution(args.path, contract.rolePath, 'IAM role path');
3741
- if (stageTags)
3742
- args.tags = stageTags;
3743
- args.permissionsBoundary = contract.boundaryArn;
3744
- args.path = contract.rolePath;
3745
- });
3746
- input.registerTransform(input.instanceProfileResource, (value) => {
3747
- const args = requireTransformArgs(value, 'IAM instance profile');
3748
- refuseSubstitution(args.path, contract.instanceProfilePath, 'IAM instance-profile path');
3749
- args.path = contract.instanceProfilePath;
3750
- });
3751
- return contract;
3752
- }
182
+ var boundary_transforms_js_1 = require("./boundary-transforms.js");
183
+ Object.defineProperty(exports, "createStageIamBoundaryTransformContract", { enumerable: true, get: function () { return boundary_transforms_js_1.createStageIamBoundaryTransformContract; } });
184
+ Object.defineProperty(exports, "installStageIamBoundaryTransforms", { enumerable: true, get: function () { return boundary_transforms_js_1.installStageIamBoundaryTransforms; } });
185
+ var contracts_js_2 = require("./contracts.js");
186
+ Object.defineProperty(exports, "STAGE_AUTHORITY_BOUND_TEMPLATE_BODY_MINIMUM_HEADROOM", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_BOUND_TEMPLATE_BODY_MINIMUM_HEADROOM; } });
187
+ Object.defineProperty(exports, "STAGE_AUTHORITY_DEPLOYMENT_POLICY_KINDS", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_DEPLOYMENT_POLICY_KINDS; } });
188
+ Object.defineProperty(exports, "STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_HEADROOM; } });
189
+ Object.defineProperty(exports, "STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_MANAGED_POLICY_CHARACTER_LIMIT; } });
190
+ Object.defineProperty(exports, "STAGE_AUTHORITY_PARTITIONS", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_PARTITIONS; } });
191
+ Object.defineProperty(exports, "STAGE_AUTHORITY_SCHEMA_VERSION", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_SCHEMA_VERSION; } });
192
+ Object.defineProperty(exports, "STAGE_AUTHORITY_STAGES", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_STAGES; } });
193
+ Object.defineProperty(exports, "STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT", { enumerable: true, get: function () { return contracts_js_2.STAGE_AUTHORITY_TEMPLATE_BODY_BYTE_LIMIT; } });
194
+ var guardrail_actions_js_1 = require("./guardrail-actions.js");
195
+ Object.defineProperty(exports, "STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_APPROVED_AWS_MANAGED_POLICIES; } });
196
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_CLOUDCONTROL_EDGE_MUTATION_ACTIONS; } });
197
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CROSS_ACCOUNT_EC2_MUTATION_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_CROSS_ACCOUNT_EC2_MUTATION_ACTIONS; } });
198
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CROSS_ACCOUNT_MUTATION_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_CROSS_ACCOUNT_MUTATION_ACTIONS; } });
199
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CROSS_STAGE_DESTRUCTIVE_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_CROSS_STAGE_DESTRUCTIVE_ACTIONS; } });
200
+ Object.defineProperty(exports, "STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_KNOWN_STAGE_MUTATION_ACTIONS; } });
201
+ Object.defineProperty(exports, "STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_NON_DEPLOYMENT_ACCOUNT_AND_DATA_ACTIONS; } });
202
+ Object.defineProperty(exports, "STAGE_AUTHORITY_REVIEWED_PERMISSION_MANAGEMENT_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_REVIEWED_PERMISSION_MANAGEMENT_ACTIONS; } });
203
+ Object.defineProperty(exports, "STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_S3_BUCKET_POLICY_MUTATION_ACTIONS; } });
204
+ Object.defineProperty(exports, "STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_SCOPE_GUARD_MUTATION_FAMILIES; } });
205
+ Object.defineProperty(exports, "STAGE_AUTHORITY_SERVICE_LINKED_ROLES", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_SERVICE_LINKED_ROLES; } });
206
+ Object.defineProperty(exports, "STAGE_AUTHORITY_SST_417_EXTERNAL_AMI_OWNERS_BY_PARTITION", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_SST_417_EXTERNAL_AMI_OWNERS_BY_PARTITION; } });
207
+ Object.defineProperty(exports, "STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_UNREVIEWED_PERMISSION_MANAGEMENT_ACTION_PATTERNS; } });
208
+ Object.defineProperty(exports, "STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_UNSUPPORTED_WORKFLOW_EXECUTION_ACTIONS; } });
209
+ Object.defineProperty(exports, "STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_UNTAGGED_DESTRUCTIVE_ACTIONS; } });
210
+ Object.defineProperty(exports, "STAGE_AUTHORITY_WORKLOAD_IDENTITY_POLICY_ACTIONS", { enumerable: true, get: function () { return guardrail_actions_js_1.STAGE_AUTHORITY_WORKLOAD_IDENTITY_POLICY_ACTIONS; } });
211
+ var service_actions_js_2 = require("./service-actions.js");
212
+ Object.defineProperty(exports, "STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_ACCOUNT_SCOPED_GLOBAL_WRITE_ACTIONS; } });
213
+ Object.defineProperty(exports, "STAGE_AUTHORITY_BACKUP_INFRASTRUCTURE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_BACKUP_INFRASTRUCTURE_ACTIONS; } });
214
+ Object.defineProperty(exports, "STAGE_AUTHORITY_BROAD_REGIONAL_SERVICE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_BROAD_REGIONAL_SERVICE_ACTIONS; } });
215
+ Object.defineProperty(exports, "STAGE_AUTHORITY_BUDGET_MUTATION_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_BUDGET_MUTATION_ACTIONS; } });
216
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_ACTIONS; } });
217
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_TYPES", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_RECORD_TYPES; } });
218
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_ROUTE53_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_CLOUD_MAP_FORWARDED_ROUTE53_ACTIONS; } });
219
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_CLOUDFORMATION_LIFECYCLE_ACTIONS; } });
220
+ Object.defineProperty(exports, "STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_CLOUDFRONT_INVALIDATION_ACTIONS; } });
221
+ Object.defineProperty(exports, "STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_COST_ANOMALY_CREATE_ACTIONS; } });
222
+ Object.defineProperty(exports, "STAGE_AUTHORITY_COST_ANOMALY_READ_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_COST_ANOMALY_READ_ACTIONS; } });
223
+ Object.defineProperty(exports, "STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_COST_ANOMALY_RESOURCE_WRITE_ACTIONS; } });
224
+ Object.defineProperty(exports, "STAGE_AUTHORITY_COST_ANOMALY_WRITE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_COST_ANOMALY_WRITE_ACTIONS; } });
225
+ Object.defineProperty(exports, "STAGE_AUTHORITY_EC2_INFRASTRUCTURE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_EC2_INFRASTRUCTURE_ACTIONS; } });
226
+ Object.defineProperty(exports, "STAGE_AUTHORITY_EDGE_OBSERVABILITY_READ_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_EDGE_OBSERVABILITY_READ_ACTIONS; } });
227
+ Object.defineProperty(exports, "STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_EDGE_WAF_LOG_DELIVERY_MUTATION_ACTIONS; } });
228
+ Object.defineProperty(exports, "STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_EDGE_WAF_LOG_GROUP_ACTIONS; } });
229
+ Object.defineProperty(exports, "STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_EVENT_ARCHIVE_CREATE_ACTIONS; } });
230
+ Object.defineProperty(exports, "STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_EVENT_ARCHIVE_RESOURCE_ACTIONS; } });
231
+ Object.defineProperty(exports, "STAGE_AUTHORITY_GLOBAL_READ_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_GLOBAL_READ_ACTIONS; } });
232
+ Object.defineProperty(exports, "STAGE_AUTHORITY_KMS_INFRASTRUCTURE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_KMS_INFRASTRUCTURE_ACTIONS; } });
233
+ Object.defineProperty(exports, "STAGE_AUTHORITY_KMS_ROTATION_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_KMS_ROTATION_ACTIONS; } });
234
+ Object.defineProperty(exports, "STAGE_AUTHORITY_LAMBDA_DEPLOYMENT_INVOKE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_LAMBDA_DEPLOYMENT_INVOKE_ACTIONS; } });
235
+ Object.defineProperty(exports, "STAGE_AUTHORITY_LAMBDA_INFRASTRUCTURE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_LAMBDA_INFRASTRUCTURE_ACTIONS; } });
236
+ Object.defineProperty(exports, "STAGE_AUTHORITY_LOGS_MUTATION_FAMILIES", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_LOGS_MUTATION_FAMILIES; } });
237
+ Object.defineProperty(exports, "STAGE_AUTHORITY_PUBLIC_DNS_RECORD_TYPES", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_PUBLIC_DNS_RECORD_TYPES; } });
238
+ Object.defineProperty(exports, "STAGE_AUTHORITY_PUBLIC_HOSTED_ZONE_ID", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_PUBLIC_HOSTED_ZONE_ID; } });
239
+ Object.defineProperty(exports, "STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_RDS_EVENT_SUBSCRIPTION_SOURCE_ACTIONS; } });
240
+ Object.defineProperty(exports, "STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_REGIONAL_MUTATION_FAMILIES; } });
241
+ Object.defineProperty(exports, "STAGE_AUTHORITY_REGIONAL_READ_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_REGIONAL_READ_ACTIONS; } });
242
+ Object.defineProperty(exports, "STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_REGIONAL_WRITE_ACTIONS; } });
243
+ Object.defineProperty(exports, "STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_S3_REGIONAL_MUTATION_ACTIONS; } });
244
+ Object.defineProperty(exports, "STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_UNSCOPED_CLOUDFRONT_CREATE_ACTIONS; } });
245
+ Object.defineProperty(exports, "STAGE_AUTHORITY_UNSUPPORTED_REPLICATION_AND_TOPOLOGY_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_UNSUPPORTED_REPLICATION_AND_TOPOLOGY_ACTIONS; } });
246
+ Object.defineProperty(exports, "STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_WAF_EDGE_MUTATION_ACTIONS; } });
247
+ Object.defineProperty(exports, "STAGE_AUTHORITY_WAF_LOGGING_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_AUTHORITY_WAF_LOGGING_ACTIONS; } });
248
+ Object.defineProperty(exports, "STAGE_RUNTIME_GLOBAL_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_RUNTIME_GLOBAL_ACTIONS; } });
249
+ Object.defineProperty(exports, "STAGE_RUNTIME_REGIONAL_ACTIONS", { enumerable: true, get: function () { return service_actions_js_2.STAGE_RUNTIME_REGIONAL_ACTIONS; } });
250
+ Object.defineProperty(exports, "STAGE_RUNTIME_REGIONAL_SERVICE_FAMILIES", { enumerable: true, get: function () { return service_actions_js_2.STAGE_RUNTIME_REGIONAL_SERVICE_FAMILIES; } });
251
+ var stage_identity_js_2 = require("./stage-identity.js");
252
+ Object.defineProperty(exports, "createStageAuthorityIdentity", { enumerable: true, get: function () { return stage_identity_js_2.createStageAuthorityIdentity; } });
3753
253
  //# sourceMappingURL=stage-authority.js.map