@depup/aws-cdk 2.1117.0-depup.0

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 (308) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +16 -0
  3. package/README.md +25 -0
  4. package/THIRD_PARTY_LICENSES +24866 -0
  5. package/bin/cdk +6 -0
  6. package/build-info.json +4 -0
  7. package/changes.json +5 -0
  8. package/db.json.gz +0 -0
  9. package/docs/deploy-architecture.md +194 -0
  10. package/lib/api/aws-auth.d.ts +3 -0
  11. package/lib/api/aws-auth.js +21 -0
  12. package/lib/api/bootstrap/bootstrap-template.yaml +855 -0
  13. package/lib/api/bootstrap.d.ts +1 -0
  14. package/lib/api/bootstrap.js +19 -0
  15. package/lib/api/cloud-assembly.d.ts +5 -0
  16. package/lib/api/cloud-assembly.js +23 -0
  17. package/lib/api/cloudformation.d.ts +1 -0
  18. package/lib/api/cloudformation.js +19 -0
  19. package/lib/api/context.d.ts +1 -0
  20. package/lib/api/context.js +19 -0
  21. package/lib/api/deployments.d.ts +1 -0
  22. package/lib/api/deployments.js +19 -0
  23. package/lib/api/hotswap.d.ts +1 -0
  24. package/lib/api/hotswap.js +19 -0
  25. package/lib/api/index.d.ts +16 -0
  26. package/lib/api/index.js +38 -0
  27. package/lib/api/network-detector.d.ts +1 -0
  28. package/lib/api/network-detector.js +19 -0
  29. package/lib/api/notices.d.ts +1 -0
  30. package/lib/api/notices.js +19 -0
  31. package/lib/api/plugin.d.ts +1 -0
  32. package/lib/api/plugin.js +19 -0
  33. package/lib/api/refactor.d.ts +1 -0
  34. package/lib/api/refactor.js +8 -0
  35. package/lib/api/settings.d.ts +1 -0
  36. package/lib/api/settings.js +19 -0
  37. package/lib/api/tags.d.ts +1 -0
  38. package/lib/api/tags.js +19 -0
  39. package/lib/api-private.d.ts +9 -0
  40. package/lib/api-private.js +29 -0
  41. package/lib/cli/cdk-toolkit.d.ts +699 -0
  42. package/lib/cli/cdk-toolkit.js +1260 -0
  43. package/lib/cli/ci-systems.d.ts +29 -0
  44. package/lib/cli/ci-systems.js +61 -0
  45. package/lib/cli/cli-config.d.ts +10 -0
  46. package/lib/cli/cli-config.js +556 -0
  47. package/lib/cli/cli-type-registry.json +1147 -0
  48. package/lib/cli/cli.d.ts +3 -0
  49. package/lib/cli/cli.js +746 -0
  50. package/lib/cli/convert-to-user-input.d.ts +3 -0
  51. package/lib/cli/convert-to-user-input.js +560 -0
  52. package/lib/cli/display-version.d.ts +11 -0
  53. package/lib/cli/display-version.js +101 -0
  54. package/lib/cli/io-host/cli-io-host.d.ts +191 -0
  55. package/lib/cli/io-host/cli-io-host.js +477 -0
  56. package/lib/cli/io-host/index.d.ts +1 -0
  57. package/lib/cli/io-host/index.js +18 -0
  58. package/lib/cli/parse-command-line-arguments.d.ts +1 -0
  59. package/lib/cli/parse-command-line-arguments.js +1067 -0
  60. package/lib/cli/platform-warnings.d.ts +3 -0
  61. package/lib/cli/platform-warnings.js +44 -0
  62. package/lib/cli/pretty-print-error.d.ts +1 -0
  63. package/lib/cli/pretty-print-error.js +37 -0
  64. package/lib/cli/proxy-agent.d.ts +30 -0
  65. package/lib/cli/proxy-agent.js +52 -0
  66. package/lib/cli/root-dir.d.ts +10 -0
  67. package/lib/cli/root-dir.js +23 -0
  68. package/lib/cli/singleton-plugin-host.d.ts +7 -0
  69. package/lib/cli/singleton-plugin-host.js +11 -0
  70. package/lib/cli/tables.d.ts +1 -0
  71. package/lib/cli/tables.js +10 -0
  72. package/lib/cli/telemetry/collect-telemetry.d.ts +5 -0
  73. package/lib/cli/telemetry/collect-telemetry.js +16 -0
  74. package/lib/cli/telemetry/error.d.ts +15 -0
  75. package/lib/cli/telemetry/error.js +68 -0
  76. package/lib/cli/telemetry/feature-flags.d.ts +96 -0
  77. package/lib/cli/telemetry/feature-flags.js +103 -0
  78. package/lib/cli/telemetry/installation-id.d.ts +5 -0
  79. package/lib/cli/telemetry/installation-id.js +47 -0
  80. package/lib/cli/telemetry/library-version.d.ts +2 -0
  81. package/lib/cli/telemetry/library-version.js +30 -0
  82. package/lib/cli/telemetry/messages.d.ts +43 -0
  83. package/lib/cli/telemetry/messages.js +60 -0
  84. package/lib/cli/telemetry/sanitation.d.ts +100 -0
  85. package/lib/cli/telemetry/sanitation.js +79 -0
  86. package/lib/cli/telemetry/schema.d.ts +85 -0
  87. package/lib/cli/telemetry/schema.js +3 -0
  88. package/lib/cli/telemetry/session.d.ts +67 -0
  89. package/lib/cli/telemetry/session.js +174 -0
  90. package/lib/cli/telemetry/sink/endpoint-sink.d.ts +44 -0
  91. package/lib/cli/telemetry/sink/endpoint-sink.js +105 -0
  92. package/lib/cli/telemetry/sink/file-sink.d.ts +32 -0
  93. package/lib/cli/telemetry/sink/file-sink.js +43 -0
  94. package/lib/cli/telemetry/sink/funnel.d.ts +16 -0
  95. package/lib/cli/telemetry/sink/funnel.js +29 -0
  96. package/lib/cli/telemetry/sink/io-host-sink.d.ts +27 -0
  97. package/lib/cli/telemetry/sink/io-host-sink.js +35 -0
  98. package/lib/cli/telemetry/sink/sink-interface.d.ts +18 -0
  99. package/lib/cli/telemetry/sink/sink-interface.js +3 -0
  100. package/lib/cli/user-configuration.d.ts +104 -0
  101. package/lib/cli/user-configuration.js +334 -0
  102. package/lib/cli/user-input.d.ts +1505 -0
  103. package/lib/cli/user-input.js +3 -0
  104. package/lib/cli/util/ci.d.ts +5 -0
  105. package/lib/cli/util/ci.js +11 -0
  106. package/lib/cli/util/console-formatters.d.ts +18 -0
  107. package/lib/cli/util/console-formatters.js +42 -0
  108. package/lib/cli/util/guess-agent.d.ts +7 -0
  109. package/lib/cli/util/guess-agent.js +32 -0
  110. package/lib/cli/util/npm.d.ts +4 -0
  111. package/lib/cli/util/npm.js +34 -0
  112. package/lib/cli/util/trap-errors.d.ts +6 -0
  113. package/lib/cli/util/trap-errors.js +17 -0
  114. package/lib/cli/util/yargs-helpers.d.ts +22 -0
  115. package/lib/cli/util/yargs-helpers.js +49 -0
  116. package/lib/cli/version.d.ts +3 -0
  117. package/lib/cli/version.js +22 -0
  118. package/lib/commands/context.d.ts +40 -0
  119. package/lib/commands/context.js +158 -0
  120. package/lib/commands/deploy.d.ts +13 -0
  121. package/lib/commands/deploy.js +18 -0
  122. package/lib/commands/docs.d.ts +18 -0
  123. package/lib/commands/docs.js +33 -0
  124. package/lib/commands/doctor.d.ts +4 -0
  125. package/lib/commands/doctor.js +69 -0
  126. package/lib/commands/flags/flags.d.ts +13 -0
  127. package/lib/commands/flags/flags.js +30 -0
  128. package/lib/commands/flags/interactive-handler.d.ts +16 -0
  129. package/lib/commands/flags/interactive-handler.js +71 -0
  130. package/lib/commands/flags/obsolete-flags.d.ts +1 -0
  131. package/lib/commands/flags/obsolete-flags.js +9 -0
  132. package/lib/commands/flags/operations.d.ts +80 -0
  133. package/lib/commands/flags/operations.js +467 -0
  134. package/lib/commands/flags/router.d.ts +18 -0
  135. package/lib/commands/flags/router.js +60 -0
  136. package/lib/commands/flags/types.d.ts +12 -0
  137. package/lib/commands/flags/types.js +12 -0
  138. package/lib/commands/flags/validator.d.ts +22 -0
  139. package/lib/commands/flags/validator.js +95 -0
  140. package/lib/commands/init/index.d.ts +1 -0
  141. package/lib/commands/init/index.js +18 -0
  142. package/lib/commands/init/init-hooks.d.ts +41 -0
  143. package/lib/commands/init/init-hooks.js +85 -0
  144. package/lib/commands/init/init.d.ts +139 -0
  145. package/lib/commands/init/init.js +788 -0
  146. package/lib/commands/init/os.d.ts +8 -0
  147. package/lib/commands/init/os.js +91 -0
  148. package/lib/commands/init/package-manager.d.ts +15 -0
  149. package/lib/commands/init/package-manager.js +14 -0
  150. package/lib/commands/language.d.ts +30 -0
  151. package/lib/commands/language.js +46 -0
  152. package/lib/commands/list-stacks.d.ts +21 -0
  153. package/lib/commands/list-stacks.js +28 -0
  154. package/lib/commands/migrate.d.ts +316 -0
  155. package/lib/commands/migrate.js +801 -0
  156. package/lib/context-providers.d.ts +1 -0
  157. package/lib/context-providers.js +19 -0
  158. package/lib/cxapp/cloud-assembly.d.ts +79 -0
  159. package/lib/cxapp/cloud-assembly.js +109 -0
  160. package/lib/cxapp/cloud-executable.d.ts +51 -0
  161. package/lib/cxapp/cloud-executable.js +123 -0
  162. package/lib/cxapp/environments.d.ts +8 -0
  163. package/lib/cxapp/environments.js +66 -0
  164. package/lib/cxapp/exec.d.ts +14 -0
  165. package/lib/cxapp/exec.js +133 -0
  166. package/lib/cxapp/index.d.ts +4 -0
  167. package/lib/cxapp/index.js +21 -0
  168. package/lib/index.d.ts +2 -0
  169. package/lib/index.js +364043 -0
  170. package/lib/index_bg.wasm +0 -0
  171. package/lib/init-templates/.init-version.json +1 -0
  172. package/lib/init-templates/.no-packagejson-validator +0 -0
  173. package/lib/init-templates/.recommended-feature-flags.json +86 -0
  174. package/lib/init-templates/LICENSE +16 -0
  175. package/lib/init-templates/app/csharp/.template.gitignore +342 -0
  176. package/lib/init-templates/app/csharp/README.md +14 -0
  177. package/lib/init-templates/app/csharp/cdk.template.json +15 -0
  178. package/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +20 -0
  179. package/lib/init-templates/app/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +13 -0
  180. package/lib/init-templates/app/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +1 -0
  181. package/lib/init-templates/app/csharp/src/%name.PascalCased%/Program.template.cs +44 -0
  182. package/lib/init-templates/app/csharp/src/%name.PascalCased%.template.sln +18 -0
  183. package/lib/init-templates/app/fsharp/.template.gitignore +342 -0
  184. package/lib/init-templates/app/fsharp/README.md +18 -0
  185. package/lib/init-templates/app/fsharp/cdk.template.json +14 -0
  186. package/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +25 -0
  187. package/lib/init-templates/app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +8 -0
  188. package/lib/init-templates/app/fsharp/src/%name.PascalCased%/Program.template.fs +11 -0
  189. package/lib/init-templates/app/fsharp/src/%name.PascalCased%.template.sln +18 -0
  190. package/lib/init-templates/app/go/%name%.template.go +70 -0
  191. package/lib/init-templates/app/go/%name%_test.template.go +26 -0
  192. package/lib/init-templates/app/go/.template.gitignore +19 -0
  193. package/lib/init-templates/app/go/README.md +12 -0
  194. package/lib/init-templates/app/go/cdk.template.json +13 -0
  195. package/lib/init-templates/app/go/go.template.mod +9 -0
  196. package/lib/init-templates/app/info.json +4 -0
  197. package/lib/init-templates/app/java/.template.gitignore +13 -0
  198. package/lib/init-templates/app/java/README.md +18 -0
  199. package/lib/init-templates/app/java/cdk.json +13 -0
  200. package/lib/init-templates/app/java/pom.xml +60 -0
  201. package/lib/init-templates/app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +42 -0
  202. package/lib/init-templates/app/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +24 -0
  203. package/lib/init-templates/app/java/src/test/java/com/myorg/%name.PascalCased%Test.template.java +26 -0
  204. package/lib/init-templates/app/javascript/.template.gitignore +5 -0
  205. package/lib/init-templates/app/javascript/.template.npmignore +3 -0
  206. package/lib/init-templates/app/javascript/README.md +12 -0
  207. package/lib/init-templates/app/javascript/bin/%name%.template.js +21 -0
  208. package/lib/init-templates/app/javascript/cdk.template.json +15 -0
  209. package/lib/init-templates/app/javascript/jest.config.js +4 -0
  210. package/lib/init-templates/app/javascript/lib/%name%-stack.template.js +23 -0
  211. package/lib/init-templates/app/javascript/package.json +20 -0
  212. package/lib/init-templates/app/javascript/test/%name%.test.template.js +17 -0
  213. package/lib/init-templates/app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +19 -0
  214. package/lib/init-templates/app/python/%name.PythonModule%/__init__.py +0 -0
  215. package/lib/init-templates/app/python/.template.gitignore +10 -0
  216. package/lib/init-templates/app/python/README.template.md +58 -0
  217. package/lib/init-templates/app/python/app.template.py +28 -0
  218. package/lib/init-templates/app/python/cdk.template.json +15 -0
  219. package/lib/init-templates/app/python/requirements-dev.txt +1 -0
  220. package/lib/init-templates/app/python/requirements.txt +2 -0
  221. package/lib/init-templates/app/python/source.bat +13 -0
  222. package/lib/init-templates/app/python/tests/__init__.py +0 -0
  223. package/lib/init-templates/app/python/tests/unit/__init__.py +0 -0
  224. package/lib/init-templates/app/python/tests/unit/test_%name.PythonModule%_stack.template.py +15 -0
  225. package/lib/init-templates/app/typescript/.template.gitignore +8 -0
  226. package/lib/init-templates/app/typescript/.template.npmignore +6 -0
  227. package/lib/init-templates/app/typescript/README.md +14 -0
  228. package/lib/init-templates/app/typescript/bin/%name%.template.ts +20 -0
  229. package/lib/init-templates/app/typescript/cdk.template.json +17 -0
  230. package/lib/init-templates/app/typescript/jest.config.js +9 -0
  231. package/lib/init-templates/app/typescript/lib/%name%-stack.template.ts +16 -0
  232. package/lib/init-templates/app/typescript/package.json +26 -0
  233. package/lib/init-templates/app/typescript/test/%name%.test.template.ts +17 -0
  234. package/lib/init-templates/app/typescript/tsconfig.json +32 -0
  235. package/lib/init-templates/lib/info.json +4 -0
  236. package/lib/init-templates/lib/typescript/.template.gitignore +8 -0
  237. package/lib/init-templates/lib/typescript/.template.npmignore +6 -0
  238. package/lib/init-templates/lib/typescript/README.template.md +12 -0
  239. package/lib/init-templates/lib/typescript/jest.config.js +9 -0
  240. package/lib/init-templates/lib/typescript/lib/index.template.ts +21 -0
  241. package/lib/init-templates/lib/typescript/package.json +24 -0
  242. package/lib/init-templates/lib/typescript/test/%name%.test.template.ts +18 -0
  243. package/lib/init-templates/lib/typescript/tsconfig.json +32 -0
  244. package/lib/init-templates/sample-app/csharp/.template.gitignore +342 -0
  245. package/lib/init-templates/sample-app/csharp/README.template.md +19 -0
  246. package/lib/init-templates/sample-app/csharp/cdk.template.json +15 -0
  247. package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%.template.csproj +20 -0
  248. package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.cs +24 -0
  249. package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/GlobalSuppressions.cs +1 -0
  250. package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%/Program.template.cs +15 -0
  251. package/lib/init-templates/sample-app/csharp/src/%name.PascalCased%.template.sln +18 -0
  252. package/lib/init-templates/sample-app/fsharp/.template.gitignore +342 -0
  253. package/lib/init-templates/sample-app/fsharp/README.template.md +20 -0
  254. package/lib/init-templates/sample-app/fsharp/cdk.template.json +14 -0
  255. package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%.template.fsproj +25 -0
  256. package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/%name.PascalCased%Stack.template.fs +14 -0
  257. package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%/Program.template.fs +11 -0
  258. package/lib/init-templates/sample-app/fsharp/src/%name.PascalCased%.template.sln +18 -0
  259. package/lib/init-templates/sample-app/go/%name%.template.go +73 -0
  260. package/lib/init-templates/sample-app/go/%name%_test.template.go +25 -0
  261. package/lib/init-templates/sample-app/go/.template.gitignore +19 -0
  262. package/lib/init-templates/sample-app/go/README.md +12 -0
  263. package/lib/init-templates/sample-app/go/cdk.template.json +13 -0
  264. package/lib/init-templates/sample-app/go/go.template.mod +9 -0
  265. package/lib/init-templates/sample-app/info.json +4 -0
  266. package/lib/init-templates/sample-app/java/.template.gitignore +13 -0
  267. package/lib/init-templates/sample-app/java/README.template.md +19 -0
  268. package/lib/init-templates/sample-app/java/cdk.json +13 -0
  269. package/lib/init-templates/sample-app/java/pom.xml +55 -0
  270. package/lib/init-templates/sample-app/java/src/main/java/com/myorg/%name.PascalCased%App.template.java +13 -0
  271. package/lib/init-templates/sample-app/java/src/main/java/com/myorg/%name.PascalCased%Stack.template.java +29 -0
  272. package/lib/init-templates/sample-app/java/src/test/java/com/myorg/%name.PascalCased%StackTest.template.java +27 -0
  273. package/lib/init-templates/sample-app/javascript/.template.gitignore +5 -0
  274. package/lib/init-templates/sample-app/javascript/.template.npmignore +3 -0
  275. package/lib/init-templates/sample-app/javascript/README.template.md +13 -0
  276. package/lib/init-templates/sample-app/javascript/bin/%name%.template.js +6 -0
  277. package/lib/init-templates/sample-app/javascript/cdk.template.json +15 -0
  278. package/lib/init-templates/sample-app/javascript/jest.config.js +4 -0
  279. package/lib/init-templates/sample-app/javascript/lib/%name%-stack.template.js +25 -0
  280. package/lib/init-templates/sample-app/javascript/package.json +20 -0
  281. package/lib/init-templates/sample-app/javascript/test/%name%.test.template.js +16 -0
  282. package/lib/init-templates/sample-app/javascript/tsconfig.json +34 -0
  283. package/lib/init-templates/sample-app/python/%name.PythonModule%/%name.PythonModule%_stack.template.py +26 -0
  284. package/lib/init-templates/sample-app/python/%name.PythonModule%/__init__.py +0 -0
  285. package/lib/init-templates/sample-app/python/.template.gitignore +22 -0
  286. package/lib/init-templates/sample-app/python/README.template.md +65 -0
  287. package/lib/init-templates/sample-app/python/app.template.py +11 -0
  288. package/lib/init-templates/sample-app/python/cdk.template.json +15 -0
  289. package/lib/init-templates/sample-app/python/requirements-dev.txt +1 -0
  290. package/lib/init-templates/sample-app/python/requirements.txt +2 -0
  291. package/lib/init-templates/sample-app/python/source.bat +13 -0
  292. package/lib/init-templates/sample-app/python/tests/__init__.py +0 -0
  293. package/lib/init-templates/sample-app/python/tests/unit/__init__.py +0 -0
  294. package/lib/init-templates/sample-app/python/tests/unit/test_%name.PythonModule%_stack.template.py +21 -0
  295. package/lib/init-templates/sample-app/typescript/.template.gitignore +8 -0
  296. package/lib/init-templates/sample-app/typescript/.template.npmignore +6 -0
  297. package/lib/init-templates/sample-app/typescript/README.template.md +15 -0
  298. package/lib/init-templates/sample-app/typescript/bin/%name%.template.ts +6 -0
  299. package/lib/init-templates/sample-app/typescript/cdk.template.json +17 -0
  300. package/lib/init-templates/sample-app/typescript/jest.config.js +9 -0
  301. package/lib/init-templates/sample-app/typescript/lib/%name%-stack.template.ts +19 -0
  302. package/lib/init-templates/sample-app/typescript/package.json +26 -0
  303. package/lib/init-templates/sample-app/typescript/test/%name%.test.template.ts +17 -0
  304. package/lib/init-templates/sample-app/typescript/tsconfig.json +32 -0
  305. package/lib/util.d.ts +1 -0
  306. package/lib/util.js +19 -0
  307. package/package.json +170 -0
  308. package/release.txt +2 -0
