@kensio/yulin 1.21.3 → 1.21.5

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 (650) hide show
  1. package/dist/service/athena/engine/sim-athena-column-types.d.ts +2 -0
  2. package/dist/service/athena/engine/sim-athena-column-types.js +4 -0
  3. package/dist/service/athena/engine/sim-athena-delimited-format.d.ts +7 -0
  4. package/dist/service/athena/engine/sim-athena-delimited-format.js +51 -0
  5. package/dist/service/athena/engine/sim-athena-engine-result.js +5 -0
  6. package/dist/service/athena/engine/sim-athena-engine-run.d.ts +22 -2
  7. package/dist/service/athena/engine/sim-athena-engine-run.js +21 -31
  8. package/dist/service/athena/engine/sim-athena-loaded-tables.d.ts +10 -0
  9. package/dist/service/athena/engine/sim-athena-loaded-tables.js +35 -0
  10. package/dist/service/athena/engine/sim-athena-parquet-module.d.ts +25 -0
  11. package/dist/service/athena/engine/sim-athena-parquet-module.js +39 -0
  12. package/dist/service/athena/engine/sim-athena-parquet-records.d.ts +13 -0
  13. package/dist/service/athena/engine/sim-athena-parquet-records.js +57 -0
  14. package/dist/service/athena/engine/sim-athena-query-engine.d.ts +23 -5
  15. package/dist/service/athena/engine/sim-athena-query-engine.js +31 -10
  16. package/dist/service/athena/engine/sim-athena-record-reader.d.ts +12 -6
  17. package/dist/service/athena/engine/sim-athena-record-reader.js +28 -53
  18. package/dist/service/athena/engine/sim-athena-sql-translation.d.ts +15 -9
  19. package/dist/service/athena/engine/sim-athena-sql-translation.js +25 -13
  20. package/dist/service/athena/engine/sim-athena-sqlite-values.d.ts +5 -0
  21. package/dist/service/athena/engine/sim-athena-sqlite-values.js +24 -1
  22. package/dist/service/athena/engine/sim-athena-table-objects.d.ts +7 -2
  23. package/dist/service/athena/engine/sim-athena-table-objects.js +8 -4
  24. package/dist/service/athena/engine/sim-athena-table-rows.js +4 -3
  25. package/dist/service/athena/engine/sim-athena-turn-down.d.ts +26 -0
  26. package/dist/service/athena/engine/sim-athena-turn-down.js +43 -0
  27. package/dist/service/athena/execution/sim-athena-query-completion.d.ts +3 -1
  28. package/dist/service/athena/execution/sim-athena-query-completion.js +7 -1
  29. package/dist/service/athena/index.d.ts +1 -1
  30. package/dist/service/athena/index.js +1 -1
  31. package/dist/service/athena/result/sim-athena-query-answer.d.ts +12 -0
  32. package/dist/service/athena/result/sim-athena-query-answer.js +26 -4
  33. package/dist/service/athena/sim-athena-answered-query.fixture.d.ts +2 -0
  34. package/dist/service/athena/sim-athena-answered-query.fixture.js +1 -0
  35. package/dist/service/athena/sim-athena-engine.fixture.d.ts +20 -0
  36. package/dist/service/athena/sim-athena-engine.fixture.js +34 -0
  37. package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.d.ts +23 -0
  38. package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.js +37 -0
  39. package/dist/service/cloudformation/cdk/assets/sim-cdk-assets-publisher.d.ts +18 -13
  40. package/dist/service/cloudformation/cdk/assets/sim-cdk-assets-publisher.js +16 -24
  41. package/dist/service/cloudformation/cdk/s3/bucket-deployment/copy/sim-cdk-bucket-deploy-copier.d.ts +2 -0
  42. package/dist/service/cloudformation/cdk/s3/bucket-deployment/copy/sim-cdk-bucket-deploy-copier.js +1 -0
  43. package/dist/service/cloudformation/cdk/s3/bucket-deployment/copy/sim-cdk-bucket-deploy-file.d.ts +7 -0
  44. package/dist/service/cloudformation/cdk/s3/bucket-deployment/copy/sim-cdk-bucket-deploy-file.js +13 -1
  45. package/dist/service/cloudformation/cdk/s3/bucket-deployment/copy/sim-cdk-bucket-deploy-pruner.d.ts +6 -0
  46. package/dist/service/cloudformation/cdk/s3/bucket-deployment/copy/sim-cdk-bucket-deploy-pruner.js +7 -1
  47. package/dist/service/cloudformation/cdk/s3/bucket-deployment/notify/sim-cdk-bucket-deploy-notifier.d.ts +50 -0
  48. package/dist/service/cloudformation/cdk/s3/bucket-deployment/notify/sim-cdk-bucket-deploy-notifier.js +71 -0
  49. package/dist/service/cloudformation/cdk/s3/bucket-deployment/sim-cdk-bucket-deployment.js +6 -1
  50. package/dist/service/cloudformation/cdk/s3/bucket-deployment/source/sim-cdk-bucket-deploy-source.d.ts +5 -0
  51. package/dist/service/cloudformation/cdk/s3/bucket-deployment/source/sim-cdk-bucket-deploy-source.js +7 -0
  52. package/dist/service/cloudformation/cdk/sim-cdk-cloud-assembly.factory.d.ts +12 -0
  53. package/dist/service/cloudformation/cdk/sim-cdk-cloud-assembly.factory.js +16 -7
  54. package/dist/service/cloudformation/changeset/sim-cfn-change-set-arn.d.ts +9 -0
  55. package/dist/service/cloudformation/changeset/sim-cfn-change-set-arn.js +12 -0
  56. package/dist/service/cloudformation/changeset/sim-cfn-change-set-changes.d.ts +42 -0
  57. package/dist/service/cloudformation/changeset/sim-cfn-change-set-changes.js +69 -0
  58. package/dist/service/cloudformation/changeset/sim-cfn-change-set-commands.d.ts +62 -0
  59. package/dist/service/cloudformation/changeset/sim-cfn-change-set-commands.js +89 -0
  60. package/dist/service/cloudformation/changeset/sim-cfn-change-set-execution.d.ts +31 -0
  61. package/dist/service/cloudformation/changeset/sim-cfn-change-set-execution.js +59 -0
  62. package/dist/service/cloudformation/changeset/sim-cfn-change-set-failure.d.ts +21 -0
  63. package/dist/service/cloudformation/changeset/sim-cfn-change-set-failure.js +19 -0
  64. package/dist/service/cloudformation/changeset/sim-cfn-change-set-input.d.ts +17 -0
  65. package/dist/service/cloudformation/changeset/sim-cfn-change-set-input.js +18 -0
  66. package/dist/service/cloudformation/changeset/sim-cfn-change-set-stack-id.d.ts +18 -0
  67. package/dist/service/cloudformation/changeset/sim-cfn-change-set-stack-id.js +13 -0
  68. package/dist/service/cloudformation/changeset/sim-cfn-change-set-stack.d.ts +45 -0
  69. package/dist/service/cloudformation/changeset/sim-cfn-change-set-stack.js +52 -0
  70. package/dist/service/cloudformation/changeset/sim-cfn-change-set-type.d.ts +12 -0
  71. package/dist/service/cloudformation/changeset/sim-cfn-change-set-type.js +21 -0
  72. package/dist/service/cloudformation/changeset/sim-cfn-change-set.d.ts +54 -0
  73. package/dist/service/cloudformation/changeset/sim-cfn-change-set.js +49 -0
  74. package/dist/service/cloudformation/changeset/sim-cfn-change-set.type.d.ts +35 -0
  75. package/dist/service/cloudformation/changeset/sim-cfn-change-set.type.js +1 -0
  76. package/dist/service/cloudformation/changeset/sim-cfn-change-sets.d.ts +53 -0
  77. package/dist/service/cloudformation/changeset/sim-cfn-change-sets.js +83 -0
  78. package/dist/service/cloudformation/command/create-change-set/create-change-set.command.d.ts +32 -0
  79. package/dist/service/cloudformation/command/create-change-set/create-change-set.command.js +1 -0
  80. package/dist/service/cloudformation/command/create-change-set/create-change-set.handler.d.ts +38 -0
  81. package/dist/service/cloudformation/command/create-change-set/create-change-set.handler.js +80 -0
  82. package/dist/service/cloudformation/command/create-stack/create-stack.handler.d.ts +3 -0
  83. package/dist/service/cloudformation/command/create-stack/create-stack.handler.js +16 -13
  84. package/dist/service/cloudformation/command/delete-change-set/delete-change-set.command.d.ts +22 -0
  85. package/dist/service/cloudformation/command/delete-change-set/delete-change-set.command.js +1 -0
  86. package/dist/service/cloudformation/command/delete-change-set/delete-change-set.handler.d.ts +27 -0
  87. package/dist/service/cloudformation/command/delete-change-set/delete-change-set.handler.js +35 -0
  88. package/dist/service/cloudformation/command/delete-stack/delete-stack.command.d.ts +6 -0
  89. package/dist/service/cloudformation/command/delete-stack/delete-stack.handler.d.ts +11 -0
  90. package/dist/service/cloudformation/command/delete-stack/delete-stack.handler.js +15 -1
  91. package/dist/service/cloudformation/command/describe-change-set/describe-change-set.command.d.ts +48 -0
  92. package/dist/service/cloudformation/command/describe-change-set/describe-change-set.command.js +1 -0
  93. package/dist/service/cloudformation/command/describe-change-set/describe-change-set.handler.d.ts +23 -0
  94. package/dist/service/cloudformation/command/describe-change-set/describe-change-set.handler.js +52 -0
  95. package/dist/service/cloudformation/command/describe-stacks/describe-stacks.handler.d.ts +3 -0
  96. package/dist/service/cloudformation/command/describe-stacks/describe-stacks.handler.js +8 -4
  97. package/dist/service/cloudformation/command/describe-stacks/sim-cfn-described-stacks.d.ts +18 -6
  98. package/dist/service/cloudformation/command/describe-stacks/sim-cfn-described-stacks.js +22 -7
  99. package/dist/service/cloudformation/command/describe-stacks/sim-cfn-stack-describer.js +1 -1
  100. package/dist/service/cloudformation/command/execute-change-set/execute-change-set.command.d.ts +25 -0
  101. package/dist/service/cloudformation/command/execute-change-set/execute-change-set.command.js +1 -0
  102. package/dist/service/cloudformation/command/execute-change-set/execute-change-set.handler.d.ts +31 -0
  103. package/dist/service/cloudformation/command/execute-change-set/execute-change-set.handler.js +37 -0
  104. package/dist/service/cloudformation/command/list-change-sets/list-change-sets.command.d.ts +36 -0
  105. package/dist/service/cloudformation/command/list-change-sets/list-change-sets.command.js +1 -0
  106. package/dist/service/cloudformation/command/list-change-sets/list-change-sets.handler.d.ts +26 -0
  107. package/dist/service/cloudformation/command/list-change-sets/list-change-sets.handler.js +39 -0
  108. package/dist/service/cloudformation/command/update-stack/update-stack-previous-values.d.ts +31 -0
  109. package/dist/service/cloudformation/command/update-stack/update-stack-previous-values.js +52 -0
  110. package/dist/service/cloudformation/command/update-stack/update-stack-template.d.ts +22 -0
  111. package/dist/service/cloudformation/command/update-stack/update-stack-template.js +34 -0
  112. package/dist/service/cloudformation/command/update-stack/update-stack.command.d.ts +17 -1
  113. package/dist/service/cloudformation/command/update-stack/update-stack.handler.d.ts +6 -0
  114. package/dist/service/cloudformation/command/update-stack/update-stack.handler.js +15 -16
  115. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-deployer.js +2 -1
  116. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-options-deployed.d.ts +10 -0
  117. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-options-deployed.js +14 -0
  118. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.d.ts +11 -1
  119. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.js +3 -2
  120. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-stack-options.d.ts +5 -8
  121. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-stack-options.js +0 -14
  122. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +9 -0
  123. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +2 -0
  124. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +10 -0
  125. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +2 -1
  126. package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.js +1 -0
  127. package/dist/service/cloudformation/error/sim-cloudformation.error.d.ts +21 -0
  128. package/dist/service/cloudformation/error/sim-cloudformation.error.js +25 -0
  129. package/dist/service/cloudformation/parameters/pseudo/sim-cfn-pseudo-parameters.d.ts +7 -0
  130. package/dist/service/cloudformation/parameters/pseudo/sim-cfn-pseudo-parameters.js +3 -1
  131. package/dist/service/cloudformation/parameters/sim-cfn-parameters.d.ts +9 -0
  132. package/dist/service/cloudformation/parameters/sim-cfn-parameters.js +12 -0
  133. package/dist/service/cloudformation/resource/delete/sim-cfn-resource-delete-operation.d.ts +4 -0
  134. package/dist/service/cloudformation/resource/delete/sim-cfn-resource-delete-operation.js +10 -0
  135. package/dist/service/cloudformation/resource/delete/sim-cfn-resource-retention.d.ts +44 -0
  136. package/dist/service/cloudformation/resource/delete/sim-cfn-resource-retention.js +33 -0
  137. package/dist/service/cloudformation/resource/sim-cfn-resource-record.d.ts +15 -0
  138. package/dist/service/cloudformation/resource/sim-cfn-resource-record.js +21 -1
  139. package/dist/service/cloudformation/resource/sim-cfn-resource.d.ts +9 -7
  140. package/dist/service/cloudformation/resource/sim-cfn-resource.js +11 -11
  141. package/dist/service/cloudformation/resource/sim-cfn-resource.type.d.ts +8 -0
  142. package/dist/service/cloudformation/resource/state/sim-cfn-resource-deletion-state.d.ts +3 -3
  143. package/dist/service/cloudformation/resource/state/sim-cfn-resource-deletion-state.js +3 -3
  144. package/dist/service/cloudformation/resource/template/sim-cfn-resource-template-reader.d.ts +4 -0
  145. package/dist/service/cloudformation/resource/template/sim-cfn-resource-template-reader.js +9 -0
  146. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-auth.d.ts +37 -0
  147. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-auth.js +77 -0
  148. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-auth.types.d.ts +51 -0
  149. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-auth.types.js +10 -0
  150. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-authorizers.d.ts +11 -0
  151. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-authorizers.js +34 -0
  152. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-identity.d.ts +21 -0
  153. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-api-identity.js +31 -0
  154. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-authorizer-definition.d.ts +14 -0
  155. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-authorizer-definition.js +1 -0
  156. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-authorizer-function.d.ts +26 -0
  157. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-authorizer-function.js +58 -0
  158. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-event-authorization.d.ts +18 -0
  159. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-event-authorization.js +89 -0
  160. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-http-api-auth.d.ts +15 -0
  161. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-http-api-auth.js +65 -0
  162. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-http-jwt-authorizer.d.ts +13 -0
  163. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-http-jwt-authorizer.js +60 -0
  164. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-http-lambda-authorizer.d.ts +13 -0
  165. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-http-lambda-authorizer.js +50 -0
  166. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-identity-prefixes.d.ts +13 -0
  167. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-identity-prefixes.js +30 -0
  168. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-identity-source.d.ts +26 -0
  169. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-identity-source.js +44 -0
  170. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-rest-api-auth.d.ts +15 -0
  171. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-rest-api-auth.js +59 -0
  172. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-rest-cognito-authorizer.d.ts +11 -0
  173. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-rest-cognito-authorizer.js +43 -0
  174. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-rest-lambda-authorizer.d.ts +15 -0
  175. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-rest-lambda-authorizer.js +67 -0
  176. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-template-api-auth.d.ts +26 -0
  177. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-template-api-auth.js +61 -0
  178. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-unsupported-auth.d.ts +18 -0
  179. package/dist/service/cloudformation/sam/api/auth/sim-cfn-sam-unsupported-auth.js +59 -0
  180. package/dist/service/cloudformation/sam/api/sim-cfn-sam-http-api-template.factory.js +1 -1
  181. package/dist/service/cloudformation/sam/api/sim-cfn-sam-http-api.d.ts +4 -0
  182. package/dist/service/cloudformation/sam/api/sim-cfn-sam-http-api.js +12 -5
  183. package/dist/service/cloudformation/sam/api/sim-cfn-sam-rest-api-template.factory.js +1 -1
  184. package/dist/service/cloudformation/sam/api/sim-cfn-sam-rest-api.js +7 -3
  185. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-api-event.js +7 -3
  186. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-cognito-event.d.ts +26 -0
  187. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-cognito-event.js +88 -0
  188. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-declared-event.d.ts +12 -0
  189. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-declared-event.js +1 -0
  190. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-function-events.js +8 -5
  191. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-http-api-event.js +23 -1
  192. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-http-api-route.d.ts +9 -2
  193. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-http-api-route.js +5 -3
  194. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-implicit-http-api.d.ts +6 -1
  195. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-implicit-http-api.js +7 -1
  196. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-triggered-user-pool.d.ts +19 -0
  197. package/dist/service/cloudformation/sam/function/event/sim-cfn-sam-triggered-user-pool.js +69 -0
  198. package/dist/service/cloudformation/sam/function/sim-cfn-sam-function-template.factory.d.ts +5 -0
  199. package/dist/service/cloudformation/sam/function/sim-cfn-sam-function-template.factory.js +3 -1
  200. package/dist/service/cloudformation/sam/function/sim-cfn-sam-function-type.d.ts +8 -0
  201. package/dist/service/cloudformation/sam/function/sim-cfn-sam-function-type.js +8 -0
  202. package/dist/service/cloudformation/sam/function/sim-cfn-sam-function-url.js +1 -4
  203. package/dist/service/cloudformation/sam/function/sim-cfn-sam-function.d.ts +6 -4
  204. package/dist/service/cloudformation/sam/function/sim-cfn-sam-function.js +2 -4
  205. package/dist/service/cloudformation/sam/sim-cfn-sam-error.d.ts +31 -0
  206. package/dist/service/cloudformation/sam/sim-cfn-sam-error.js +17 -0
  207. package/dist/service/cloudformation/sam/sim-cfn-sam-expansion.js +11 -6
  208. package/dist/service/cloudformation/sdk/sim-cloudformation-sdk-command-router.js +20 -0
  209. package/dist/service/cloudformation/serve/sim-cloudformation-api.d.ts +4 -3
  210. package/dist/service/cloudformation/serve/sim-cloudformation-api.js +6 -3
  211. package/dist/service/cloudformation/serve/sim-cloudformation-change-set-api.d.ts +10 -0
  212. package/dist/service/cloudformation/serve/sim-cloudformation-change-set-api.js +94 -0
  213. package/dist/service/cloudformation/sim-cloudformation.d.ts +31 -0
  214. package/dist/service/cloudformation/sim-cloudformation.js +56 -9
  215. package/dist/service/cloudformation/stack/resource-map/sim-cfn-stack-resource-map.js +1 -0
  216. package/dist/service/cloudformation/stack/sim-cfn-deleted-stacks.d.ts +20 -0
  217. package/dist/service/cloudformation/stack/sim-cfn-deleted-stacks.js +23 -0
  218. package/dist/service/cloudformation/stack/sim-cfn-deployed-stack.type.d.ts +6 -0
  219. package/dist/service/cloudformation/stack/sim-cfn-stack-deploy-context.d.ts +47 -0
  220. package/dist/service/cloudformation/stack/sim-cfn-stack-deploy-context.js +46 -0
  221. package/dist/service/cloudformation/stack/sim-cfn-stack-id.d.ts +30 -0
  222. package/dist/service/cloudformation/stack/sim-cfn-stack-id.js +24 -0
  223. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +53 -20
  224. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +79 -32
  225. package/dist/service/cloudformation/stack/sim-cfn-stack.d.ts +28 -16
  226. package/dist/service/cloudformation/stack/sim-cfn-stack.js +60 -32
  227. package/dist/service/cloudformation/stack/sim-cfn-stack.type.d.ts +21 -1
  228. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-deletion-lifecycle.d.ts +7 -1
  229. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-deletion-lifecycle.js +3 -1
  230. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-resource-batch-deleter.d.ts +3 -0
  231. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-resource-batch-deleter.js +3 -0
  232. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-resource-deleter.d.ts +3 -0
  233. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-resource-deleter.js +2 -1
  234. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-retained-logical-ids.d.ts +18 -0
  235. package/dist/service/cloudformation/stack/teardown/sim-cfn-stack-retained-logical-ids.js +30 -0
  236. package/dist/service/cloudformation/stack/update/sim-cfn-stack-update-guard.d.ts +9 -0
  237. package/dist/service/cloudformation/stack/update/sim-cfn-stack-update-guard.js +14 -0
  238. package/dist/service/cloudformation/stack/update/sim-cfn-stack-update-lifecycle.d.ts +25 -14
  239. package/dist/service/cloudformation/stack/update/sim-cfn-stack-update-lifecycle.js +41 -24
  240. package/dist/service/cloudformation/stack/update/sim-cfn-stack-update-plan.d.ts +9 -0
  241. package/dist/service/cloudformation/stack/update/sim-cfn-stack-update-plan.js +14 -0
  242. package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.js +6 -1
  243. package/dist/service/cloudformation/template/condition/sim-cfn-condition-expression.d.ts +12 -3
  244. package/dist/service/cloudformation/template/condition/sim-cfn-condition-expression.js +29 -3
  245. package/dist/service/cloudformation/template/condition/sim-cfn-output-conditions.d.ts +28 -0
  246. package/dist/service/cloudformation/template/condition/sim-cfn-output-conditions.js +39 -0
  247. package/dist/service/cloudformation/template/node/fn/find-in-map/sim-cfn-fn-find-in-map.d.ts +25 -1
  248. package/dist/service/cloudformation/template/node/fn/find-in-map/sim-cfn-fn-find-in-map.js +43 -11
  249. package/dist/service/cloudformation/template/parse/fn/find-in-map/sim-cfn-fn-find-in-map-parser.d.ts +7 -0
  250. package/dist/service/cloudformation/template/parse/fn/find-in-map/sim-cfn-fn-find-in-map-parser.js +29 -3
  251. package/dist/service/cloudformation/template/sim-cfn-command-template.d.ts +40 -0
  252. package/dist/service/cloudformation/template/sim-cfn-command-template.js +45 -0
  253. package/dist/service/cloudformation/template/sim-cfn-template.d.ts +7 -0
  254. package/dist/service/cloudformation/template/sim-cfn-template.js +15 -1
  255. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts +2 -0
  256. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.js +49 -0
  257. package/dist/service/cloudfront/origin/custom/sim-cloudfront-custom-origin.js +1 -0
  258. package/dist/service/cloudfront/origin/s3/sim-cf-s3-origin-responses.js +1 -0
  259. package/dist/service/cognito/serve/page/sim-cognito-provider-page.js +1 -1
  260. package/dist/service/cognito/user-pool/idp/sim-cognito-attribute-mapping.d.ts +5 -0
  261. package/dist/service/cognito/user-pool/idp/sim-cognito-attribute-mapping.js +17 -0
  262. package/dist/service/cognito/user-pool/idp/sim-cognito-presented-external-user.d.ts +5 -5
  263. package/dist/service/cognito/user-pool/idp/sim-cognito-presented-external-user.js +24 -8
  264. package/dist/service/dynamodb/command/query/sim-dynamodb-query-expressions.d.ts +11 -8
  265. package/dist/service/dynamodb/command/query/sim-dynamodb-query-expressions.js +20 -8
  266. package/dist/service/dynamodb/command/query/sim-dynamodb-query.js +2 -0
  267. package/dist/service/dynamodb/command/query/sim-dynamodb-unsimulated-query-input.js +0 -1
  268. package/dist/service/dynamodb/command/read/sim-dynamodb-read-answer.d.ts +14 -4
  269. package/dist/service/dynamodb/command/read/sim-dynamodb-read-answer.js +16 -4
  270. package/dist/service/dynamodb/command/read/sim-dynamodb-table-read.fixture.d.ts +17 -0
  271. package/dist/service/dynamodb/command/read/sim-dynamodb-table-read.fixture.js +39 -0
  272. package/dist/service/dynamodb/command/scan/sim-dynamodb-scan-expressions.d.ts +28 -0
  273. package/dist/service/dynamodb/command/scan/sim-dynamodb-scan-expressions.js +50 -0
  274. package/dist/service/dynamodb/command/scan/sim-dynamodb-scan.js +12 -5
  275. package/dist/service/dynamodb/command/scan/sim-dynamodb-unsimulated-scan-input.d.ts +3 -3
  276. package/dist/service/dynamodb/command/scan/sim-dynamodb-unsimulated-scan-input.js +3 -4
  277. package/dist/service/dynamodb/expression/filter/sim-dynamodb-filter-expression.d.ts +5 -16
  278. package/dist/service/dynamodb/expression/filter/sim-dynamodb-filter-expression.js +4 -21
  279. package/dist/service/dynamodb/expression/projection/sim-dynamodb-projection-expression.d.ts +15 -0
  280. package/dist/service/dynamodb/expression/projection/sim-dynamodb-projection-expression.js +18 -1
  281. package/dist/service/dynamodb/expression/projection/sim-dynamodb-projection.d.ts +13 -0
  282. package/dist/service/dynamodb/expression/projection/sim-dynamodb-projection.js +15 -0
  283. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-properties.js +2 -0
  284. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-property-rules.js +5 -3
  285. package/dist/service/lambda/cfn/url/sim-cfn-lambda-url-cors.d.ts +21 -0
  286. package/dist/service/lambda/cfn/url/sim-cfn-lambda-url-cors.js +37 -0
  287. package/dist/service/lambda/cfn/url/sim-cfn-lambda-url-creator.js +6 -0
  288. package/dist/service/lambda/command/create-function/create-function.handler.d.ts +3 -0
  289. package/dist/service/lambda/command/create-function/create-function.handler.js +5 -1
  290. package/dist/service/lambda/command/create-function-url-config/create-function-url-config.command.d.ts +2 -3
  291. package/dist/service/lambda/command/create-function-url-config/create-function-url-config.handler.js +1 -0
  292. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.d.ts +6 -0
  293. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.js +10 -0
  294. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.js +2 -6
  295. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.js +1 -0
  296. package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts +2 -0
  297. package/dist/service/lambda/command/function-url/function-url-cors-constraints.d.ts +25 -0
  298. package/dist/service/lambda/command/function-url/function-url-cors-constraints.js +49 -0
  299. package/dist/service/lambda/command/function-url/function-url-cors-input.d.ts +25 -0
  300. package/dist/service/lambda/command/function-url/function-url-cors-input.js +57 -0
  301. package/dist/service/lambda/command/function-url/function-url-input.d.ts +7 -0
  302. package/dist/service/lambda/command/function-url/function-url-input.js +9 -0
  303. package/dist/service/lambda/command/invoke/async/sim-lambda-async-invocation.js +10 -13
  304. package/dist/service/lambda/command/invoke/async/sim-lambda-async-outcome.js +2 -0
  305. package/dist/service/lambda/command/invoke/async/sim-lambda-handler-attempt.d.ts +13 -0
  306. package/dist/service/lambda/command/invoke/async/sim-lambda-handler-attempt.js +12 -0
  307. package/dist/service/lambda/command/update-function-url-config/update-function-url-config.command.d.ts +2 -0
  308. package/dist/service/lambda/command/update-function-url-config/update-function-url-config.handler.js +1 -0
  309. package/dist/service/lambda/destination/deliver/sim-lambda-destination-bus.js +1 -1
  310. package/dist/service/lambda/destination/deliver/sim-lambda-destination-function.js +8 -12
  311. package/dist/service/lambda/destination/deliver/sim-lambda-destination-queue.js +4 -3
  312. package/dist/service/lambda/destination/deliver/sim-lambda-destination-send.d.ts +2 -0
  313. package/dist/service/lambda/destination/deliver/sim-lambda-destination-topic.js +4 -3
  314. package/dist/service/lambda/destination/sim-aws-lambda-destinations.d.ts +4 -6
  315. package/dist/service/lambda/destination/sim-aws-lambda-destinations.js +6 -6
  316. package/dist/service/lambda/destination/sim-lambda-destination-targets.d.ts +3 -0
  317. package/dist/service/lambda/event-source/poll/kinesis/sim-lambda-kinesis-stream-delivery.js +4 -9
  318. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-delivery.js +4 -9
  319. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.d.ts +22 -3
  320. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.js +39 -9
  321. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-response.d.ts +7 -6
  322. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-response.js +14 -12
  323. package/dist/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.d.ts +9 -15
  324. package/dist/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.js +9 -16
  325. package/dist/service/lambda/event-source/poll/sim-lambda-stream-progress.d.ts +10 -6
  326. package/dist/service/lambda/event-source/poll/sim-lambda-stream-progress.js +22 -12
  327. package/dist/service/lambda/event-source/poll/sim-lambda-stream-record-times.d.ts +23 -0
  328. package/dist/service/lambda/event-source/poll/sim-lambda-stream-record-times.js +18 -0
  329. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry-backoff.d.ts +12 -13
  330. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry-backoff.js +24 -17
  331. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry.d.ts +64 -0
  332. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry.js +86 -0
  333. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.d.ts +6 -0
  334. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.js +8 -1
  335. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-rules.d.ts +6 -0
  336. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-rules.js +7 -0
  337. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.d.ts +11 -1
  338. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.js +13 -0
  339. package/dist/service/lambda/event-source/sim-lambda-event-source-retry-limits.d.ts +39 -0
  340. package/dist/service/lambda/event-source/sim-lambda-event-source-retry-limits.js +46 -0
  341. package/dist/service/lambda/event-source/sim-lambda-stream-retry-limits.d.ts +56 -0
  342. package/dist/service/lambda/event-source/sim-lambda-stream-retry-limits.js +110 -0
  343. package/dist/service/lambda/event-source/stream/kinesis/sim-lambda-kinesis-event-source-arn.d.ts +5 -0
  344. package/dist/service/lambda/event-source/stream/kinesis/sim-lambda-kinesis-event-source-arn.js +7 -1
  345. package/dist/service/lambda/event-source/stream/kinesis/sim-lambda-kinesis-event-source-rules.d.ts +6 -0
  346. package/dist/service/lambda/event-source/stream/kinesis/sim-lambda-kinesis-event-source-rules.js +6 -0
  347. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-arn.d.ts +6 -1
  348. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-arn.js +8 -6
  349. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-rules.d.ts +10 -8
  350. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-rules.js +18 -1
  351. package/dist/service/lambda/function/code/sim-lambda-executable-code.d.ts +8 -2
  352. package/dist/service/lambda/function/code/sim-lambda-executable-code.js +2 -1
  353. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.d.ts +2 -11
  354. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.js +13 -39
  355. package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.d.ts +7 -0
  356. package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.js +13 -7
  357. package/dist/service/lambda/function/code/vm/sim-lambda-vm-handler-lookup.d.ts +23 -0
  358. package/dist/service/lambda/function/code/vm/sim-lambda-vm-handler-lookup.js +42 -0
  359. package/dist/service/lambda/function/code/vm/sim-lambda-vm-output-stream.d.ts +12 -4
  360. package/dist/service/lambda/function/code/vm/sim-lambda-vm-output-stream.js +15 -5
  361. package/dist/service/lambda/function/invoke/sim-lambda-host-scope.d.ts +7 -0
  362. package/dist/service/lambda/function/invoke/sim-lambda-host-scope.js +6 -2
  363. package/dist/service/lambda/function/invoke/sim-lambda-invocation-deadline.d.ts +26 -0
  364. package/dist/service/lambda/function/invoke/sim-lambda-invocation-deadline.js +84 -0
  365. package/dist/service/lambda/function/invoke/sim-lambda-invocation.d.ts +44 -0
  366. package/dist/service/lambda/function/invoke/sim-lambda-invocation.js +44 -0
  367. package/dist/service/lambda/function/invoke/sim-lambda-invoke-context-builder.d.ts +6 -0
  368. package/dist/service/lambda/function/invoke/sim-lambda-invoke-context-builder.js +1 -2
  369. package/dist/service/lambda/function/invoke/sim-lambda-process-output.d.ts +6 -1
  370. package/dist/service/lambda/function/invoke/sim-lambda-process-output.js +19 -6
  371. package/dist/service/lambda/function/invoke/sim-lambda-timed-out.error.d.ts +15 -0
  372. package/dist/service/lambda/function/invoke/sim-lambda-timed-out.error.js +18 -0
  373. package/dist/service/lambda/function/invoke/timer/sim-lambda-clear-timer.d.ts +12 -0
  374. package/dist/service/lambda/function/invoke/timer/sim-lambda-clear-timer.js +28 -0
  375. package/dist/service/lambda/function/invoke/timer/sim-lambda-clock-timer.d.ts +46 -0
  376. package/dist/service/lambda/function/invoke/timer/sim-lambda-clock-timer.js +104 -0
  377. package/dist/service/lambda/function/invoke/timer/sim-lambda-host-timers.d.ts +24 -0
  378. package/dist/service/lambda/function/invoke/timer/sim-lambda-host-timers.js +27 -0
  379. package/dist/service/lambda/function/invoke/timer/sim-lambda-invocation-timers.d.ts +43 -0
  380. package/dist/service/lambda/function/invoke/timer/sim-lambda-invocation-timers.js +112 -0
  381. package/dist/service/lambda/function/invoke/timer/sim-lambda-process-timers.d.ts +57 -0
  382. package/dist/service/lambda/function/invoke/timer/sim-lambda-process-timers.js +79 -0
  383. package/dist/service/lambda/function/invoke/timer/sim-lambda-timer-delay.d.ts +10 -0
  384. package/dist/service/lambda/function/invoke/timer/sim-lambda-timer-delay.js +15 -0
  385. package/dist/service/lambda/function/invoke/timer/sim-lambda-timer-global.d.ts +11 -0
  386. package/dist/service/lambda/function/invoke/timer/sim-lambda-timer-global.js +24 -0
  387. package/dist/service/lambda/function/invoke/timer/sim-lambda-timer-handle.d.ts +50 -0
  388. package/dist/service/lambda/function/invoke/timer/sim-lambda-timer-handle.js +43 -0
  389. package/dist/service/lambda/function/logging/sim-lambda-function-logging.d.ts +17 -0
  390. package/dist/service/lambda/function/logging/sim-lambda-function-logging.js +12 -1
  391. package/dist/service/lambda/function/logging/sim-lambda-output.d.ts +56 -0
  392. package/dist/service/lambda/function/logging/sim-lambda-output.js +62 -0
  393. package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.d.ts +8 -0
  394. package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.js +27 -1
  395. package/dist/service/lambda/function/sim-lambda-function.d.ts +1 -1
  396. package/dist/service/lambda/function/sim-lambda-function.js +11 -9
  397. package/dist/service/lambda/function/sim-lambda-function.type.d.ts +15 -0
  398. package/dist/service/lambda/function/url/sim-lambda-function-url-cors.d.ts +16 -0
  399. package/dist/service/lambda/function/url/sim-lambda-function-url-cors.factory.d.ts +22 -0
  400. package/dist/service/lambda/function/url/sim-lambda-function-url-cors.factory.js +17 -0
  401. package/dist/service/lambda/function/url/sim-lambda-function-url-cors.js +1 -0
  402. package/dist/service/lambda/function/url/sim-lambda-function-url-factory.d.ts +2 -0
  403. package/dist/service/lambda/function/url/sim-lambda-function-url-factory.js +2 -1
  404. package/dist/service/lambda/function/url/sim-lambda-function-url-store.d.ts +2 -0
  405. package/dist/service/lambda/function/url/sim-lambda-function-url.d.ts +16 -0
  406. package/dist/service/lambda/function/url/sim-lambda-function-url.js +16 -1
  407. package/dist/service/lambda/index.d.ts +1 -0
  408. package/dist/service/lambda/index.js +1 -0
  409. package/dist/service/lambda/serve/response/sim-lambda-url-cors-headers.d.ts +50 -0
  410. package/dist/service/lambda/serve/response/sim-lambda-url-cors-headers.js +96 -0
  411. package/dist/service/lambda/serve/sim-lambda-controller.d.ts +14 -0
  412. package/dist/service/lambda/serve/sim-lambda-controller.js +27 -0
  413. package/dist/service/lambda/sim-lambda-commands.d.ts +10 -0
  414. package/dist/service/lambda/sim-lambda-commands.js +11 -0
  415. package/dist/service/lambda/sim-lambda.d.ts +12 -0
  416. package/dist/service/lambda/sim-lambda.js +13 -0
  417. package/dist/service/s3/bucket/encryption/sim-s3-bucket-encryption.d.ts +67 -0
  418. package/dist/service/s3/bucket/encryption/sim-s3-bucket-encryption.js +69 -0
  419. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-configuration.d.ts +4 -31
  420. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-configuration.js +7 -6
  421. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-expiry.d.ts +5 -0
  422. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-expiry.js +8 -4
  423. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-selection.d.ts +1 -14
  424. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-selection.js +16 -8
  425. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-subject.d.ts +41 -0
  426. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-subject.js +1 -0
  427. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-sweep.d.ts +14 -0
  428. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-sweep.js +32 -2
  429. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-transition-instant.d.ts +33 -0
  430. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-transition-instant.js +48 -0
  431. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-transition.d.ts +16 -0
  432. package/dist/service/s3/bucket/lifecycle/sim-s3-lifecycle-transition.js +44 -0
  433. package/dist/service/s3/bucket/lifecycle/sim-s3-noncurrent-sweep.d.ts +8 -0
  434. package/dist/service/s3/bucket/lifecycle/sim-s3-noncurrent-sweep.js +27 -0
  435. package/dist/service/s3/bucket/notification/sim-s3-notification-event.d.ts +1 -1
  436. package/dist/service/s3/bucket/notification/sim-s3-notification-event.js +5 -0
  437. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-events.js +0 -3
  438. package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts +3 -0
  439. package/dist/service/s3/bucket/sim-s3-bucket-access.js +6 -2
  440. package/dist/service/s3/bucket/sim-s3-bucket-configuration.d.ts +84 -0
  441. package/dist/service/s3/bucket/sim-s3-bucket-configuration.js +115 -0
  442. package/dist/service/s3/bucket/sim-s3-bucket-maker.d.ts +31 -0
  443. package/dist/service/s3/bucket/sim-s3-bucket-maker.js +41 -0
  444. package/dist/service/s3/bucket/sim-s3-bucket-objects.d.ts +10 -0
  445. package/dist/service/s3/bucket/sim-s3-bucket-objects.js +18 -0
  446. package/dist/service/s3/bucket/sim-s3-bucket-properties.d.ts +41 -0
  447. package/dist/service/s3/bucket/sim-s3-bucket-properties.js +1 -0
  448. package/dist/service/s3/bucket/sim-s3-bucket.d.ts +11 -83
  449. package/dist/service/s3/bucket/sim-s3-bucket.js +14 -83
  450. package/dist/service/s3/bucket/sim-s3-public-read.fixture.d.ts +6 -0
  451. package/dist/service/s3/bucket/sim-s3-public-read.fixture.js +20 -6
  452. package/dist/service/s3/bucket/tagging/sim-s3-taggable-object.d.ts +58 -0
  453. package/dist/service/s3/bucket/tagging/sim-s3-taggable-object.js +73 -0
  454. package/dist/service/s3/bucket/versioning/sim-s3-object-version.d.ts +19 -1
  455. package/dist/service/s3/bucket/versioning/sim-s3-object-version.js +20 -0
  456. package/dist/service/s3/cfn/bucket/encryption/sim-cfn-s3-bucket-encryption.d.ts +21 -0
  457. package/dist/service/s3/cfn/bucket/encryption/sim-cfn-s3-bucket-encryption.js +44 -0
  458. package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-configuration.js +6 -0
  459. package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-fields.d.ts +5 -4
  460. package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-fields.js +12 -5
  461. package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-filter.d.ts +21 -0
  462. package/dist/service/s3/cfn/bucket/lifecycle/sim-cfn-s3-bucket-lifecycle-filter.js +30 -0
  463. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-configurator.js +1 -0
  464. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-declared-configurations.d.ts +14 -1
  465. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-declared-configurations.js +41 -16
  466. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-property-names.d.ts +3 -5
  467. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-property-names.js +7 -10
  468. package/dist/service/s3/command/authorize/sim-s3-authorize-action.d.ts +6 -1
  469. package/dist/service/s3/command/authorize/sim-s3-authorize-action.js +5 -0
  470. package/dist/service/s3/command/copy-object/copy-object-builder.d.ts +10 -1
  471. package/dist/service/s3/command/copy-object/copy-object-builder.js +17 -1
  472. package/dist/service/s3/command/copy-object/copy-object.command.d.ts +11 -1
  473. package/dist/service/s3/command/copy-object/copy-object.handler.js +2 -1
  474. package/dist/service/s3/command/create-bucket/create-bucket.handler.d.ts +2 -2
  475. package/dist/service/s3/command/create-bucket/create-bucket.handler.js +4 -12
  476. package/dist/service/s3/command/create-multipart-upload/create-multipart-upload.command.d.ts +5 -1
  477. package/dist/service/s3/command/create-multipart-upload/create-multipart-upload.handler.js +7 -0
  478. package/dist/service/s3/command/delete-bucket-encryption/delete-bucket-encryption.command.d.ts +19 -0
  479. package/dist/service/s3/command/delete-bucket-encryption/delete-bucket-encryption.command.js +1 -0
  480. package/dist/service/s3/command/delete-bucket-encryption/delete-bucket-encryption.handler.d.ts +30 -0
  481. package/dist/service/s3/command/delete-bucket-encryption/delete-bucket-encryption.handler.js +38 -0
  482. package/dist/service/s3/command/delete-object-tagging/delete-object-tagging.command.d.ts +23 -0
  483. package/dist/service/s3/command/delete-object-tagging/delete-object-tagging.command.js +1 -0
  484. package/dist/service/s3/command/delete-object-tagging/delete-object-tagging.handler.d.ts +22 -0
  485. package/dist/service/s3/command/delete-object-tagging/delete-object-tagging.handler.js +42 -0
  486. package/dist/service/s3/command/encryption/sim-s3-encryption-authorizer.d.ts +29 -0
  487. package/dist/service/s3/command/encryption/sim-s3-encryption-authorizer.js +49 -0
  488. package/dist/service/s3/command/encryption/sim-s3-encryption-commands.d.ts +22 -0
  489. package/dist/service/s3/command/encryption/sim-s3-encryption-commands.js +30 -0
  490. package/dist/service/s3/command/get-bucket-encryption/get-bucket-encryption.command.d.ts +24 -0
  491. package/dist/service/s3/command/get-bucket-encryption/get-bucket-encryption.command.js +1 -0
  492. package/dist/service/s3/command/get-bucket-encryption/get-bucket-encryption.handler.d.ts +31 -0
  493. package/dist/service/s3/command/get-bucket-encryption/get-bucket-encryption.handler.js +39 -0
  494. package/dist/service/s3/command/get-object/get-object-authorizer.d.ts +11 -8
  495. package/dist/service/s3/command/get-object/get-object-authorizer.js +26 -34
  496. package/dist/service/s3/command/get-object/get-object-loader.d.ts +7 -3
  497. package/dist/service/s3/command/get-object/get-object-loader.js +9 -4
  498. package/dist/service/s3/command/get-object/get-object.command.d.ts +2 -1
  499. package/dist/service/s3/command/get-object/get-object.handler.d.ts +4 -0
  500. package/dist/service/s3/command/get-object/get-object.handler.js +13 -7
  501. package/dist/service/s3/command/get-object-tagging/get-object-tagging.command.d.ts +29 -0
  502. package/dist/service/s3/command/get-object-tagging/get-object-tagging.command.js +1 -0
  503. package/dist/service/s3/command/get-object-tagging/get-object-tagging.handler.d.ts +21 -0
  504. package/dist/service/s3/command/get-object-tagging/get-object-tagging.handler.js +33 -0
  505. package/dist/service/s3/command/head-object/head-object-loader.js +2 -0
  506. package/dist/service/s3/command/head-object/head-object.command.d.ts +2 -1
  507. package/dist/service/s3/command/lifecycle/sim-s3-lifecycle-rules-validation.js +18 -0
  508. package/dist/service/s3/command/list-multipart-uploads/list-multipart-uploads.handler.js +1 -2
  509. package/dist/service/s3/command/list-object-versions/list-object-versions-summaries.js +1 -2
  510. package/dist/service/s3/command/list-objects/list-objects-page-builder.d.ts +5 -0
  511. package/dist/service/s3/command/list-objects/list-objects-page-builder.js +11 -6
  512. package/dist/service/s3/command/list-objects/list-objects.command.d.ts +5 -1
  513. package/dist/service/s3/command/list-objects/list-objects.handler.js +5 -0
  514. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.d.ts +6 -0
  515. package/dist/service/s3/command/list-objects-v2/list-objects-v2-page-builder.js +11 -5
  516. package/dist/service/s3/command/list-objects-v2/list-objects-v2.command.d.ts +5 -1
  517. package/dist/service/s3/command/list-objects-v2/list-objects-v2.handler.js +5 -0
  518. package/dist/service/s3/command/list-parts/list-parts.handler.js +3 -3
  519. package/dist/service/s3/command/multipart/sim-s3-multipart-access.js +1 -1
  520. package/dist/service/s3/command/put-bucket-encryption/put-bucket-encryption.command.d.ts +21 -0
  521. package/dist/service/s3/command/put-bucket-encryption/put-bucket-encryption.command.js +1 -0
  522. package/dist/service/s3/command/put-bucket-encryption/put-bucket-encryption.handler.d.ts +31 -0
  523. package/dist/service/s3/command/put-bucket-encryption/put-bucket-encryption.handler.js +41 -0
  524. package/dist/service/s3/command/put-object/put-object-builder.d.ts +5 -1
  525. package/dist/service/s3/command/put-object/put-object-builder.js +10 -1
  526. package/dist/service/s3/command/put-object/put-object.command.d.ts +5 -1
  527. package/dist/service/s3/command/put-object/put-object.handler.js +2 -1
  528. package/dist/service/s3/command/put-object-tagging/put-object-tagging.command.d.ts +37 -0
  529. package/dist/service/s3/command/put-object-tagging/put-object-tagging.command.js +1 -0
  530. package/dist/service/s3/command/put-object-tagging/put-object-tagging.handler.d.ts +22 -0
  531. package/dist/service/s3/command/put-object-tagging/put-object-tagging.handler.js +46 -0
  532. package/dist/service/s3/command/sim-s3-command.types.d.ts +6 -0
  533. package/dist/service/s3/command/tagging/sim-s3-object-tagging-access.d.ts +61 -0
  534. package/dist/service/s3/command/tagging/sim-s3-object-tagging-access.js +49 -0
  535. package/dist/service/s3/command/tagging/sim-s3-object-tagging-authorizer.d.ts +30 -0
  536. package/dist/service/s3/command/tagging/sim-s3-object-tagging-authorizer.js +27 -0
  537. package/dist/service/s3/command/tagging/sim-s3-object-tagging-commands.d.ts +26 -0
  538. package/dist/service/s3/command/tagging/sim-s3-object-tagging-commands.js +34 -0
  539. package/dist/service/s3/error/sim-s3-upload.error.d.ts +41 -0
  540. package/dist/service/s3/error/sim-s3-upload.error.js +47 -0
  541. package/dist/service/s3/error/sim-s3.error.d.ts +22 -34
  542. package/dist/service/s3/error/sim-s3.error.js +26 -40
  543. package/dist/service/s3/mount/sim-s3-mount.type.d.ts +10 -0
  544. package/dist/service/s3/notification/event/sim-s3-event-records.d.ts +3 -2
  545. package/dist/service/s3/notification/event/sim-s3-event-records.js +5 -3
  546. package/dist/service/s3/notification/event/sim-s3-object-event-builder.d.ts +33 -8
  547. package/dist/service/s3/notification/event/sim-s3-object-event-builder.js +23 -9
  548. package/dist/service/s3/notification/sim-s3-object-notifier.d.ts +5 -1
  549. package/dist/service/s3/notification/sim-s3-object-notifier.js +6 -0
  550. package/dist/service/s3/object/s3-key-encoding.d.ts +12 -0
  551. package/dist/service/s3/object/s3-key-encoding.js +14 -0
  552. package/dist/service/s3/object/s3-listing-encoding.d.ts +42 -0
  553. package/dist/service/s3/object/s3-listing-encoding.js +75 -0
  554. package/dist/service/s3/object/s3-object-response-headers.d.ts +40 -0
  555. package/dist/service/s3/object/s3-object-response-headers.js +49 -2
  556. package/dist/service/s3/object/s3-object-storage-report.d.ts +19 -0
  557. package/dist/service/s3/object/s3-object-storage-report.js +18 -0
  558. package/dist/service/s3/object/s3-object-summary.d.ts +2 -10
  559. package/dist/service/s3/object/s3-object-summary.js +1 -10
  560. package/dist/service/s3/object/s3-object-tags.d.ts +61 -0
  561. package/dist/service/s3/object/s3-object-tags.js +77 -0
  562. package/dist/service/s3/object/s3-object.d.ts +49 -0
  563. package/dist/service/s3/object/s3-object.js +52 -1
  564. package/dist/service/s3/object/s3-server-side-encryption.d.ts +30 -0
  565. package/dist/service/s3/object/s3-server-side-encryption.js +42 -0
  566. package/dist/service/s3/object/s3-storage-class.d.ts +45 -0
  567. package/dist/service/s3/object/s3-storage-class.js +67 -0
  568. package/dist/service/s3/object/s3-write-metadata.d.ts +17 -3
  569. package/dist/service/s3/object/s3-write-metadata.js +43 -0
  570. package/dist/service/s3/object/s3-write-storage.d.ts +27 -0
  571. package/dist/service/s3/object/s3-write-storage.js +21 -0
  572. package/dist/service/s3/object/s3-write-tagging.d.ts +24 -0
  573. package/dist/service/s3/object/s3-write-tagging.js +19 -0
  574. package/dist/service/s3/sdk/sim-s3-sdk-bucket-routes.js +12 -0
  575. package/dist/service/s3/sdk/sim-s3-sdk-command-router.js +2 -0
  576. package/dist/service/s3/sdk/sim-s3-sdk-object-tagging-routes.d.ts +9 -0
  577. package/dist/service/s3/sdk/sim-s3-sdk-object-tagging-routes.js +23 -0
  578. package/dist/service/s3/serve/api/sim-s3-api-bucket-routes.js +22 -0
  579. package/dist/service/s3/serve/api/sim-s3-api-configuration-output.d.ts +4 -0
  580. package/dist/service/s3/serve/api/sim-s3-api-configuration-output.js +10 -0
  581. package/dist/service/s3/serve/api/sim-s3-api-encryption-read.d.ts +7 -0
  582. package/dist/service/s3/serve/api/sim-s3-api-encryption-read.js +30 -0
  583. package/dist/service/s3/serve/api/sim-s3-api-head-output.d.ts +4 -2
  584. package/dist/service/s3/serve/api/sim-s3-api-head-output.js +8 -2
  585. package/dist/service/s3/serve/api/sim-s3-api-input.d.ts +0 -6
  586. package/dist/service/s3/serve/api/sim-s3-api-input.js +2 -13
  587. package/dist/service/s3/serve/api/sim-s3-api-listing.d.ts +5 -0
  588. package/dist/service/s3/serve/api/sim-s3-api-listing.js +5 -0
  589. package/dist/service/s3/serve/api/sim-s3-api-object-input.d.ts +16 -0
  590. package/dist/service/s3/serve/api/sim-s3-api-object-input.js +34 -7
  591. package/dist/service/s3/serve/api/sim-s3-api-object-output.d.ts +18 -1
  592. package/dist/service/s3/serve/api/sim-s3-api-object-output.js +21 -2
  593. package/dist/service/s3/serve/api/sim-s3-api-object-routes.js +22 -1
  594. package/dist/service/s3/serve/api/sim-s3-api-output.d.ts +5 -1
  595. package/dist/service/s3/serve/api/sim-s3-api-output.js +16 -5
  596. package/dist/service/s3/serve/api/sim-s3-api-request.d.ts +6 -5
  597. package/dist/service/s3/serve/api/sim-s3-api-request.js +55 -11
  598. package/dist/service/s3/serve/api/sim-s3-api-routes.js +2 -2
  599. package/dist/service/s3/serve/api/sim-s3-api-tagging-read.d.ts +9 -0
  600. package/dist/service/s3/serve/api/sim-s3-api-tagging-read.js +14 -0
  601. package/dist/service/s3/serve/api/sim-s3-api.d.ts +7 -1
  602. package/dist/service/s3/serve/api/sim-s3-api.js +7 -1
  603. package/dist/service/s3/serve/sim-s3-rest-controller.d.ts +1 -5
  604. package/dist/service/s3/serve/sim-s3-rest-controller.js +3 -17
  605. package/dist/service/s3/serve/sim-s3-rest-object-reader.d.ts +3 -0
  606. package/dist/service/s3/serve/sim-s3-rest-object-reader.js +8 -1
  607. package/dist/service/s3/serve/sim-s3-rest-upload.d.ts +20 -0
  608. package/dist/service/s3/serve/sim-s3-rest-upload.js +30 -0
  609. package/dist/service/s3/serve/website/sim-s3-website-object-loader.js +1 -0
  610. package/dist/service/s3/serve/website/sim-s3-website-object.d.ts +2 -0
  611. package/dist/service/s3/serve/website/sim-s3-website-object.js +3 -0
  612. package/dist/service/s3/sim-s3-commands.d.ts +10 -0
  613. package/dist/service/s3/sim-s3-commands.js +13 -0
  614. package/dist/service/s3/sim-s3-operations.d.ts +11 -4
  615. package/dist/service/s3/sim-s3-operations.js +17 -4
  616. package/dist/service/s3/sim-s3-tagging-operations.d.ts +21 -0
  617. package/dist/service/s3/sim-s3-tagging-operations.js +25 -0
  618. package/dist/service/s3/sim-s3.d.ts +28 -0
  619. package/dist/service/s3/sim-s3.js +38 -0
  620. package/dist/service/s3/storage/filesystem/s3-filesystem-deleting-storage.d.ts +34 -0
  621. package/dist/service/s3/storage/filesystem/s3-filesystem-deleting-storage.js +34 -0
  622. package/dist/service/s3/storage/filesystem/s3-filesystem-deletion.d.ts +9 -0
  623. package/dist/service/s3/storage/filesystem/s3-filesystem-deletion.js +24 -0
  624. package/dist/service/s3/storage/filesystem/s3-filesystem-storage.d.ts +5 -4
  625. package/dist/service/s3/storage/filesystem/s3-filesystem-storage.js +5 -3
  626. package/dist/service/s3/upload/sim-s3-completed-upload.js +5 -1
  627. package/dist/service/s3/upload/sim-s3-multipart-upload.d.ts +18 -0
  628. package/dist/service/s3/upload/sim-s3-multipart-upload.js +8 -0
  629. package/dist/service/s3/upload/sim-s3-multipart-uploads.d.ts +6 -0
  630. package/dist/service/s3/upload/sim-s3-multipart-uploads.js +5 -0
  631. package/dist/util/background/background-clock-waits.d.ts +52 -0
  632. package/dist/util/background/background-clock-waits.js +76 -0
  633. package/dist/util/background/background-jitter.js +1 -0
  634. package/dist/util/background/background-pending-tasks.d.ts +55 -0
  635. package/dist/util/background/background-pending-tasks.js +117 -0
  636. package/dist/util/background/background-settled-tasks.d.ts +4 -1
  637. package/dist/util/background/background-settled-tasks.js +4 -1
  638. package/dist/util/background/background.d.ts +43 -0
  639. package/dist/util/background/background.js +27 -19
  640. package/dist/util/background/non-deterministic-background.d.ts +12 -0
  641. package/dist/util/background/non-deterministic-background.js +24 -20
  642. package/dist/util/clock/sim-clock-control.js +23 -2
  643. package/docs/services/apigateway/README.md +3 -1
  644. package/docs/services/athena/README.md +126 -3
  645. package/docs/services/cloudformation/README.md +831 -67
  646. package/docs/services/cognito/README.md +5 -0
  647. package/docs/services/dynamodb/README.md +86 -11
  648. package/docs/services/lambda/README.md +603 -39
  649. package/docs/services/s3/README.md +688 -57
  650. package/package.json +8 -2
@@ -132,6 +132,66 @@ console.log(describeOutput.Stacks?.[0]?.StackStatus);
132
132
  continues asynchronously, similar to real CloudFormation. Use `waitForStackDeployComplete(...)` when
133
133
  you need final stack state.
134
134
 
135
+ ## Stack IDs
136
+
137
+ A stack is given a stack ID when it is created, in the ARN shape CloudFormation gives one:
138
+
139
+ ```
140
+ arn:aws:cloudformation:<region>:<account>:stack/<name>/<uuid>
141
+ ```
142
+
143
+ The account and region are the ones the stack was created in. The UUID on the end is generated for
144
+ each stack. Deploying the same name a second time produces a stack with an ID of its own.
145
+
146
+ `CreateStackCommand` and `UpdateStackCommand` answer with the ID, `DescribeStacksCommand` reports it
147
+ as `StackId`, and a template reading `AWS::StackId` resolves to it. `AWS::StackName` still resolves
148
+ to the name. A `CREATE` change set makes the ID along with the stack it puts into review, and the
149
+ change set commands report it as `StackId` too.
150
+
151
+ `DescribeStacksCommand` accepts either a stack name or a stack ID in `StackName`, as CloudFormation
152
+ does. A stack ID goes on working once the stack has been deleted (its name does not).
153
+
154
+ ```typescript sim-cloudformation-stack-id
155
+ /**
156
+ * Describing a deleted simulated CloudFormation Stack by its Stack ID.
157
+ */
158
+
159
+ import {
160
+ CreateStackCommand,
161
+ DeleteStackCommand,
162
+ DescribeStacksCommand,
163
+ } from "@aws-sdk/client-cloudformation";
164
+
165
+ import { SimAws } from "@kensio/yulin";
166
+
167
+ const simAws = new SimAws();
168
+ const simCfn = simAws.cloudFormation();
169
+
170
+ const created = await simCfn.createStack(
171
+ new CreateStackCommand({
172
+ StackName: "identified-stack",
173
+ TemplateBody: JSON.stringify({ Resources: {} }),
174
+ }),
175
+ );
176
+
177
+ // arn:aws:cloudformation:<region>:<account>:stack/identified-stack/<uuid>
178
+ console.log(created.StackId);
179
+
180
+ await simCfn.waitForStackDeployComplete("identified-stack");
181
+
182
+ await simCfn.deleteStack(
183
+ new DeleteStackCommand({ StackName: "identified-stack" }),
184
+ );
185
+ await simCfn.waitForStackDeleteComplete("identified-stack");
186
+
187
+ const described = await simCfn.describeStacks(
188
+ new DescribeStacksCommand({ StackName: created.StackId }),
189
+ );
190
+
191
+ // DELETE_COMPLETE
192
+ console.log(described.Stacks?.[0]?.StackStatus);
193
+ ```
194
+
135
195
  ## Stack deployment is asynchronous