@@ -0,0 +1,855 @@
1
+ Description: This stack includes resources needed to deploy AWS CDK apps into this
2
+ environment
3
+ Parameters:
4
+ TrustedAccounts:
5
+ Description: List of AWS accounts that are trusted to publish assets and deploy
6
+ stacks to this environment
7
+ Default: ''
8
+ Type: CommaDelimitedList
9
+ TrustedAccountsForLookup:
10
+ Description: List of AWS accounts that are trusted to look up values in this
11
+ environment
12
+ Default: ''
13
+ Type: CommaDelimitedList
14
+ CloudFormationExecutionPolicies:
15
+ Description: List of the ManagedPolicy ARN(s) to attach to the CloudFormation
16
+ deployment role
17
+ Default: ''
18
+ Type: CommaDelimitedList
19
+ FileAssetsBucketName:
20
+ Description: The name of the S3 bucket used for file assets
21
+ Default: ''
22
+ Type: String
23
+ FileAssetsBucketKmsKeyId:
24
+ Description: Empty to create a new key (default), 'AWS_MANAGED_KEY' to use a managed
25
+ S3 key, or the ID/ARN of an existing key.
26
+ Default: ''
27
+ Type: String
28
+ ContainerAssetsRepositoryName:
29
+ Description: A user-provided custom name to use for the container assets ECR repository
30
+ Default: ''
31
+ Type: String
32
+ Qualifier:
33
+ Description: An identifier to distinguish multiple bootstrap stacks in the same environment
34
+ Default: hnb659fds
35
+ Type: String
36
+ # "cdk-(qualifier)-image-publishing-role-(account)-(region)" needs to be <= 64 chars
37
+ # account = 12, region <= 14, 10 chars for qualifier and 28 for rest of role name
38
+ AllowedPattern: "[A-Za-z0-9_-]{1,10}"
39
+ ConstraintDescription: Qualifier must be an alphanumeric identifier of at most 10 characters
40
+ PublicAccessBlockConfiguration:
41
+ Description: Whether or not to enable S3 Staging Bucket Public Access Block Configuration
42
+ Default: 'true'
43
+ Type: 'String'
44
+ AllowedValues: ['true', 'false']
45
+ InputPermissionsBoundary:
46
+ Description: Whether or not to use either the CDK supplied or custom permissions boundary
47
+ Default: ''
48
+ Type: 'String'
49
+ UseExamplePermissionsBoundary:
50
+ Default: 'false'
51
+ AllowedValues: [ 'true', 'false' ]
52
+ Type: String
53
+ BootstrapVariant:
54
+ Type: String
55
+ Default: 'AWS CDK: Default Resources'
56
+ Description: Describe the provenance of the resources in this bootstrap
57
+ stack. Change this when you customize the template. To prevent accidents,
58
+ the CDK CLI will not overwrite bootstrap stacks with a different variant.
59
+ DenyExternalId:
60
+ # By default, CDK Bootstrap roles are not designed to be deputized.
61
+ # Deputized means that you give an external entity access to assume roles on
62
+ # your behalf. They will supply an ExternalId to avoid Confused Deputy
63
+ # attacks (https://docs.aws.amazon.com/IAM/latest/UserGuide/confused-deputy.html).
64
+ #
65
+ # AssumeRole calls with ExternalIds will be denied by default, set this to 'false'
66
+ # if you need this functionality for some reason.
67
+ Type: String
68
+ Default: 'true'
69
+ AllowedValues: ['true', 'false']
70
+ Description: Whether to deny AssumeRole calls with an ExternalId. This prevents calls that are intended to be deputized from accidentally assuming CDK Roles.
71
+ Conditions:
72
+ HasTrustedAccounts:
73
+ Fn::Not:
74
+ - Fn::Equals:
75
+ - ''
76
+ - Fn::Join:
77
+ - ''
78
+ - Ref: TrustedAccounts
79
+ HasTrustedAccountsForLookup:
80
+ Fn::Not:
81
+ - Fn::Equals:
82
+ - ''
83
+ - Fn::Join:
84
+ - ''
85
+ - Ref: TrustedAccountsForLookup
86
+ HasCloudFormationExecutionPolicies:
87
+ Fn::Not:
88
+ - Fn::Equals:
89
+ - ''
90
+ - Fn::Join:
91
+ - ''
92
+ - Ref: CloudFormationExecutionPolicies
93
+ HasCustomFileAssetsBucketName:
94
+ Fn::Not:
95
+ - Fn::Equals:
96
+ - ''
97
+ - Ref: FileAssetsBucketName
98
+ CreateNewKey:
99
+ Fn::Equals:
100
+ - ''
101
+ - Ref: FileAssetsBucketKmsKeyId
102
+ UseAwsManagedKey:
103
+ Fn::Equals:
104
+ - 'AWS_MANAGED_KEY'
105
+ - Ref: FileAssetsBucketKmsKeyId
106
+ ShouldCreatePermissionsBoundary:
107
+ Fn::Equals:
108
+ - 'true'
109
+ - Ref: UseExamplePermissionsBoundary
110
+ PermissionsBoundarySet:
111
+ Fn::Not:
112
+ - Fn::Equals:
113
+ - ''
114
+ - Ref: InputPermissionsBoundary
115
+ HasCustomContainerAssetsRepositoryName:
116
+ Fn::Not:
117
+ - Fn::Equals:
118
+ - ''
119
+ - Ref: ContainerAssetsRepositoryName
120
+ UsePublicAccessBlockConfiguration:
121
+ Fn::Equals:
122
+ - 'true'
123
+ - Ref: PublicAccessBlockConfiguration
124
+ ShouldDenyExternalId:
125
+ Fn::Equals:
126
+ - 'true'
127
+ - Ref: DenyExternalId
128
+ Resources:
129
+ FileAssetsBucketEncryptionKey:
130
+ Type: AWS::KMS::Key
131
+ Properties:
132
+ KeyPolicy:
133
+ Statement:
134
+ - Action:
135
+ - kms:Create*
136
+ - kms:Describe*
137
+ - kms:Enable*
138
+ - kms:List*
139
+ - kms:Put*
140
+ - kms:Update*
141
+ - kms:Revoke*
142
+ - kms:Disable*
143
+ - kms:Get*
144
+ - kms:Delete*
145
+ - kms:ScheduleKeyDeletion
146
+ - kms:CancelKeyDeletion
147
+ - kms:GenerateDataKey
148
+ - kms:TagResource
149
+ - kms:UntagResource
150
+ Effect: Allow
151
+ Principal:
152
+ AWS:
153
+ Ref: AWS::AccountId
154
+ Resource: "*"
155
+ - Action:
156
+ - kms:Decrypt
157
+ - kms:DescribeKey
158
+ - kms:Encrypt
159
+ - kms:ReEncrypt*
160
+ - kms:GenerateDataKey*
161
+ Effect: Allow
162
+ Principal:
163
+ # Not actually everyone -- see below for Conditions
164
+ AWS: "*"
165
+ Resource: "*"
166
+ Condition:
167
+ StringEquals:
168
+ # See https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-caller-account
169
+ kms:CallerAccount:
170
+ Ref: AWS::AccountId
171
+ kms:ViaService:
172
+ - Fn::Sub: s3.${AWS::Region}.amazonaws.com
173
+ - Action:
174
+ - kms:Decrypt
175
+ - kms:DescribeKey
176
+ - kms:Encrypt
177
+ - kms:ReEncrypt*
178
+ - kms:GenerateDataKey*
179
+ Effect: Allow
180
+ Principal:
181
+ AWS:
182
+ Fn::Sub: "${FilePublishingRole.Arn}"
183
+ Resource: "*"
184
+ Condition: CreateNewKey
185
+ UpdateReplacePolicy: Delete
186
+ DeletionPolicy: Delete
187
+ FileAssetsBucketEncryptionKeyAlias:
188
+ Condition: CreateNewKey
189
+ Type: AWS::KMS::Alias
190
+ Properties:
191
+ AliasName:
192
+ Fn::Sub: "alias/cdk-${Qualifier}-assets-key"
193
+ TargetKeyId:
194
+ Ref: FileAssetsBucketEncryptionKey
195
+ StagingBucket:
196
+ Type: AWS::S3::Bucket
197
+ Properties:
198
+ BucketName:
199
+ Fn::If:
200
+ - HasCustomFileAssetsBucketName
201
+ - Fn::Sub: "${FileAssetsBucketName}"
202
+ - Fn::Sub: cdk-${Qualifier}-assets-${AWS::AccountId}-${AWS::Region}
203
+ AccessControl: Private
204
+ BucketEncryption:
205
+ ServerSideEncryptionConfiguration:
206
+ - ServerSideEncryptionByDefault:
207
+ SSEAlgorithm: aws:kms
208
+ KMSMasterKeyID:
209
+ Fn::If:
210
+ - CreateNewKey
211
+ - Fn::Sub: "${FileAssetsBucketEncryptionKey.Arn}"
212
+ - Fn::If:
213
+ - UseAwsManagedKey
214
+ - Ref: AWS::NoValue
215
+ - Fn::Sub: "${FileAssetsBucketKmsKeyId}"
216
+ PublicAccessBlockConfiguration:
217
+ Fn::If:
218
+ - UsePublicAccessBlockConfiguration
219
+ - BlockPublicAcls: true
220
+ BlockPublicPolicy: true
221
+ IgnorePublicAcls: true
222
+ RestrictPublicBuckets: true
223
+ - Ref: AWS::NoValue
224
+ VersioningConfiguration:
225
+ Status: Enabled
226
+ LifecycleConfiguration:
227
+ Rules:
228
+ # Objects will only be noncurrent if they are deleted via garbage collection.
229
+ - Id: CleanupOldVersions
230
+ Status: Enabled
231
+ NoncurrentVersionExpiration:
232
+ NoncurrentDays: 30
233
+ - Id: AbortIncompleteMultipartUploads
234
+ Status: Enabled
235
+ AbortIncompleteMultipartUpload:
236
+ DaysAfterInitiation: 1
237
+ UpdateReplacePolicy: Retain
238
+ DeletionPolicy: Retain
239
+ StagingBucketPolicy:
240
+ Type: 'AWS::S3::BucketPolicy'
241
+ Properties:
242
+ Bucket: { Ref: 'StagingBucket' }
243
+ PolicyDocument:
244
+ Id: 'AccessControl'
245
+ Version: '2012-10-17'
246
+ Statement:
247
+ - Sid: 'AllowSSLRequestsOnly'
248
+ Action: 's3:*'
249
+ Effect: 'Deny'
250
+ Resource:
251
+ - { 'Fn::Sub': '${StagingBucket.Arn}' }
252
+ - { 'Fn::Sub': '${StagingBucket.Arn}/*' }
253
+ Condition:
254
+ Bool: { 'aws:SecureTransport': 'false' }
255
+ Principal: '*'
256
+ ContainerAssetsRepository:
257
+ Type: AWS::ECR::Repository
258
+ Properties:
259
+ ImageTagMutability: IMMUTABLE
260
+ # Untagged images should never exist but Security Hub wants this rule to exist
261
+ LifecyclePolicy:
262
+ LifecyclePolicyText: |
263
+ {
264
+ "rules": [
265
+ {
266
+ "rulePriority": 1,
267
+ "description": "Untagged images should not exist, but expire any older than one year",
268
+ "selection": {
269
+ "tagStatus": "untagged",
270
+ "countType": "sinceImagePushed",
271
+ "countUnit": "days",
272
+ "countNumber": 365
273
+ },
274
+ "action": { "type": "expire" }
275
+ }
276
+ ]
277
+ }
278
+ RepositoryName:
279
+ Fn::If:
280
+ - HasCustomContainerAssetsRepositoryName
281
+ - Fn::Sub: "${ContainerAssetsRepositoryName}"
282
+ - Fn::Sub: cdk-${Qualifier}-container-assets-${AWS::AccountId}-${AWS::Region}
283
+ RepositoryPolicyText:
284
+ Version: "2012-10-17"
285
+ Statement:
286
+ # Necessary for Lambda container images
287
+ # https://docs.aws.amazon.com/lambda/latest/dg/configuration-images.html#configuration-images-permissions
288
+ - Sid: LambdaECRImageRetrievalPolicy
289
+ Effect: Allow
290
+ Principal: { Service: "lambda.amazonaws.com" }
291
+ Action:
292
+ - ecr:BatchGetImage
293
+ - ecr:GetDownloadUrlForLayer
294
+ Condition:
295
+ StringLike:
296
+ "aws:sourceArn": { "Fn::Sub": "arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:*" }
297
+ # Necessary for EMR Serverless container images
298
+ # https://docs.aws.amazon.com/emr/latest/EMR-Serverless-UserGuide/application-custom-image.html#access-repo
299
+ - Sid: EmrServerlessImageRetrievalPolicy
300
+ Effect: Allow
301
+ Principal:
302
+ Service: emr-serverless.amazonaws.com
303
+ Action:
304
+ - ecr:BatchGetImage
305
+ - ecr:GetDownloadUrlForLayer
306
+ - ecr:DescribeImages
307
+ Condition:
308
+ StringLike:
309
+ "aws:sourceArn": { "Fn::Sub": "arn:${AWS::Partition}:emr-serverless:${AWS::Region}:${AWS::AccountId}:/applications/*" }
310
+ FilePublishingRole:
311
+ Type: AWS::IAM::Role
312
+ Properties:
313
+ AssumeRolePolicyDocument:
314
+ Statement:
315
+ # AssumeRole for same account (no ExternalId)
316
+ - Action: sts:AssumeRole
317
+ Effect: Allow
318
+ Principal:
319
+ AWS:
320
+ Ref: AWS::AccountId
321
+ Condition:
322
+ Fn::If:
323
+ - ShouldDenyExternalId
324
+ - "Null":
325
+ "sts:ExternalId": "true"
326
+ - Ref: AWS::NoValue
327
+ # TagSession for same account
328
+ - Action: sts:TagSession
329
+ Effect: Allow
330
+ Principal:
331
+ AWS:
332
+ Ref: AWS::AccountId
333
+ # AssumeRole for regular Trust account (no ExternalId)
334
+ - Fn::If:
335
+ - HasTrustedAccounts
336
+ - Action:
337
+ - sts:AssumeRole
338
+ Effect: Allow
339
+ Principal:
340
+ AWS:
341
+ Ref: TrustedAccounts
342
+ Condition:
343
+ Fn::If:
344
+ - ShouldDenyExternalId
345
+ - "Null":
346
+ "sts:ExternalId": "true"
347
+ - Ref: AWS::NoValue
348
+ - Ref: AWS::NoValue
349
+ # TagSession for regular Trust
350
+ - Fn::If:
351
+ - HasTrustedAccounts
352
+ - Action:
353
+ - sts:TagSession
354
+ Effect: Allow
355
+ Principal:
356
+ AWS:
357
+ Ref: TrustedAccounts
358
+ - Ref: AWS::NoValue
359
+ RoleName:
360
+ Fn::Sub: cdk-${Qualifier}-file-publishing-role-${AWS::AccountId}-${AWS::Region}
361
+ Tags:
362
+ - Key: aws-cdk:bootstrap-role
363
+ Value: file-publishing
364
+ ImagePublishingRole:
365
+ Type: AWS::IAM::Role
366
+ Properties:
367
+ AssumeRolePolicyDocument:
368
+ Statement:
369
+ # AssumeRole for same account (no ExternalId)
370
+ - Action: sts:AssumeRole
371
+ Effect: Allow
372
+ Principal:
373
+ AWS:
374
+ Ref: AWS::AccountId
375
+ Condition:
376
+ Fn::If:
377
+ - ShouldDenyExternalId
378
+ - "Null":
379
+ "sts:ExternalId": "true"
380
+ - Ref: AWS::NoValue
381
+ # TagSession for same account
382
+ - Action: sts:TagSession
383
+ Effect: Allow
384
+ Principal:
385
+ AWS:
386
+ Ref: AWS::AccountId
387
+ # AssumeRole for Trusted account (no ExternalId)
388
+ - Fn::If:
389
+ - HasTrustedAccounts
390
+ - Action:
391
+ - sts:AssumeRole
392
+ Effect: Allow
393
+ Principal:
394
+ AWS:
395
+ Ref: TrustedAccounts
396
+ Condition:
397
+ Fn::If:
398
+ - ShouldDenyExternalId
399
+ - "Null":
400
+ "sts:ExternalId": "true"
401
+ - Ref: AWS::NoValue
402
+ - Ref: AWS::NoValue
403
+ # TagSession for Trusted account
404
+ - Fn::If:
405
+ - HasTrustedAccounts
406
+ - Action:
407
+ - sts:TagSession
408
+ Effect: Allow
409
+ Principal:
410
+ AWS:
411
+ Ref: TrustedAccounts
412
+ - Ref: AWS::NoValue
413
+ RoleName:
414
+ Fn::Sub: cdk-${Qualifier}-image-publishing-role-${AWS::AccountId}-${AWS::Region}
415
+ Tags:
416
+ - Key: aws-cdk:bootstrap-role
417
+ Value: image-publishing
418
+ LookupRole:
419
+ Type: AWS::IAM::Role
420
+ Properties:
421
+ AssumeRolePolicyDocument:
422
+ Statement:
423
+ # AssumeRole for same account (no ExternalId)
424
+ - Action: sts:AssumeRole
425
+ Effect: Allow
426
+ Principal:
427
+ AWS:
428
+ Ref: AWS::AccountId
429
+ Condition:
430
+ Fn::If:
431
+ - ShouldDenyExternalId
432
+ - "Null":
433
+ "sts:ExternalId": "true"
434
+ - Ref: AWS::NoValue
435
+ # TagSession for same account
436
+ - Action: sts:TagSession
437
+ Effect: Allow
438
+ Principal:
439
+ AWS:
440
+ Ref: AWS::AccountId
441
+ # Assume Role for Lookup Trust (no ExternalId)
442
+ - Fn::If:
443
+ - HasTrustedAccountsForLookup
444
+ - Action:
445
+ - sts:AssumeRole
446
+ Effect: Allow
447
+ Principal:
448
+ AWS:
449
+ Ref: TrustedAccountsForLookup
450
+ Condition:
451
+ Fn::If:
452
+ - ShouldDenyExternalId
453
+ - "Null":
454
+ "sts:ExternalId": "true"
455
+ - Ref: AWS::NoValue
456
+ - Ref: AWS::NoValue
457
+ # TagSession for Lookup Trust
458
+ - Fn::If:
459
+ - HasTrustedAccountsForLookup
460
+ - Action:
461
+ - sts:TagSession
462
+ Effect: Allow
463
+ Principal:
464
+ AWS:
465
+ Ref: TrustedAccountsForLookup
466
+ - Ref: AWS::NoValue
467
+ # Assume Role for regular Trust (no ExternalId)
468
+ - Fn::If:
469
+ - HasTrustedAccounts
470
+ - Action:
471
+ - sts:AssumeRole
472
+ Effect: Allow
473
+ Principal:
474
+ AWS:
475
+ Ref: TrustedAccounts
476
+ Condition:
477
+ Fn::If:
478
+ - ShouldDenyExternalId
479
+ - "Null":
480
+ "sts:ExternalId": "true"
481
+ - Ref: AWS::NoValue
482
+ - Ref: AWS::NoValue
483
+ # TagSession for regular Trust
484
+ - Fn::If:
485
+ - HasTrustedAccounts
486
+ - Action:
487
+ - sts:TagSession
488
+ Effect: Allow
489
+ Principal:
490
+ AWS:
491
+ Ref: TrustedAccounts
492
+ - Ref: AWS::NoValue
493
+ RoleName:
494
+ Fn::Sub: cdk-${Qualifier}-lookup-role-${AWS::AccountId}-${AWS::Region}
495
+ ManagedPolicyArns:
496
+ - Fn::Sub: "arn:${AWS::Partition}:iam::aws:policy/ReadOnlyAccess"
497
+ Policies:
498
+ - PolicyDocument:
499
+ Statement:
500
+ - Sid: DontReadSecrets
501
+ Effect: Deny
502
+ Action:
503
+ - kms:Decrypt
504
+ Resource: "*"
505
+ Version: '2012-10-17'
506
+ PolicyName: LookupRolePolicy
507
+ Tags:
508
+ - Key: aws-cdk:bootstrap-role
509
+ Value: lookup
510
+ FilePublishingRoleDefaultPolicy:
511
+ Type: AWS::IAM::Policy
512
+ Properties:
513
+ PolicyDocument:
514
+ Statement:
515
+ - Action:
516
+ - s3:GetObject*
517
+ - s3:GetBucket*
518
+ - s3:GetEncryptionConfiguration
519
+ - s3:List*
520
+ - s3:DeleteObject*
521
+ - s3:PutObject*
522
+ - s3:Abort*
523
+ Resource:
524
+ - Fn::Sub: "${StagingBucket.Arn}"
525
+ - Fn::Sub: "${StagingBucket.Arn}/*"
526
+ Condition:
527
+ StringEquals:
528
+ aws:ResourceAccount:
529
+ - Fn::Sub: ${AWS::AccountId}
530
+ Effect: Allow
531
+ - Action:
532
+ - kms:Decrypt
533
+ - kms:DescribeKey
534
+ - kms:Encrypt
535
+ - kms:ReEncrypt*
536
+ - kms:GenerateDataKey*
537
+ Effect: Allow
538
+ Resource:
539
+ Fn::If:
540
+ - CreateNewKey
541
+ - Fn::Sub: "${FileAssetsBucketEncryptionKey.Arn}"
542
+ - Fn::Sub: arn:${AWS::Partition}:kms:${AWS::Region}:${AWS::AccountId}:key/${FileAssetsBucketKmsKeyId}
543
+ Version: '2012-10-17'
544
+ Roles:
545
+ - Ref: FilePublishingRole
546
+ PolicyName:
547
+ Fn::Sub: cdk-${Qualifier}-file-publishing-role-default-policy-${AWS::AccountId}-${AWS::Region}
548
+ ImagePublishingRoleDefaultPolicy:
549
+ Type: AWS::IAM::Policy
550
+ Properties:
551
+ PolicyDocument:
552
+ Statement:
553
+ - Action:
554
+ - ecr:PutImage
555
+ - ecr:InitiateLayerUpload
556
+ - ecr:UploadLayerPart
557
+ - ecr:CompleteLayerUpload
558
+ - ecr:BatchCheckLayerAvailability
559
+ - ecr:DescribeRepositories
560
+ - ecr:DescribeImages
561
+ - ecr:BatchGetImage
562
+ - ecr:GetDownloadUrlForLayer
563
+ Resource:
564
+ Fn::Sub: "${ContainerAssetsRepository.Arn}"
565
+ Effect: Allow
566
+ - Action:
567
+ - ecr:GetAuthorizationToken
568
+ Resource: "*"
569
+ Effect: Allow
570
+ Version: '2012-10-17'
571
+ Roles:
572
+ - Ref: ImagePublishingRole
573
+ PolicyName:
574
+ Fn::Sub: cdk-${Qualifier}-image-publishing-role-default-policy-${AWS::AccountId}-${AWS::Region}
575
+ DeploymentActionRole:
576
+ Type: AWS::IAM::Role
577
+ Properties:
578
+ AssumeRolePolicyDocument:
579
+ Statement:
580
+ # AssumeRole for same account (no ExternalId)
581
+ - Action: sts:AssumeRole
582
+ Effect: Allow
583
+ Principal:
584
+ AWS:
585
+ Ref: AWS::AccountId
586
+ Condition:
587
+ Fn::If:
588
+ - ShouldDenyExternalId
589
+ - "Null":
590
+ "sts:ExternalId": "true"
591
+ - Ref: AWS::NoValue
592
+ # TagSession for same account
593
+ - Action: sts:TagSession
594
+ Effect: Allow
595
+ Principal:
596
+ AWS:
597
+ Ref: AWS::AccountId
598
+ # AssumeRole for Trusted accounts (no ExternalId)
599
+ - Fn::If:
600
+ - HasTrustedAccounts
601
+ - Action:
602
+ - sts:AssumeRole
603
+ Effect: Allow
604
+ Principal:
605
+ AWS:
606
+ Ref: TrustedAccounts
607
+ Condition:
608
+ Fn::If:
609
+ - ShouldDenyExternalId
610
+ - "Null":
611
+ "sts:ExternalId": "true"
612
+ - Ref: AWS::NoValue
613
+ - Ref: AWS::NoValue
614
+ # TagSession for Trusted accounts
615
+ - Fn::If:
616
+ - HasTrustedAccounts
617
+ - Action:
618
+ - sts:TagSession
619
+ Effect: Allow
620
+ Principal:
621
+ AWS:
622
+ Ref: TrustedAccounts
623
+ - Ref: AWS::NoValue
624
+ Policies:
625
+ - PolicyDocument:
626
+ Statement:
627
+ - Sid: CloudFormationPermissions
628
+ Effect: Allow
629
+ Action:
630
+ - cloudformation:CreateChangeSet
631
+ - cloudformation:DeleteChangeSet
632
+ - cloudformation:DescribeChangeSet
633
+ - cloudformation:DescribeStacks
634
+ - cloudformation:DescribeEvents
635
+ - cloudformation:ExecuteChangeSet
636
+ - cloudformation:CreateStack
637
+ - cloudformation:UpdateStack
638
+ - cloudformation:RollbackStack
639
+ - cloudformation:ContinueUpdateRollback
640
+ Resource: "*"
641
+ - Sid: PipelineCrossAccountArtifactsBucket
642
+ # Read/write buckets in different accounts. Permissions to buckets in
643
+ # same account are granted by bucket policies.
644
+ #
645
+ # Write permissions necessary to write outputs to the cross-region artifact replication bucket
646
+ # https://aws.amazon.com/premiumsupport/knowledge-center/codepipeline-deploy-cloudformation/.
647
+ Effect: Allow
648
+ Action:
649
+ - s3:GetObject*
650
+ - s3:GetBucket*
651
+ - s3:List*
652
+ - s3:Abort*
653
+ - s3:DeleteObject*
654
+ - s3:PutObject*
655
+ Resource: "*"
656
+ Condition:
657
+ StringNotEquals:
658
+ s3:ResourceAccount:
659
+ Ref: 'AWS::AccountId'
660
+ - Sid: PipelineCrossAccountArtifactsKey
661
+ # Use keys only for the purposes of reading encrypted files from S3.
662
+ Effect: Allow
663
+ Action:
664
+ - kms:Decrypt
665
+ - kms:DescribeKey
666
+ - kms:Encrypt
667
+ - kms:ReEncrypt*
668
+ - kms:GenerateDataKey*
669
+ Resource: "*"
670
+ Condition:
671
+ StringEquals:
672
+ kms:ViaService:
673
+ Fn::Sub: s3.${AWS::Region}.amazonaws.com
674
+ - Action: iam:PassRole
675
+ Resource:
676
+ Fn::Sub: "${CloudFormationExecutionRole.Arn}"
677
+ Effect: Allow
678
+ - Sid: CliPermissions
679
+ Action:
680
+ # Permissions needed by the CLI when doing `cdk deploy`.
681
+ # Our CI/CD does not need DeleteStack,
682
+ # but we also want to use this role from the CLI,
683
+ # and there you can call `cdk destroy`
684
+ - cloudformation:DescribeStackEvents
685
+ - cloudformation:GetTemplate
686
+ - cloudformation:DeleteStack
687
+ - cloudformation:UpdateTerminationProtection
688
+ - sts:GetCallerIdentity
689
+ # `cdk import`
690
+ - cloudformation:GetTemplateSummary
691
+ # `cdk deploy` CloudFormation Hook annotation display on hook failure
692
+ - cloudformation:GetHookResult
693
+ Resource: "*"
694
+ Effect: Allow
695
+ - Sid: CliStagingBucket
696
+ Effect: Allow
697
+ Action:
698
+ - s3:GetObject*
699
+ - s3:GetBucket*
700
+ - s3:List*
701
+ Resource:
702
+ - Fn::Sub: ${StagingBucket.Arn}
703
+ - Fn::Sub: ${StagingBucket.Arn}/*
704
+ - Sid: ReadVersion
705
+ Effect: Allow
706
+ Action:
707
+ - ssm:GetParameter
708
+ - ssm:GetParameters # CreateChangeSet uses this to evaluate any SSM parameters (like `CdkBootstrapVersion`)
709
+ Resource:
710
+ - Fn::Sub: "arn:${AWS::Partition}:ssm:${AWS::Region}:${AWS::AccountId}:parameter${CdkBootstrapVersion}"
711
+ - Sid: Refactor
712
+ Effect: Allow
713
+ Action:
714
+ # Permissions needed to use the CDK CLI with stack refactor
715
+ - cloudformation:CreateStackRefactor
716
+ - cloudformation:DescribeStackRefactor
717
+ - cloudformation:ExecuteStackRefactor
718
+ - cloudformation:ListStackRefactorActions
719
+ - cloudformation:ListStackRefactors
720
+ - cloudformation:ListStacks
721
+ Resource: "*"
722
+ Version: '2012-10-17'
723
+ PolicyName: default
724
+ RoleName:
725
+ Fn::Sub: cdk-${Qualifier}-deploy-role-${AWS::AccountId}-${AWS::Region}
726
+ Tags:
727
+ - Key: aws-cdk:bootstrap-role
728
+ Value: deploy
729
+ CloudFormationExecutionRole:
730
+ Type: AWS::IAM::Role
731
+ Properties:
732
+ AssumeRolePolicyDocument:
733
+ Statement:
734
+ - Action: sts:AssumeRole
735
+ Effect: Allow
736
+ Principal:
737
+ Service: cloudformation.amazonaws.com
738
+ Version: '2012-10-17'
739
+ ManagedPolicyArns:
740
+ Fn::If:
741
+ - HasCloudFormationExecutionPolicies
742
+ - Ref: CloudFormationExecutionPolicies
743
+ - Fn::If:
744
+ - HasTrustedAccounts
745
+ # The CLI will prevent this case from occurring
746
+ - Ref: AWS::NoValue
747
+ # The CLI will advertise that we picked this implicitly
748
+ - - Fn::Sub: "arn:${AWS::Partition}:iam::aws:policy/AdministratorAccess"
749
+ RoleName:
750
+ Fn::Sub: cdk-${Qualifier}-cfn-exec-role-${AWS::AccountId}-${AWS::Region}
751
+ PermissionsBoundary:
752
+ Fn::If:
753
+ - PermissionsBoundarySet
754
+ - Fn::Sub: 'arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/${InputPermissionsBoundary}'
755
+ - Ref: AWS::NoValue
756
+ CdkBoostrapPermissionsBoundaryPolicy:
757
+ # Edit the template prior to boostrap in order to have this example policy created
758
+ Condition: ShouldCreatePermissionsBoundary
759
+ Type: AWS::IAM::ManagedPolicy
760
+ Properties:
761
+ PolicyDocument:
762
+ Statement:
763
+ # If permission boundaries do not have an explicit `allow`, then the effect is `deny`
764
+ - Sid: ExplicitAllowAll
765
+ Action:
766
+ - "*"
767
+ Effect: Allow
768
+ Resource: "*"
769
+ # Default permissions to prevent privilege escalation
770
+ - Sid: DenyAccessIfRequiredPermBoundaryIsNotBeingApplied
771
+ Action:
772
+ - iam:CreateUser
773
+ - iam:CreateRole
774
+ - iam:PutRolePermissionsBoundary
775
+ - iam:PutUserPermissionsBoundary
776
+ Condition:
777
+ StringNotEquals:
778
+ iam:PermissionsBoundary:
779
+ Fn::Sub: arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/cdk-${Qualifier}-permissions-boundary-${AWS::AccountId}-${AWS::Region}
780
+ Effect: Deny
781
+ Resource: "*"
782
+ # Forbid the policy itself being edited
783
+ - Sid: DenyPermBoundaryIAMPolicyAlteration
784
+ Action:
785
+ - iam:CreatePolicyVersion
786
+ - iam:DeletePolicy
787
+ - iam:DeletePolicyVersion
788
+ - iam:SetDefaultPolicyVersion
789
+ Effect: Deny
790
+ Resource:
791
+ Fn::Sub: arn:${AWS::Partition}:iam::${AWS::AccountId}:policy/cdk-${Qualifier}-permissions-boundary-${AWS::AccountId}-${AWS::Region}
792
+ # Forbid removing the permissions boundary from any user or role that has it associated
793
+ - Sid: DenyRemovalOfPermBoundaryFromAnyUserOrRole
794
+ Action:
795
+ - iam:DeleteUserPermissionsBoundary
796
+ - iam:DeleteRolePermissionsBoundary
797
+ Effect: Deny
798
+ Resource: "*"
799
+ # Add your specific organizational security policy here
800
+ # Uncomment the example to deny access to AWS Config
801
+ #- Sid: OrganizationalSecurityPolicy
802
+ # Action:
803
+ # - "config:*"
804
+ # Effect: Deny
805
+ # Resource: "*"
806
+ Version: "2012-10-17"
807
+ Description: "Bootstrap Permission Boundary"
808
+ ManagedPolicyName:
809
+ Fn::Sub: cdk-${Qualifier}-permissions-boundary-${AWS::AccountId}-${AWS::Region}
810
+ Path: /
811
+ # The SSM parameter is used in pipeline-deployed templates to verify the version
812
+ # of the bootstrap resources.
813
+ CdkBootstrapVersion:
814
+ Type: AWS::SSM::Parameter
815
+ Properties:
816
+ Type: String
817
+ Name:
818
+ Fn::Sub: '/cdk-bootstrap/${Qualifier}/version'
819
+ # Also update this value below (see comment there)
820
+ Value: '31'
821
+ Outputs:
822
+ BucketName:
823
+ Description: The name of the S3 bucket owned by the CDK toolkit stack
824
+ Value:
825
+ Fn::Sub: "${StagingBucket}"
826
+ BucketDomainName:
827
+ Description: The domain name of the S3 bucket owned by the CDK toolkit stack
828
+ Value:
829
+ Fn::Sub: "${StagingBucket.RegionalDomainName}"
830
+ # @deprecated - This Export can be removed at some future point in time.
831
+ # We can't do it today because if there are stacks that use it, the bootstrap
832
+ # stack cannot be updated. Not used anymore by apps >= 1.60.0
833
+ FileAssetKeyArn:
834
+ Description: The ARN of the KMS key used to encrypt the asset bucket (deprecated)
835
+ Value:
836
+ Fn::If:
837
+ - CreateNewKey
838
+ - Fn::Sub: "${FileAssetsBucketEncryptionKey.Arn}"
839
+ - Fn::Sub: "${FileAssetsBucketKmsKeyId}"
840
+ Export:
841
+ Name:
842
+ Fn::Sub: CdkBootstrap-${Qualifier}-FileAssetKeyArn
843
+ ImageRepositoryName:
844
+ Description: The name of the ECR repository which hosts docker image assets
845
+ Value:
846
+ Fn::Sub: "${ContainerAssetsRepository}"
847
+ # The Output is used by the CLI to verify the version of the bootstrap resources.
848
+ BootstrapVersion:
849
+ Description: The version of the bootstrap resources that are currently mastered
850
+ in this stack
851
+ # This value is purposely duplicated here from the AWS::SSM::Parameter value we define above.
852
+ # {Fn::GetAtt} on an SSM Parameter is eventually consistent, and can fail with "parameter
853
+ # doesn't exist" even after just having been created. To reduce our deploy failure rate, we
854
+ # duplicate the value here and use a build-time test to ensure the two values are the same.
855
+ Value: '31'