136
196
 
137
197
  A stack may be visible before all resources have finished creating.
@@ -302,6 +362,78 @@ A template that changes nothing at all is refused with a `ValidationError` readi
302
362
  `No updates are to be performed.`, the same answer CloudFormation gives. So is an update asked for
303
363
  while another is still running.
304
364
 
365
+ ### Updating without the whole template
366
+
367
+ `UsePreviousTemplate: true` updates the stack from the template it already holds. That is how a
368
+ parameter value is changed on its own, when the caller has no copy of the template body to hand.
369
+ Sending a `TemplateBody` alongside it is refused with a `ValidationError`, the way CloudFormation
370
+ refuses it.
371
+
372
+ A parameter carrying `UsePreviousValue: true` takes the value the stack was deployed with. Sending a
373
+ `ParameterValue` for that same parameter is refused the same way. A parameter the stack was deployed
374
+ without takes its template `Default` again.
375
+
376
+ ```typescript sim-cloudformation-update-previous-template
377
+ /**
378
+ * Changing one parameter value without resending the template.
379
+ */
380
+
381
+ import {
382
+ CreateStackCommand,
383
+ UpdateStackCommand,
384
+ } from "@aws-sdk/client-cloudformation";
385
+
386
+ import { SimAws } from "@kensio/yulin";
387
+
388
+ const simAws = new SimAws();
389
+ const simCfn = simAws.cloudFormation();
390
+
391
+ await simCfn.createStack(
392
+ new CreateStackCommand({
393
+ StackName: "reports",
394
+ TemplateBody: JSON.stringify({
395
+ Parameters: {
396
+ Environment: { Type: "String" },
397
+ Version: { Type: "String" },
398
+ },
399
+ Resources: {
400
+ ReportsBucket: {
401
+ Type: "AWS::S3::Bucket",
402
+ Properties: {
403
+ // eslint-disable-next-line no-template-curly-in-string
404
+ BucketName: { "Fn::Sub": "reports-${Environment}-${Version}" },
405
+ },
406
+ },
407
+ },
408
+ }),
409
+ Parameters: [
410
+ { ParameterKey: "Environment", ParameterValue: "staging" },
411
+ { ParameterKey: "Version", ParameterValue: "one" },
412
+ ],
413
+ }),
414
+ );
415
+ await simCfn.waitForStackDeployComplete("reports");
416
+
417
+ // Only the version moves. The template and the environment stay where the
418
+ // deployment put them.
419
+ await simCfn.updateStack(
420
+ new UpdateStackCommand({
421
+ StackName: "reports",
422
+ UsePreviousTemplate: true,
423
+ Parameters: [
424
+ { ParameterKey: "Environment", UsePreviousValue: true },
425
+ { ParameterKey: "Version", ParameterValue: "two" },
426
+ ],
427
+ }),
428
+ );
429
+ await simCfn.waitForStackUpdateComplete("reports");
430
+
431
+ console.log(simAws.s3().getSimBucketByName("reports-staging-two"));
432
+ ```
433
+
434
+ An update from the held template with the deployed values changes nothing, and is refused with
435
+ `No updates are to be performed.` like any other.
436
+
305
437
  ### Changed resources are replaced
306
438
 
307
439
  A resource whose template entry changed is deleted and created again from the new template. Real
@@ -309,20 +441,297 @@ CloudFormation updates most properties in place and keeps what the resource hold
309
441
  divergence worth knowing about. A bucket that gains a property loses its objects here, where in AWS
310
442
  it would keep them. In-place update is the obvious next step, still to be built.
311
443
 
312
- Two things follow from replacement:
444
+ Three things follow from replacement:
313
445
 
314
446
  - A resource naming a replaced resource is replaced too, all the way up the dependency chain, and
315
447
  nothing is left pointing at a resource that has gone. Real CloudFormation hands the dependent the
316
448
  new physical name and leaves it standing.
317
- - `UpdateReplacePolicy` is not read. Honouring `Retain` would leave the old resource holding the
318
- name the replacement needs, and CDK marks buckets and tables with it as a matter of course, so
319
- every such update would fail. The old resource is deleted whatever the policy says.
449
+ - A resource declared with `UpdateReplacePolicy: Retain` is kept, and the replacement is created
450
+ beside it. See [`UpdateReplacePolicy`](#updatereplacepolicy) below.
451
+ - A resource a failed update had already replaced comes back empty when the stack is rolled back.
452
+ The deployed one was deleted to make room for the replacement, and there is nothing left to put
453
+ back. See [rolling back a failed update](#rolling-back-a-failed-update) below.
454
+
455
+ ### Rolling back a failed update
456
+
457
+ A failed update is rolled back onto the template the stack was deployed from. The stack moves to
458
+ `UPDATE_ROLLBACK_IN_PROGRESS`, the previous template is applied over whatever the update left
459
+ behind, and the stack settles in `UPDATE_ROLLBACK_COMPLETE`. `DescribeStacksCommand` reports each of
460
+ those statuses as the stack reaches it, with the reason the update stopped as `StackStatusReason`.
461
+ `waitForStackUpdateComplete(...)` waits for the rollback and then rethrows the update's error.
462
+
463
+ ```typescript sim-cloudformation-update-rollback
464
+ /**
465
+ * Rolling a failed stack update back to the deployed template.
466
+ */
467
+
468
+ import {
469
+ CreateStackCommand,
470
+ DescribeStacksCommand,
471
+ UpdateStackCommand,
472
+ } from "@aws-sdk/client-cloudformation";
473
+
474
+ import { SimAws } from "@kensio/yulin";
475
+
476
+ const simAws = new SimAws();
477
+ const simCfn = simAws.cloudFormation();
478
+
479
+ await simCfn.createStack(
480
+ new CreateStackCommand({
481
+ StackName: "reports",
482
+ TemplateBody: JSON.stringify({
483
+ Resources: {
484
+ ReportsBucket: {
485
+ Type: "AWS::S3::Bucket",
486
+ Properties: { BucketName: "reports-2025" },
487
+ },
488
+ },
489
+ }),
490
+ }),
491
+ );
492
+ await simCfn.waitForStackDeployComplete("reports");
493
+
494
+ // This update renames the bucket and asks for one S3 will not create.
495
+ await simCfn.updateStack(
496
+ new UpdateStackCommand({
497
+ StackName: "reports",
498
+ TemplateBody: JSON.stringify({
499
+ Resources: {
500
+ ReportsBucket: {
501
+ Type: "AWS::S3::Bucket",
502
+ Properties: { BucketName: "reports-2026" },
503
+ },
504
+ ArchiveBucket: {
505
+ Type: "AWS::S3::Bucket",
506
+ Properties: { BucketName: "Invalid_Bucket_Name" },
507
+ },
508
+ },
509
+ }),
510
+ }),
511
+ );
512
+
513
+ try {
514
+ await simCfn.waitForStackUpdateComplete("reports");
515
+ } catch (error) {
516
+ console.error("Stack update failed", error);
517
+ }
518
+
519
+ const described = await simCfn.describeStacks(
520
+ new DescribeStacksCommand({ StackName: "reports" }),
521
+ );
522
+
523
+ console.log(described.Stacks?.[0]?.StackStatus);
524
+ // "UPDATE_ROLLBACK_COMPLETE"
525
+
526
+ // The bucket the deployed template describes is back in simulated S3.
527
+ console.log(simAws.s3().getSimBucketByName("reports-2025"));
528
+ ```
529
+
530
+ The difference the rollback applies is worked out from the resources the stack holds when the update
531
+ stops. A failure part way through is reconciled from where it got to, and an update that failed
532
+ before it touched a resource has nothing to undo.
533
+
534
+ A rollback that cannot finish leaves the stack in `UPDATE_ROLLBACK_FAILED`, with its own failure as
535
+ the reason. `UpdateReplacePolicy: Retain` on a replaced resource is one way to reach that. The kept
536
+ resource still holds the name, and the rollback asks for that name again when it recreates the
537
+ resource the deployed template describes.
538
+
539
+ Dealing with the cause and sending `UpdateStackCommand` again applies the change to the rolled-back
540
+ stack.
541
+
542
+ ### `UpdateReplacePolicy`
543
+
544
+ A resource declared with `UpdateReplacePolicy: Retain` is left in simulated AWS when an update
545
+ replaces it. The stack stops tracking it, the replacement takes over its logical ID, and the kept
546
+ resource is reported on the stack the way a retained resource is after a teardown.
547
+
548
+ ```typescript sim-cloudformation-update-replace-policy
549
+ /**
550
+ * Keeping a Resource an update replaces.
551
+ */
552
+
553
+ import {
554
+ CreateStackCommand,
555
+ UpdateStackCommand,
556
+ } from "@aws-sdk/client-cloudformation";
557
+
558
+ import { SimAws } from "@kensio/yulin";
559
+
560
+ const simAws = new SimAws();
561
+ const simCfn = simAws.cloudFormation();
562
+
563
+ function reportsTemplate(bucketName: string): string {
564
+ return JSON.stringify({
565
+ Resources: {
566
+ ReportsBucket: {
567
+ Type: "AWS::S3::Bucket",
568
+ UpdateReplacePolicy: "Retain",
569
+ Properties: { BucketName: bucketName },
570
+ },
571
+ },
572
+ });
573
+ }
574
+
575
+ await simCfn.createStack(
576
+ new CreateStackCommand({
577
+ StackName: "reports",
578
+ TemplateBody: reportsTemplate("reports-2025"),
579
+ }),
580
+ );
581
+ await simCfn.waitForStackDeployComplete("reports");
582
+
583
+ // Renaming the bucket replaces it.
584
+ await simCfn.updateStack(
585
+ new UpdateStackCommand({
586
+ StackName: "reports",
587
+ TemplateBody: reportsTemplate("reports-2026"),
588
+ }),
589
+ );
590
+ await simCfn.waitForStackUpdateComplete("reports");
591
+
592
+ // The bucket the update replaced is still in simulated S3.
593
+ console.log(simAws.s3().getSimBucketByName("reports-2025"));
594
+
595
+ // And so is the one created in its place.
596
+ console.log(simAws.s3().getSimBucketByName("reports-2026"));
597
+
598
+ // The stack reports what it kept.
599
+ const stack = simCfn.getStackByName("reports");
600
+ console.log(stack?.retainedResources.map((resource) => resource.logicalId));
601
+ ```
602
+
603
+ The attribute is read from the template being applied, which is where CloudFormation reads it. An
604
+ update that adds `UpdateReplacePolicy: Retain` keeps the resource it replaces, and one that drops
605
+ the attribute deletes it.
606
+
607
+ `DeletionPolicy` has no say in this. CloudFormation reads `DeletionPolicy` for a resource an update
608
+ drops from the template, and `UpdateReplacePolicy` for one it replaces. A bucket marked only with
609
+ `DeletionPolicy: Retain` still goes when its replacement is created. `Snapshot` is treated as
610
+ `Delete`, because no simulated service takes snapshots.
611
+
612
+ The kept resource holds the name it was created with. Real CloudFormation gives the replacement a
613
+ fresh random name, while simulated CloudFormation generates the same name for the same stack name
614
+ and logical ID every time (see
615
+ [names CloudFormation generates](#names-cloudformation-generates)). A replacement whose name the
616
+ template leaves to CloudFormation therefore asks for a name the kept resource still holds, and fails
617
+ to create. Name the replacement in the template, as the example above does, to have both.
618
+
619
+ ## Deploying through a change set
620
+
621
+ A change set says what a template would do to a stack before anything happens to it. `cdk deploy`
622
+ goes through one by default, and so does any deployment script that wants to see what an update will
623
+ touch. Simulated CloudFormation serves `CreateChangeSetCommand`, `DescribeChangeSetCommand`,
624
+ `ExecuteChangeSetCommand`, `DeleteChangeSetCommand` and `ListChangeSetsCommand`.
625
+
626
+ ```typescript sim-cloudformation-change-set
627
+ /**
628
+ * Deploying a simulated CloudFormation Stack through a change set.
629
+ */
630
+
631
+ import {
632
+ CreateChangeSetCommand,
633
+ DescribeChangeSetCommand,
634
+ ExecuteChangeSetCommand,
635
+ } from "@aws-sdk/client-cloudformation";
636
+
637
+ import { SimAws } from "@kensio/yulin";
638
+
639
+ const simAws = new SimAws();
640
+ const simCfn = simAws.cloudFormation();
641
+
642
+ const templateBody = JSON.stringify({
643
+ Resources: {
644
+ ReportsBucket: {
645
+ Type: "AWS::S3::Bucket",
646
+ Properties: { BucketName: "change-set-reports" },
647
+ },
648
+ },
649
+ });
650
+
651
+ // A CREATE change set brings the Stack into being in REVIEW_IN_PROGRESS,
652
+ // holding no created Resources.
653
+ await simCfn.createChangeSet(
654
+ new CreateChangeSetCommand({
655
+ StackName: "reports-stack",
656
+ ChangeSetName: "reports-create",
657
+ ChangeSetType: "CREATE",
658
+ TemplateBody: templateBody,
659
+ }),
660
+ );
661
+
662
+ // Describing it says what executing it would do. Nothing is deployed yet.
663
+ const described = await simCfn.describeChangeSet(
664
+ new DescribeChangeSetCommand({
665
+ StackName: "reports-stack",
666
+ ChangeSetName: "reports-create",
667
+ }),
668
+ );
669
+
670
+ // [{ Action: "Add", LogicalResourceId: "ReportsBucket" }]
671
+ console.log(
672
+ described.Changes?.map((change) => ({
673
+ Action: change.ResourceChange.Action,
674
+ LogicalResourceId: change.ResourceChange.LogicalResourceId,
675
+ })),
676
+ );
677
+
678
+ // Executing it deploys the template.
679
+ await simCfn.executeChangeSet(
680
+ new ExecuteChangeSetCommand({
681
+ StackName: "reports-stack",
682
+ ChangeSetName: "reports-create",
683
+ }),
684
+ );
685
+ await simCfn.waitForStackDeployComplete("reports-stack");
686
+
687
+ console.log(simAws.s3().getSimBucketByName("change-set-reports"));
688
+ ```
689
+
690
+ `ChangeSetType: CREATE` creates the stack in `REVIEW_IN_PROGRESS` and creates none of its resources.
691
+ `DescribeStacksCommand` reports the stack from that point on, and executing the change set is what
692
+ deploys it. The default, `ChangeSetType: UPDATE`, works out the change against a stack that is
693
+ already deployed and leaves it exactly as it is until the change set is executed.
694
+
695
+ `CreateChangeSetCommand` returns the change set ARN as `Id`. Every command naming a change set takes
696
+ either that ARN on its own or the change set name together with `StackName`, the way CloudFormation
697
+ takes them.
698
+
699
+ ### What a change set reports
700
+
701
+ `DescribeChangeSetCommand` answers with one `Changes` entry per resource, each carrying a
702
+ `ResourceChange` with its `Action`, `LogicalResourceId`, `ResourceType` and `Replacement`. A resource
703
+ only the new template has is an `Add`, one only the stack has is a `Remove`, and one both have whose
704
+ template entry changed is a `Modify`.
705
+
706
+ Every `Modify` carries `Replacement: "True"`. Simulated CloudFormation replaces a changed resource
707
+ rather than updating it in place, and it replaces everything naming a replaced resource as well, so a
708
+ change set reports each of those as a modification too. See
709
+ [changed resources are replaced](#changed-resources-are-replaced) for what that costs.
320
710
 
321
- A failed update leaves the stack in `UPDATE_FAILED` with the reason on it, and leaves the resources
322
- where the update got to. There is no rollback to the previous template.
323
- `waitForStackUpdateComplete(...)` rethrows the error, and `DescribeStacksCommand` reports it as
324
- `StackStatusReason`. Dealing with the cause and sending `UpdateStackCommand` again applies the rest
325
- of the change.
711
+ A change set describing a template the stack already holds is `FAILED`, carrying the reason
712
+ CloudFormation gives, and refuses to execute. That is the same no-op rule an update follows, so a
713
+ template that only moves an output still has something to execute.
714
+
715
+ ### Executing a change set
716
+
717
+ `executeChangeSet(...)` returns once the stack operation has started, as `createStack(...)` and
718
+ `updateStack(...)` do. Follow it with `waitForStackDeployComplete(...)` for a `CREATE` change set or
719
+ `waitForStackUpdateComplete(...)` for an `UPDATE` one.
720
+
721
+ The change set reports its own execution through `ExecutionStatus`. It reads `AVAILABLE` before,
722
+ `EXECUTE_IN_PROGRESS` while the stack operation runs, and `EXECUTE_COMPLETE` or `EXECUTE_FAILED`
723
+ after. Every other executable change set against the same stack becomes `OBSOLETE`, because each was
724
+ worked out against a stack the execution has moved on.
725
+
726
+ A change set whose stack has moved on since it was created is refused as `OBSOLETE`, which is what
727
+ CloudFormation calls a change set whose stack was already updated. An update sent directly, and
728
+ another change set executed first, both leave it there. Executing it would apply a difference nobody
729
+ has seen, because what it reports was worked out against the template the stack held then.
730
+
731
+ `DeleteChangeSetCommand` takes a change set away without executing it, and a change set name that is
732
+ not there is a success rather than an error. Every other command naming one that is not there is
733
+ refused with a `ChangeSetNotFoundException`. `ListChangeSetsCommand` reports the ones a stack still
734
+ holds, in the order they were created.
326
735
 
327
736
  ## Deleting a stack
328
737
 
@@ -385,7 +794,8 @@ Deletion runs in the background, as deployment does. `deleteStack(...)` returns
385
794
  moved to `DELETE_IN_PROGRESS`, and `waitForStackDeleteComplete(...)` waits for the resources to go.
386
795
  `DescribeStacksCommand` reports `DELETE_IN_PROGRESS` in between, and then refuses the stack name with
387
796
  a `ValidationError` once the deletion has finished. That is how CloudFormation answers a name it no
388
- longer holds.
797
+ longer holds. The stack itself is still there under its
798
+ [stack ID](#stack-ids), reporting `DELETE_COMPLETE` and the Outputs it finished with.
389
799
 
390
800
  Deleting a stack name that was never deployed succeeds, as it does in CloudFormation.
391
801
 
@@ -413,6 +823,77 @@ Retained resources are readable from the stack:
413
823
  console.log(stack.retainedResources.map((resource) => resource.logicalId));
414
824
  ```
415
825
 
826
+ ### `RetainResources`
827
+
828
+ `DeleteStackCommand` takes `RetainResources`, naming resources to leave in simulated AWS. Each one
829
+ is kept whatever its own `DeletionPolicy` says, and the stack deletes around it and reaches
830
+ `DELETE_COMPLETE`.
831
+
832
+ ```typescript sim-cloudformation-retain-resources
833
+ /**
834
+ * Keeping named Resources when a Stack is deleted.
835
+ */
836
+
837
+ import {
838
+ CreateStackCommand,
839
+ DeleteStackCommand,
840
+ } from "@aws-sdk/client-cloudformation";
841
+ import { PutObjectCommand } from "@aws-sdk/client-s3";
842
+
843
+ import { SimAws } from "@kensio/yulin";
844
+
845
+ const simAws = new SimAws();
846
+ const simCfn = simAws.cloudFormation();
847
+
848
+ await simCfn.createStack(
849
+ new CreateStackCommand({
850
+ StackName: "reports-stack",
851
+ TemplateBody: JSON.stringify({
852
+ Resources: {
853
+ ReportsBucket: {
854
+ Type: "AWS::S3::Bucket",
855
+ Properties: { BucketName: "reports" },
856
+ },
857
+ ArchiveBucket: {
858
+ Type: "AWS::S3::Bucket",
859
+ Properties: { BucketName: "archive" },
860
+ },
861
+ },
862
+ }),
863
+ }),
864
+ );
865
+ await simCfn.waitForStackDeployComplete("reports-stack");
866
+
867
+ await simAws.s3().putObject(
868
+ new PutObjectCommand({
869
+ Bucket: "reports",
870
+ Key: "january.csv",
871
+ Body: "reported",
872
+ }),
873
+ );
874
+
875
+ await simCfn.deleteStack(
876
+ new DeleteStackCommand({
877
+ StackName: "reports-stack",
878
+ RetainResources: ["ReportsBucket"],
879
+ }),
880
+ );
881
+ await simCfn.waitForStackDeleteComplete("reports-stack");
882
+
883
+ // The named bucket is still in simulated S3, with the object it held.
884
+ console.log(simAws.s3().getSimBucketByName("reports"));
885
+
886
+ // The bucket the call did not name has gone.
887
+ console.log(simAws.s3().getSimBucketByName("archive"));
888
+ ```
889
+
890
+ Keeping a bucket that holds objects is one reason to reach for this. S3 refuses to delete such a
891
+ bucket, which fails the whole teardown, and naming it here steps over it.
892
+
893
+ A name the stack has no resource for is refused with a `ValidationError`, as CloudFormation refuses
894
+ one. A CDK construct ID resolves here as well as a logical ID, the same way `stack.getResource(...)`
895
+ takes either.
896
+
416
897
  ## Parameters
417
898
 
418
899
  Template parameters can be supplied when creating a stack.
@@ -771,6 +1252,23 @@ The value a lookup returns can be any type. A list value is returned as a list.
771
1252
  used in resource properties and in `Outputs`. A map name or key missing from `Mappings` fails the
772
1253
  deployment with an error naming the path that could not be found.
773
1254
 
1255
+ A fourth argument of `{ "DefaultValue": ... }` gives the lookup an answer for that case.
1256
+
1257
+ ```json
1258
+ {
1259
+ "Fn::FindInMap": [
1260
+ "EnvironmentMap",
1261
+ { "Ref": "Environment" },
1262
+ "BucketName",
1263
+ { "DefaultValue": "fallback-site-bucket" }
1264
+ ]
1265
+ }
1266
+ ```
1267
+
1268
+ The default answers a map name, a top-level key or a second-level key the `Mappings` section does
1269
+ not carry. It is a template value like any other, so it can itself be a `Ref` or a nested
1270
+ expression. A lookup that finds its value in the map ignores the default.
1271
+
774
1272
  ### `Fn::Split` and `Fn::Select`
775
1273
 
776
1274
  `Fn::Split` cuts a string into a list on a delimiter. `Fn::Select` reads one value out of a list by
@@ -1002,10 +1500,10 @@ console.log(stack.getResource("Backups") !== undefined);
1002
1500
 
1003
1501
  ### Writing a condition
1004
1502
 
1005
- A condition is built from `Fn::Equals`, `Fn::And`, `Fn::Or` and `Fn::Not`. `Fn::And` and `Fn::Or`
1006
- take a list of two to ten conditions, and `Fn::Not` takes a list of exactly one. A condition can
1007
- name another condition with `{ "Condition": "OtherCondition" }`, in any order, so a condition may
1008
- name one written below it in the section.
1503
+ A condition is built from `Fn::Equals`, `Fn::And`, `Fn::Or`, `Fn::Not` and `Fn::If`. `Fn::And` and
1504
+ `Fn::Or` take a list of two to ten conditions, and `Fn::Not` takes a list of exactly one. A
1505
+ condition can name another condition with `{ "Condition": "OtherCondition" }`, in any order, so a
1506
+ condition may name one written below it in the section.
1009
1507
 
1010
1508
  ```json
1011
1509
  {
@@ -1020,9 +1518,27 @@ name one written below it in the section.
1020
1518
  `Fn::Equals` compares its two values as strings, as CloudFormation does. A JSON number in the
1021
1519
  template matches the string a parameter carries.
1022
1520
 
1521
+ An `Fn::If` inside the section takes a condition name and two conditions, and evaluates whichever
1522
+ one the named condition selects. The condition it names can be written anywhere in the section.
1523
+
1524
+ ```json
1525
+ {
1526
+ "IsProd": { "Fn::Equals": [{ "Ref": "EnvName" }, "prod"] },
1527
+ "IsBackedUp": {
1528
+ "Fn::If": [
1529
+ "IsProd",
1530
+ { "Fn::Equals": [{ "Ref": "BackupPlan" }, "nightly"] },
1531
+ { "Fn::Equals": ["never", "nightly"] }
1532
+ ]
1533
+ }
1534
+ }
1535
+ ```
1536
+
1023
1537
  The whole section is evaluated once per deployment, before any resource is created. A condition can
1024
1538
  read parameters and pseudo parameters and nothing else. A comparison that would need a created
1025
- resource, such as an `Fn::GetAtt`, fails the deployment rather than reading as false.
1539
+ resource, such as an `Fn::GetAtt`, fails the deployment rather than reading as false. A condition
1540
+ that closes a cycle through `{ "Condition": ... }` or `Fn::If` fails the deployment naming the route
1541
+ it took back to itself.
1026
1542
 
1027
1543
  ### `Fn::If`
1028
1544
 
@@ -1046,6 +1562,15 @@ fails.
1046
1562
 
1047
1563
  A `Condition` attribute naming a condition the template leaves undefined fails the same way.
1048
1564
 
1565
+ ### The output `Condition` attribute
1566
+
1567
+ An output carrying a `Condition` attribute whose condition is false is left out of the stack. It is
1568
+ absent from `stack.outputs` and from `DescribeStacks`, and the export name it carries is never
1569
+ published, so another stack's `Fn::ImportValue` for that name finds nothing.
1570
+
1571
+ An output whose condition is true resolves and exports as any other output does. One naming a
1572
+ condition the template leaves undefined fails the deployment.
1573
+
1049
1574
  ## Resource dependencies
1050
1575
 
1051
1576
  Resources can depend on each other explicitly with `DependsOn`.
@@ -1590,8 +2115,62 @@ const stacks = await simAws.cloudFormation().deployCdkOut({
1590
2115
  console.log(stacks.get("PipelineStack")?.stackName);
1591
2116
  ```
1592
2117
 
1593
- A staged CDK asset is published under the same principal, before CloudFormation reads the template
1594
- that points at it.
2118
+ ### The principal a CDK asset is published as
2119
+
2120
+ A real `cdk deploy` runs in two phases under two Roles. `cdk-assets` publishes every staged file
2121
+ asset to the bootstrap staging bucket as the file publishing Role, and CloudFormation then processes
2122
+ the template as the execution Role. `assetsCaller` names the first of those, beside the `caller`
2123
+ naming the second.
2124
+
2125
+ ```typescript sim-cloudformation-assets-caller
2126
+ /**
2127
+ * Publishing a Stack's CDK file assets as the file publishing Role.
2128
+ */
2129
+
2130
+ import { SimAws } from "@kensio/yulin";
2131
+
2132
+ const simAws = new SimAws({
2133
+ defaultAccountId: "123456789012",
2134
+ defaultRegionName: "eu-west-2",
2135
+ });
2136
+
2137
+ const publisher = await simAws.iam().makeDeployRole({
2138
+ roleName: "cdk-file-publishing",
2139
+ policyDocument: {
2140
+ Version: "2012-10-17",
2141
+ Statement: {
2142
+ Effect: "Allow",
2143
+ Action: ["s3:GetObject*", "s3:GetBucket*", "s3:List*", "s3:PutObject"],
2144
+ Resource: "arn:aws:s3:::cdk-hnb659fds-assets-*",
2145
+ },
2146
+ },
2147
+ });
2148
+
2149
+ const executor = await simAws.iam().makeDeployRole({
2150
+ roleName: "cdk-exec",
2151
+ policyDocument: {
2152
+ Version: "2012-10-17",
2153
+ Statement: { Effect: "Allow", Action: "s3:*", Resource: "*" },
2154
+ },
2155
+ });
2156
+
2157
+ const stacks = await simAws.cloudFormation().deployCdkOut({
2158
+ directoryPath: "cdk.out",
2159
+ caller: executor,
2160
+ assetsCaller: publisher,
2161
+ });
2162
+
2163
+ console.log(stacks.size);
2164
+ ```
2165
+
2166
+ `deployTemplate(...)` and `deployTemplateFile(...)` take the same option, and a Stack in an assembly
2167
+ names its own in `stackOptions`. A deployment that names no `assetsCaller` publishes its assets as
2168
+ `caller`, the way every deployment did before the two could be told apart.
2169
+
2170
+ The CDK bootstrap stack provisions the staging bucket, long before either Role runs. Yulin stands in
2171
+ for that and makes the bucket outside IAM when the first asset is published into it. So a Role
2172
+ holding only what a scoped execution policy grants on `cdk-hnb659fds-assets-*` deploys a cloud
2173
+ assembly with file assets, with no `s3:CreateBucket` or `s3:PutObject` added to it.
1595
2174
 
1596
2175
  ## Editing a synthesized template before deploying it
1597
2176
 
@@ -1732,10 +2311,9 @@ await simAws.cloudFormation().updateTemplateFile({ templatePath });
1732
2311
  The sibling assets manifest is read again with the template. A resource the update replaces reads the
1733
2312
  assets that synthesis staged, not the ones the stack was deployed with.
1734
2313
 
1735
- A file written without being changed is refused with `No updates are to be performed.`, and a failed
1736
- update leaves the stack in `UPDATE_FAILED` holding whatever the update reached. There is no rollback
1737
- to the template it was deployed from. A failure part way through has already deleted, replaced or
1738
- created some of the resources the change asked for.
2314
+ A file written without being changed is refused with `No updates are to be performed.`. A failed
2315
+ update is rolled back onto the template the stack was deployed from, and settles in
2316
+ `UPDATE_ROLLBACK_COMPLETE`. See [rolling back a failed update](#rolling-back-a-failed-update).
1739
2317
 
1740
2318
  ## Watching a template file
1741
2319
 
@@ -1783,9 +2361,10 @@ browser arriving on the new resources finds whatever the callback left ready for
1783
2361
 
1784
2362
  `onFailed` is given the update the changed template failed to survive. It reports the failure and
1785
2363
  nothing else.
1786
- The stack is left holding whatever the update reached, as it is after an update through the command.
1787
- What a failure does keep is the process, and the resources it never got to. A template that no longer
1788
- deploys leaves a working environment where a restart on it would leave none.
2364
+ The stack is rolled back onto the template it was deployed from, as it is after an update through the
2365
+ command. A resource the update had already replaced comes back empty. What a failure keeps is the
2366
+ process. A template that no longer deploys leaves a working environment where a restart on it would
2367
+ leave none.
1789
2368
 
1790
2369
  A burst of writes is one update. Saving a file is several filesystem events, so changes are held
1791
2370
  until they stop arriving. `settleMs` is how long that wait is, and it defaults to the 250ms
@@ -1867,6 +2446,11 @@ around it are read the same way:
1867
2446
  the deployment turns it off, as the construct is. Pruning only considers what the filters and the
1868
2447
  key prefix select, and leaves alone any Object the deployment would never have copied.
1869
2448
 
2449
+ A Bucket with an event notification configuration hears the deployment. Every file the deployment
2450
+ writes raises `s3:ObjectCreated:Put`, and every Object a pruning deployment removes raises
2451
+ `s3:ObjectRemoved:Delete`, the two the real provider function's sync raises. See
2452
+ [Event notifications](https://yulinsim.dev/services/s3/#event-notifications).
2453
+
1870
2454
  Several deployments can share one Bucket. That is the usual arrangement when the headers differ by
1871
2455
  file type, since a `BucketDeployment` sets them for all of its files at once. A second deployment is
1872
2456
  how the rest of the site gets different ones. Give the second one `prune: false`, or filters that miss
@@ -2266,9 +2850,9 @@ its own `Role` runs as that role, and gets no expanded one.
2266
2850
  ### Function events
2267
2851
 
2268
2852
  `Events` on a SAM function expand into whatever puts the function behind them. `Api`, `HttpApi`,
2269
- `SQS`, `DynamoDB`, `SNS`, `S3`, `Schedule`, `ScheduleV2` and `EventBridgeRule` are the types this
2270
- covers. An event of any other type is left where it is, and the function deploys with nothing in
2271
- front of it.
2853
+ `SQS`, `DynamoDB`, `SNS`, `S3`, `Cognito`, `Schedule`, `ScheduleV2` and `EventBridgeRule` are the
2854
+ types this covers. An event of any other type is left where it is, and the function deploys with
2855
+ nothing in front of it.
2272
2856
 
2273
2857
  An `HttpApi` event becomes an `AWS::ApiGatewayV2::Integration`, an `AWS::ApiGatewayV2::Route` and the
2274
2858
  `AWS::Lambda::Permission` the API invokes the function under. `Path` and `Method` become the route
@@ -2340,7 +2924,8 @@ console.log(await response.text());
2340
2924
  await srv.close();
2341
2925
  ```
2342
2926
 
2343
- `Auth` on the event is left out. Every request matching the expanded route reaches the function.
2927
+ `Auth` on the event names one of the API's authorizers. A route the event and the API both leave
2928
+ open is reached by every request matching it.
2344
2929
 
2345
2930
  An `Api` event is the REST half of the same idea. It becomes an `AWS::ApiGateway::Resource` for each
2346
2931
  segment of `Path`, an `AWS::ApiGateway::Method` on the last of them carrying a proxy `Integration`
@@ -2507,8 +3092,7 @@ time window gets `OFF`.
2507
3092
  once, and a failed one is recorded by the rule or the schedule that made it.
2508
3093
 
2509
3094
  A `FunctionUrlConfig` on the function expands into an `AWS::Lambda::Url` named after it, `RatesUrl`
2510
- for a function called `Rates`. `AuthType` and `InvokeMode` carry over. `Cors` is left out (the
2511
- simulated Function URL answers no preflight request).
3095
+ for a function called `Rates`. `AuthType`, `InvokeMode` and `Cors` carry over.
2512
3096
 
2513
3097
  ### Queue, stream, topic and bucket events
2514
3098
 
@@ -2639,8 +3223,9 @@ reaches an API the template declared, and how an `AWS::ApiGatewayV2::Route` reso
2639
3223
  does. An API naming a `DefinitionUri` is recorded as unsupported, because nothing here reads a
2640
3224
  document off disk or out of S3.
2641
3225
 
2642
- The API is deployed without `Auth` and `Domain`. SAM writes an `Auth` block into the document it
2643
- generates, and deploys a `Domain` as a custom domain name resource, and neither is expanded here.
3226
+ An `Auth` block becomes the authorizer resources it declares, covered under
3227
+ [API authorizers](#api-authorizers) below. A `Domain` is deployed by SAM as a custom domain name
3228
+ resource, and an API declaring one is deployed without it.
2644
3229
 
2645
3230
  ```typescript sim-cloudformation-sam-table-api
2646
3231
  /**
@@ -2711,9 +3296,9 @@ created without, because reading the document is outside this. An API declaring
2711
3296
  root resource and an empty tree under it. An API naming a `DefinitionUri` is recorded as
2712
3297
  unsupported, because this reads no document off disk or out of S3.
2713
3298
 
2714
- The API is deployed without `Auth`, `Cors`, `Domain`, `GatewayResponses`, `MethodSettings` and
3299
+ The API is deployed without `Cors`, `Domain`, `GatewayResponses`, `MethodSettings` and
2715
3300
  `BinaryMediaTypes`. SAM writes each of them into the document it generates, and none is expanded
2716
- here.
3301
+ here. `Auth` is expanded, and has [a section of its own](#api-authorizers) below.
2717
3302
 
2718
3303
  ```typescript sim-cloudformation-sam-rest-api
2719
3304
  /**
@@ -2758,6 +3343,162 @@ something the stack holds, answers `Ref` for and tears down. The APIs, stages an
2758
3343
  the same either way, and the logical IDs of the path resources have no counterpart in what SAM
2759
3344
  produces.
2760
3345
 
3346
+ ### API authorizers
3347
+
3348
+ `Auth` on an `AWS::Serverless::Api` or an `AWS::Serverless::HttpApi` expands into the authorizers it
3349
+ declares. A REST API gets one `AWS::ApiGateway::Authorizer` per entry in `Authorizers`, and an HTTP
3350
+ API gets one `AWS::ApiGatewayV2::Authorizer`. Each carries the logical ID of the API with the
3351
+ authorizer's name and `Authorizer` after it (`OrdersPoolAuthAuthorizer` for an authorizer called
3352
+ `PoolAuth` on an API called `Orders`). A template can `Ref` that name, and the stack tears the
3353
+ authorizer down with everything else.
3354
+
3355
+ On a REST API, an authorizer naming a `UserPoolArn` verifies Cognito tokens, and one naming a
3356
+ `FunctionArn` asks a function of the template. `FunctionPayloadType` picks between the `TOKEN`
3357
+ authorizer that is handed one header and the `REQUEST` authorizer that is handed the whole request.
3358
+ SAM defaults to `TOKEN`. `Identity` names the parts of the request the authorizer reads (`Header`,
3359
+ `Headers`, `QueryStrings`, `StageVariables` and `Context`), and `ReauthorizeEvery` becomes the
3360
+ authorizer's result TTL.
3361
+
3362
+ On an HTTP API, an authorizer naming a `JwtConfiguration` verifies tokens against the issuer it
3363
+ names, and one naming a `FunctionArn` asks a function. The issuer and audience are read under either
3364
+ spelling (SAM writes them in lower case and CloudFormation capitalises them).
3365
+ `AuthorizerPayloadFormatVersion` defaults to `2.0`. `EnableIamAuthorizer` puts `AWS_IAM` among the
3366
+ names a route can take, and a REST API carries that name already.
3367
+
3368
+ `DefaultAuthorizer` names the authorizer every method and route takes. An `Api` or `HttpApi` event
3369
+ picks another one with `Auth.Authorizer`, and opens its own method with `Auth.Authorizer: NONE`.
3370
+ `Auth.AuthorizationScopes` on the event replaces the scopes the authorizer asks for. The implicit
3371
+ API a function's events create reads its `Auth` from `Globals.Api` or `Globals.HttpApi`.
3372
+
3373
+ An `Auth` property outside that set fails the transform, naming the property. `ApiKeyRequired`,
3374
+ `UsagePlan`, `ResourcePolicy`, `InvokeRole`, `AddDefaultAuthorizerToCorsPreflight` and
3375
+ `Identity.ValidationExpression` are all refused that way. Dropping one of them would deploy an API
3376
+ that authorizes less than the template asked for, and the failure says which property it was.
3377
+
3378
+ ```typescript sim-cloudformation-sam-api-auth
3379
+ /**
3380
+ * A SAM HTTP API closed by the Cognito user pool its Auth block names.
3381
+ */
3382
+
3383
+ import { SimAws } from "@kensio/yulin";
3384
+ import { serveSimAws } from "@kensio/yulin/serve";
3385
+
3386
+ const simAws = new SimAws();
3387
+
3388
+ const stack = await simAws.cloudFormation().deployTemplate({
3389
+ stackName: "orders-api-stack",
3390
+ template: {
3391
+ Transform: "AWS::Serverless-2016-10-31",
3392
+ Resources: {
3393
+ Users: {
3394
+ Type: "AWS::Cognito::UserPool",
3395
+ Properties: { UserPoolName: "orders-users" },
3396
+ },
3397
+ WebClient: {
3398
+ Type: "AWS::Cognito::UserPoolClient",
3399
+ Properties: {
3400
+ UserPoolId: { Ref: "Users" },
3401
+ ClientName: "web",
3402
+ ExplicitAuthFlows: ["ALLOW_ADMIN_USER_PASSWORD_AUTH"],
3403
+ },
3404
+ },
3405
+ Orders: {
3406
+ Type: "AWS::Serverless::HttpApi",
3407
+ Properties: {
3408
+ Auth: {
3409
+ DefaultAuthorizer: "PoolAuth",
3410
+ Authorizers: {
3411
+ PoolAuth: {
3412
+ JwtConfiguration: {
3413
+ issuer: { "Fn::GetAtt": ["Users", "ProviderURL"] },
3414
+ audience: [{ Ref: "WebClient" }],
3415
+ },
3416
+ },
3417
+ },
3418
+ },
3419
+ },
3420
+ },
3421
+ Handler: {
3422
+ Type: "AWS::Serverless::Function",
3423
+ Properties: {
3424
+ Handler: "index.handler",
3425
+ Runtime: "nodejs22.x",
3426
+ Events: {
3427
+ Get: {
3428
+ Type: "HttpApi",
3429
+ Properties: {
3430
+ ApiId: { Ref: "Orders" },
3431
+ Path: "/orders",
3432
+ Method: "GET",
3433
+ },
3434
+ },
3435
+ },
3436
+ },
3437
+ },
3438
+ },
3439
+ Outputs: {
3440
+ ApiEndpoint: { Value: { "Fn::GetAtt": ["Orders", "ApiEndpoint"] } },
3441
+ PoolId: { Value: { Ref: "Users" } },
3442
+ ClientId: { Value: { Ref: "WebClient" } },
3443
+ },
3444
+ },
3445
+ bindings: [
3446
+ {
3447
+ logicalId: "Handler",
3448
+ handler: (): { statusCode: number; body: string } => ({
3449
+ statusCode: 200,
3450
+ body: "orders",
3451
+ }),
3452
+ },
3453
+ ],
3454
+ });
3455
+
3456
+ await stack.waitForDeployComplete();
3457
+
3458
+ const cognito = simAws.cognitoIdentityProvider();
3459
+ const userPoolId = stack.output("PoolId");
3460
+ const clientId = stack.output("ClientId");
3461
+
3462
+ await cognito.adminCreateUser({
3463
+ input: { UserPoolId: userPoolId, Username: "ada" },
3464
+ });
3465
+ await cognito.adminSetUserPassword({
3466
+ input: {
3467
+ UserPoolId: userPoolId,
3468
+ Username: "ada",
3469
+ Password: "Correct-horse-1",
3470
+ Permanent: true,
3471
+ },
3472
+ });
3473
+ const signedIn = await cognito.adminInitiateAuth({
3474
+ input: {
3475
+ UserPoolId: userPoolId,
3476
+ ClientId: clientId,
3477
+ AuthFlow: "ADMIN_USER_PASSWORD_AUTH",
3478
+ AuthParameters: { USERNAME: "ada", PASSWORD: "Correct-horse-1" },
3479
+ },
3480
+ });
3481
+
3482
+ const srv = await serveSimAws({ simAws });
3483
+ const url = srv.localUrl(`${stack.output("ApiEndpoint")}/orders`);
3484
+
3485
+ const refused = await fetch(url);
3486
+
3487
+ console.log(refused.status);
3488
+ // 401
3489
+
3490
+ const admitted = await fetch(url, {
3491
+ headers: {
3492
+ authorization: `Bearer ${signedIn.AuthenticationResult?.AccessToken}`,
3493
+ },
3494
+ });
3495
+
3496
+ console.log(admitted.status);
3497
+ // 200
3498
+
3499
+ await srv.close();
3500
+ ```
3501
+
2761
3502
  ## Serving deployed resources on localhost
2762
3503
 
2763
3504
  CloudFormation itself is not served as an HTTP API. Instead, you deploy infrastructure through Sim
@@ -3489,8 +4230,18 @@ Sim CloudFormation currently supports:
3489
4230
 
3490
4231
  - `CreateStackCommand`, `DescribeStacksCommand`, `UpdateStackCommand` and `DeleteStackCommand`,
3491
4232
  taking a `TemplateBody` written as JSON or as YAML with short-form intrinsic tags
4233
+ - `UsePreviousTemplate` on `UpdateStackCommand`, and `UsePreviousValue` on one of its parameters,
4234
+ for an update that changes a parameter value on its own
4235
+ - Rollback of a failed update onto the template the stack was deployed from, through
4236
+ `UPDATE_ROLLBACK_IN_PROGRESS` to `UPDATE_ROLLBACK_COMPLETE` or `UPDATE_ROLLBACK_FAILED`
4237
+ - `CreateChangeSetCommand`, `DescribeChangeSetCommand`, `ExecuteChangeSetCommand`,
4238
+ `DeleteChangeSetCommand` and `ListChangeSetsCommand`, for both `CREATE` and `UPDATE` change sets
3492
4239
  - Waiting for simulated stack deployment, update and deletion completion
3493
- - The resource `DeletionPolicy` attribute, for `Retain` and `RetainExceptOnCreate`
4240
+ - Stack IDs in the CloudFormation ARN shape, accepted by `DescribeStacksCommand` in place of a stack
4241
+ name, and still describing a stack once it has been deleted
4242
+ - The resource `DeletionPolicy` attribute, for `Retain` and `RetainExceptOnCreate`, and
4243
+ `UpdateReplacePolicy`, for `Retain`
4244
+ - `RetainResources` on `DeleteStackCommand`, naming resources a teardown leaves in simulated AWS
3494
4245
  - `deployTemplate(...)` for parsed template objects, optionally naming the synthesized template file
3495
4246
  a template edited in memory came from
3496
4247
  - `deployTemplateFile(...)` for template files, written as JSON or as YAML with short-form
@@ -3500,8 +4251,9 @@ Sim CloudFormation currently supports:
3500
4251
  - Template `Parameters` with supplied values and defaults
3501
4252
  - Template `Outputs`, resolved after resource creation and read from `stack.outputs`
3502
4253
  - Template `Mappings`, read with `Fn::FindInMap`
3503
- - Template `Conditions`, built from `Fn::Equals`, `Fn::And`, `Fn::Or` and `Fn::Not`
3504
- - The resource `Condition` attribute, which decides whether a resource is created
4254
+ - Template `Conditions`, built from `Fn::Equals`, `Fn::And`, `Fn::Or`, `Fn::Not` and `Fn::If`
4255
+ - The `Condition` attribute on a resource, which decides whether the resource is created, and on an
4256
+ output, which decides whether the output and its export are published
3505
4257
  - The `Ref`, `Fn::GetAtt`, `Fn::Join`, `Fn::Sub`, `Fn::FindInMap`, `Fn::If`, `Fn::Split` and
3506
4258
  `Fn::Select` intrinsic functions
3507
4259
  - Explicit resource dependencies with `DependsOn`
@@ -3514,6 +4266,10 @@ Sim CloudFormation currently supports:
3514
4266
  - The `HttpApi` event of a SAM function, expanded into the API, integration, route, stage and invoke
3515
4267
  permission that serve it, and the `Api` event, expanded into the API, path resources, method,
3516
4268
  deployment, stage and invoke permission that serve it
4269
+ - `Auth` on a SAM API, expanded into the Cognito, JWT and Lambda authorizers it declares, with
4270
+ `DefaultAuthorizer` and the `Auth` an event states deciding which one guards each method or route
4271
+ - The `Cognito` event of a SAM function, expanded into the pool's `LambdaConfig` entry and the
4272
+ permission the pool invokes the function under
3517
4273
  - `FunctionUrlConfig` on a SAM function, expanded into a Function URL
3518
4274
  - The `Schedule`, `ScheduleV2` and `EventBridgeRule` events of a SAM function, expanded into the
3519
4275
  EventBridge rule or Scheduler schedule that fires the function, and the permission or execution
@@ -3589,48 +4345,56 @@ Each service's own docs describe what its resource types support.
3589
4345
  changed resource is still replaced and loses what it holds, the same as any other update.
3590
4346
  - Yulin never synthesizes a CDK app. It watches the synthesized output template. A change to the app
3591
4347
  itself reaches the stack once something has run `cdk synth` over it.
3592
- - A stack update applies a whole template directly. Change sets are outside the simulation, so
3593
- `CreateChangeSetCommand` and `ExecuteChangeSetCommand` have nothing behind them, and neither does
3594
- drift detection.
3595
- - A failed stack update is not rolled back to the template the stack was deployed from. The stack is
3596
- left in `UPDATE_FAILED` holding whatever the update managed.
3597
- - `UpdateStackCommand` reads `StackName`, `TemplateBody` and `Parameters`. `UsePreviousTemplate` and
3598
- `UsePreviousValue` are not read, so an update has to be given the whole new template.
3599
- - An update asked for while another is still running is refused, as CloudFormation refuses it. There
3600
- is no queue behind it.
4348
+ - A change set reports every `Modify` as `Replacement: True`, because a changed resource is replaced
4349
+ rather than updated in place. `ChangeSetType: IMPORT` is refused, and so is a `CREATE` change set
4350
+ naming a stack that is already there, where CloudFormation allows a second one against a stack
4351
+ still in review. Drift detection is outside the simulation.
4352
+ - A rolled-back update recreates a resource it had already replaced, and the resource comes back
4353
+ empty. Real CloudFormation puts most properties back on the resource it updated in place, and what
4354
+ the resource holds survives. See
4355
+ [rolling back a failed update](#rolling-back-a-failed-update).
4356
+ - `UpdateStackCommand` reads `StackName`, `TemplateBody`, `UsePreviousTemplate` and `Parameters`,
4357
+ including `UsePreviousValue` on a parameter. `DisableRollback` and `RollbackConfiguration` are not
4358
+ read, so a failed update is always rolled back.
4359
+ - An update asked for while another is still running, or while one is being rolled back, is refused,
4360
+ as CloudFormation refuses it. There is no queue behind it.
4361
+ - A stack left in `UPDATE_ROLLBACK_FAILED` can be updated again, reconciled from the resources it is
4362
+ holding. Real CloudFormation refuses until `ContinueUpdateRollback` has finished the rollback, and
4363
+ that command is outside the simulation.
3601
4364
  - A stack deletion deletes only the resource types the simulator can delete. A resource type it
3602
4365
  creates but cannot delete is recorded in `stack.skippedResourceDeletions` and stepped over, the
3603
4366
  same way an unsupported resource type is on create, and the stack still deletes with that resource
3604
4367
  left behind.
3605
- - `DeletionPolicy` is read for `Retain` and `RetainExceptOnCreate` only. `Snapshot` is treated as
3606
- `Delete`, because no simulated service takes snapshots.
3607
- - `UpdateReplacePolicy` is not read. A replaced resource is deleted whatever it says, for the reason
3608
- given under [changed resources are replaced](#changed-resources-are-replaced).
3609
- - `DeleteStackCommand` reads only `StackName`. `RetainResources`, `DeletionMode`, `RoleARN` and
3610
- `ClientRequestToken` are not read, so a stack left in `DELETE_FAILED` cannot be forced through the
3611
- way `FORCE_DELETE_STACK` forces it in AWS.
3612
- - A deleted stack cannot be described. Real CloudFormation keeps a deleted stack readable by its
3613
- unique stack ID, and the simulator identifies a stack by its name alone.
3614
- - `Fn::FindInMap` accepts only the three-argument form. The four-argument form, where the fourth
3615
- argument is `{ "DefaultValue": ... }`, is rejected.
4368
+ - `DeletionPolicy` is read for `Retain` and `RetainExceptOnCreate` only, and `UpdateReplacePolicy`
4369
+ for `Retain` only. `Snapshot` is treated as `Delete` in both, because no simulated service takes
4370
+ snapshots.
4371
+ - A resource kept by `UpdateReplacePolicy: Retain` holds the name it was created with, and a
4372
+ replacement whose name the template leaves to CloudFormation asks for that same name and fails to
4373
+ create. Real CloudFormation gives the replacement a fresh random name. See
4374
+ [`UpdateReplacePolicy`](#updatereplacepolicy).
4375
+ - `DeleteStackCommand` reads `StackName` and `RetainResources`. `DeletionMode`, `RoleARN` and
4376
+ `ClientRequestToken` are not read, and a stack left in `DELETE_FAILED` cannot be forced through
4377
+ the way `FORCE_DELETE_STACK` forces it in AWS.
4378
+ - A deleted stack stays describable by its stack ID for as long as the simulation lives. Real
4379
+ CloudFormation drops it after 90 days. `DescribeStacks` with no `StackName` lists the live stacks
4380
+ in both, and `ListStacks` is unsupported, so there is no way to find a deleted stack whose ID you
4381
+ have lost.
3616
4382
  - `Fn::FindInMap` arguments are resolved from literals, `Parameters` and pseudo parameters. An
3617
4383
  argument that depends on a created resource, such as a `Ref` to a resource logical ID, fails the
3618
4384
  resource with a "could not find map" error. Real CloudFormation allows only `Ref` and a nested
3619
4385
  `Fn::FindInMap` inside `Fn::FindInMap`. The templates affected here are ones real CloudFormation
3620
4386
  would reject as well. The simulator just rejects them later rather than up front.
3621
- - `Fn::If` is unsupported inside the `Conditions` section itself. It is rejected there rather than
3622
- read against a half-evaluated section.
4387
+ - `Fn::If` is a condition function inside the `Conditions` section, and is not a value an
4388
+ `Fn::Equals` can compare. Real CloudFormation allows only `Ref` and `Fn::FindInMap` there.
3623
4389
  - `Fn::Split` and `Fn::Select` accept any argument that resolves to the type they need. Real
3624
4390
  CloudFormation allows only a named set of functions inside each of them. A template the simulator
3625
4391
  resolves may still be one CloudFormation rejects.
3626
- - The `Condition` attribute is read on resources but not on outputs. An output carrying one is
3627
- resolved and present in `stack.outputs` whichever way its condition falls, where real
3628
- CloudFormation would leave it out.
3629
4392
  - The SAM transform is expanded for `AWS::Serverless::Function`, `AWS::Serverless::SimpleTable`,
3630
4393
  `AWS::Serverless::HttpApi` and `AWS::Serverless::Api`. Every other `AWS::Serverless::*` resource
3631
- type is recorded as unsupported. `Api`, `HttpApi`, `SQS`, `DynamoDB`, `SNS`, `S3`, `Schedule`,
3632
- `ScheduleV2` and `EventBridgeRule` are the event types expanded, and an event of another type,
3633
- such as `Cognito`, is left where it is. `Auth` on an `Api` or `HttpApi` event, and on the implicit API
3634
- either of them shares, is left out. `AutoPublishAlias` and `DeploymentPreference` are left out
3635
- too, because the simulator has one version of a function and nothing to shift traffic between.
4394
+ type is recorded as unsupported. `Api`, `HttpApi`, `SQS`, `DynamoDB`, `SNS`, `S3`, `Cognito`,
4395
+ `Schedule`, `ScheduleV2` and `EventBridgeRule` are the event types expanded, and an event of
4396
+ another type is left where it is. Under `Auth`, `ApiKeyRequired`, `UsagePlan`, `ResourcePolicy`,
4397
+ `InvokeRole` and `AddDefaultAuthorizerToCorsPreflight` fail the transform by name.
4398
+ `AutoPublishAlias` and `DeploymentPreference` are left out, because the simulator has one version
4399
+ of a function and nothing to shift traffic between.
3636
4400
  - Many advanced CloudFormation features are outside the simulation.