@kensio/yulin 1.20.16 → 1.20.17

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 (312) hide show
  1. package/dist/service/aws/caller/sim-aws-ambient-caller.d.ts +23 -0
  2. package/dist/service/aws/caller/sim-aws-ambient-caller.js +12 -0
  3. package/dist/service/aws/caller/sim-aws-caller-resolver.d.ts +17 -6
  4. package/dist/service/aws/caller/sim-aws-caller-resolver.js +21 -26
  5. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts +6 -0
  6. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +3 -0
  7. package/dist/service/aws/factory/sim-aws-account-service-cache.d.ts +6 -0
  8. package/dist/service/aws/factory/sim-aws-account-service-cache.js +5 -1
  9. package/dist/service/aws/factory/sim-aws-registered-service-builder.js +3 -1
  10. package/dist/service/aws/factory/sim-aws-service-factory.js +9 -1
  11. package/dist/service/cloudformation/command/create-stack/create-stack.handler.d.ts +4 -0
  12. package/dist/service/cloudformation/command/create-stack/create-stack.handler.js +4 -1
  13. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-deployer.js +2 -1
  14. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.d.ts +11 -2
  15. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.js +2 -1
  16. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-stack-options.d.ts +6 -0
  17. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +11 -0
  18. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +17 -15
  19. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +12 -0
  20. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +2 -1
  21. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.d.ts +23 -0
  22. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.js +30 -0
  23. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cfn-value-adapter.js +8 -0
  24. package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.d.ts +29 -12
  25. package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.js +51 -20
  26. package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.d.ts +19 -0
  27. package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.js +6 -0
  28. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.d.ts +7 -0
  29. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.js +9 -2
  30. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.d.ts +2 -0
  31. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.js +2 -1
  32. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +6 -0
  33. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +4 -1
  34. package/dist/service/cloudformation/stack/sim-cfn-stack.js +2 -1
  35. package/dist/service/cloudformation/stack/sim-cfn-stack.type.d.ts +6 -0
  36. package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts +5 -0
  37. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.d.ts +37 -0
  38. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.js +50 -0
  39. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.d.ts +25 -0
  40. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.js +21 -0
  41. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.d.ts +28 -0
  42. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.js +48 -0
  43. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.d.ts +8 -0
  44. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.js +13 -0
  45. package/dist/service/cloudfront/cff/sim-cf-function-commands.d.ts +52 -0
  46. package/dist/service/cloudfront/cff/sim-cf-function-commands.js +51 -0
  47. package/dist/service/cloudfront/cff/sim-cff-configuration.d.ts +41 -0
  48. package/dist/service/cloudfront/cff/sim-cff-configuration.js +34 -0
  49. package/dist/service/cloudfront/cff/sim-cff-stage.d.ts +23 -0
  50. package/dist/service/cloudfront/cff/sim-cff-stage.js +30 -0
  51. package/dist/service/cloudfront/cff/sim-cloudfront-function.d.ts +6 -1
  52. package/dist/service/cloudfront/cff/sim-cloudfront-function.js +6 -0
  53. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.d.ts +27 -0
  54. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.js +42 -0
  55. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.d.ts +24 -0
  56. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.js +32 -0
  57. package/dist/service/cloudfront/cfn/distro/{sim-cfn-cf-distro-response-headers-policy.d.ts → sim-cfn-cf-distro-behavior-policies.d.ts} +8 -7
  58. package/dist/service/cloudfront/cfn/distro/{sim-cfn-cf-distro-response-headers-policy.js → sim-cfn-cf-distro-behavior-policies.js} +11 -37
  59. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +6 -5
  60. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +8 -7
  61. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.d.ts +23 -0
  62. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.js +50 -0
  63. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts +1 -0
  64. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +10 -0
  65. package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts +1 -0
  66. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
  67. package/dist/service/cloudfront/command/create-function/create-function.handler.js +7 -1
  68. package/dist/service/cloudfront/command/function/sim-cf-describe-function.d.ts +22 -0
  69. package/dist/service/cloudfront/command/function/sim-cf-describe-function.js +32 -0
  70. package/dist/service/cloudfront/command/function/sim-cf-function-access.d.ts +48 -0
  71. package/dist/service/cloudfront/command/function/sim-cf-function-access.js +48 -0
  72. package/dist/service/cloudfront/command/function/sim-cf-function-command.types.d.ts +97 -0
  73. package/dist/service/cloudfront/command/function/sim-cf-function-command.types.js +10 -0
  74. package/dist/service/cloudfront/command/function/sim-cf-function-lookup.d.ts +12 -0
  75. package/dist/service/cloudfront/command/function/sim-cf-function-lookup.js +21 -0
  76. package/dist/service/cloudfront/command/function/sim-cf-function-summary.d.ts +11 -0
  77. package/dist/service/cloudfront/command/function/sim-cf-function-summary.js +30 -0
  78. package/dist/service/cloudfront/command/function/sim-cf-get-function.d.ts +23 -0
  79. package/dist/service/cloudfront/command/function/sim-cf-get-function.js +33 -0
  80. package/dist/service/cloudfront/command/function/sim-cf-list-functions.d.ts +22 -0
  81. package/dist/service/cloudfront/command/function/sim-cf-list-functions.js +38 -0
  82. package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
  83. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.d.ts +18 -0
  84. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.js +30 -0
  85. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.d.ts +28 -0
  86. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.js +41 -0
  87. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts +2 -2
  88. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +6 -3
  89. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts +0 -10
  90. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js +0 -19
  91. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
  92. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +4 -2
  93. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +3 -3
  94. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +5 -5
  95. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +3 -3
  96. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +4 -4
  97. package/dist/service/cloudfront/distribution/sim-cf-distribution-configuration-state.d.ts +3 -1
  98. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +2 -0
  99. package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +21 -0
  100. package/dist/service/cloudfront/error/sim-cloudfront.error.js +25 -0
  101. package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store-access.js +2 -10
  102. package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store.js +2 -1
  103. package/dist/service/cloudfront/sdk/sim-cloudfront-sdk-command-router.js +12 -0
  104. package/dist/service/cloudfront/sim-cf-authorize.d.ts +16 -0
  105. package/dist/service/cloudfront/sim-cf-authorize.js +19 -0
  106. package/dist/service/cloudfront/sim-cf-etag.d.ts +7 -0
  107. package/dist/service/cloudfront/sim-cf-etag.js +10 -0
  108. package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +8 -12
  109. package/dist/service/cloudfront/sim-cloudfront-commands.js +8 -17
  110. package/dist/service/cloudfront/sim-cloudfront-policies.d.ts +43 -0
  111. package/dist/service/cloudfront/sim-cloudfront-policies.js +53 -0
  112. package/dist/service/cloudfront/sim-cloudfront.d.ts +13 -17
  113. package/dist/service/cloudfront/sim-cloudfront.js +22 -25
  114. package/dist/service/ecr/authorize/sim-ecr-authorizer.d.ts +31 -0
  115. package/dist/service/ecr/authorize/sim-ecr-authorizer.js +38 -0
  116. package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.d.ts +11 -2
  117. package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.js +11 -2
  118. package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.d.ts +4 -2
  119. package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.js +8 -9
  120. package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.d.ts +7 -0
  121. package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.js +9 -0
  122. package/dist/service/ecr/sim-ecr.d.ts +7 -0
  123. package/dist/service/ecr/sim-ecr.js +16 -4
  124. package/dist/service/ecs/command/authorize/sim-ecs-authorizer.d.ts +12 -0
  125. package/dist/service/ecs/command/authorize/sim-ecs-authorizer.js +21 -0
  126. package/dist/service/ecs/command/register-task-definition/register-task-definition.handler.js +1 -0
  127. package/dist/service/ecs/sim-ecs-service-principal.d.ts +8 -0
  128. package/dist/service/ecs/sim-ecs-service-principal.js +8 -0
  129. package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.d.ts +12 -0
  130. package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.js +21 -0
  131. package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.d.ts +13 -0
  132. package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.js +9 -0
  133. package/dist/service/eventbridge/command/target/sim-event-bridge-put-targets.js +1 -0
  134. package/dist/service/firehose/command/authorize/sim-firehose-authorizer.d.ts +12 -0
  135. package/dist/service/firehose/command/authorize/sim-firehose-authorizer.js +20 -0
  136. package/dist/service/firehose/command/sim-firehose-delivery-stream-access.d.ts +4 -0
  137. package/dist/service/firehose/command/sim-firehose-delivery-stream-access.js +6 -0
  138. package/dist/service/firehose/command/stream/sim-firehose-create-delivery-stream.js +3 -1
  139. package/dist/service/firehose/sim-firehose-service-principal.d.ts +8 -0
  140. package/dist/service/firehose/sim-firehose-service-principal.js +8 -0
  141. package/dist/service/firehose/source/sim-firehose-source.d.ts +5 -0
  142. package/dist/service/firehose/source/sim-firehose-source.js +5 -0
  143. package/dist/service/glue/cfn/database/sim-cfn-glue-database-properties.js +2 -2
  144. package/dist/service/glue/cfn/sim-cfn-glue-generated-name.d.ts +10 -0
  145. package/dist/service/glue/cfn/sim-cfn-glue-generated-name.js +25 -0
  146. package/dist/service/glue/cfn/table/sim-cfn-glue-table-properties.js +2 -3
  147. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.d.ts +33 -2
  148. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.js +33 -2
  149. package/dist/service/iam/authorize/allow/sim-iam-allow-statements.d.ts +4 -3
  150. package/dist/service/iam/authorize/allow/sim-iam-allow-statements.js +9 -3
  151. package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.d.ts +14 -5
  152. package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.js +16 -12
  153. package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.d.ts +9 -3
  154. package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.js +5 -3
  155. package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.d.ts +9 -71
  156. package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.js +2 -1
  157. package/dist/service/iam/authorize/context/sim-iam-auth-z-input.d.ts +87 -0
  158. package/dist/service/iam/authorize/context/sim-iam-auth-z-input.js +1 -0
  159. package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.d.ts +11 -3
  160. package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.js +20 -8
  161. package/dist/service/iam/authorize/match/sim-iam-principal-match.d.ts +29 -8
  162. package/dist/service/iam/authorize/match/sim-iam-principal-match.js +38 -13
  163. package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.d.ts +74 -0
  164. package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.js +92 -0
  165. package/dist/service/iam/authorize/sim-iam-account-auth-z.d.ts +14 -5
  166. package/dist/service/iam/authorize/sim-iam-account-auth-z.js +6 -4
  167. package/dist/service/iam/authorize/sim-iam-authorizer.d.ts +3 -1
  168. package/dist/service/iam/authorize/sim-iam-authorizer.js +2 -1
  169. package/dist/service/iam/authorize/sim-iam-inter-service-auth-z.d.ts +1 -1
  170. package/dist/service/iam/authorize/sim-iam-wildcard.js +39 -4
  171. package/dist/service/iam/cfn/managed-policy/sim-cfn-iam-managed-policy-creator.js +2 -1
  172. package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.d.ts +16 -0
  173. package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.js +36 -0
  174. package/dist/service/iam/cfn/role/sim-cfn-iam-role-properties-parser.js +9 -8
  175. package/dist/service/iam/cfn/sim-cfn-iam-optional-string.d.ts +17 -0
  176. package/dist/service/iam/cfn/sim-cfn-iam-optional-string.js +17 -0
  177. package/dist/service/iam/cfn/user/sim-cfn-iam-user-properties-parser.js +4 -8
  178. package/dist/service/iam/command/policy/create-policy/create-policy-input-resolver.js +2 -0
  179. package/dist/service/iam/command/policy/put-role-policy/put-role-policy.handler.js +5 -0
  180. package/dist/service/iam/command/policy/put-user-policy/put-user-policy.handler.js +5 -0
  181. package/dist/service/iam/command/role/create-role/create-role.handler.js +4 -1
  182. package/dist/service/iam/error/sim-iam.error.d.ts +11 -0
  183. package/dist/service/iam/error/sim-iam.error.js +13 -0
  184. package/dist/service/iam/index.d.ts +1 -0
  185. package/dist/service/iam/policy/sim-iam-policy-document-of-size.d.ts +18 -0
  186. package/dist/service/iam/policy/sim-iam-policy-document-of-size.js +41 -0
  187. package/dist/service/iam/role/sim-iam-deploy-role.d.ts +56 -0
  188. package/dist/service/iam/role/sim-iam-deploy-role.js +50 -0
  189. package/dist/service/iam/role/sim-iam-role-with-policy.factory.d.ts +3 -1
  190. package/dist/service/iam/sim-iam-account-parts.d.ts +8 -0
  191. package/dist/service/iam/sim-iam-account-parts.js +1 -0
  192. package/dist/service/iam/sim-iam.d.ts +12 -2
  193. package/dist/service/iam/sim-iam.js +12 -0
  194. package/dist/service/iam/validate/size/sim-iam-policy-document-size.d.ts +57 -0
  195. package/dist/service/iam/validate/size/sim-iam-policy-document-size.js +71 -0
  196. package/dist/service/kms/command/authorize/sim-kms-authorizer.d.ts +3 -1
  197. package/dist/service/kms/command/authorize/sim-kms-authorizer.js +4 -1
  198. package/dist/service/kms/command/sim-kms-request-options.d.ts +11 -0
  199. package/dist/service/kms/key/sim-kms-key-policy.d.ts +5 -4
  200. package/dist/service/kms/key/sim-kms-key-policy.js +4 -3
  201. package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.d.ts +2 -2
  202. package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.js +4 -3
  203. package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.d.ts +10 -0
  204. package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.js +25 -0
  205. package/dist/service/lambda/command/authorize/sim-lambda-resource-policies.d.ts +1 -1
  206. package/dist/service/lambda/command/create-function/create-function-authorizer.d.ts +9 -2
  207. package/dist/service/lambda/command/create-function/create-function-authorizer.js +16 -2
  208. package/dist/service/lambda/command/create-function/create-function.handler.js +1 -1
  209. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.d.ts +7 -2
  210. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js +14 -2
  211. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.js +1 -1
  212. package/dist/service/lambda/function/logging/sim-lambda-function-logging.d.ts +10 -1
  213. package/dist/service/lambda/function/logging/sim-lambda-function-logging.js +25 -1
  214. package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.d.ts +13 -0
  215. package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.js +18 -0
  216. package/dist/service/lambda/sim-lambda-service-principal.d.ts +7 -0
  217. package/dist/service/lambda/sim-lambda-service-principal.js +7 -0
  218. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.d.ts +46 -0
  219. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.js +49 -0
  220. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.d.ts +5 -0
  221. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.js +6 -0
  222. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.d.ts +5 -0
  223. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.js +6 -0
  224. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.d.ts +5 -0
  225. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.js +6 -0
  226. package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.d.ts +9 -2
  227. package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.js +34 -5
  228. package/dist/service/logs/cfn/sim-logs-cfn-resource-deleter.js +1 -1
  229. package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.d.ts +4 -0
  230. package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.js +9 -4
  231. package/dist/service/logs/sim-logs-commands.d.ts +3 -0
  232. package/dist/service/logs/sim-logs-commands.js +4 -0
  233. package/dist/service/logs/sim-logs.js +6 -1
  234. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.d.ts +2 -2
  235. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.js +4 -3
  236. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.d.ts +12 -0
  237. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.js +22 -0
  238. package/dist/service/s3/command/authorize/sim-s3-bucket-resource-policies.d.ts +1 -1
  239. package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.d.ts +10 -1
  240. package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.js +19 -1
  241. package/dist/service/scheduler/command/schedule/sim-scheduler-create-schedule.js +1 -0
  242. package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.d.ts +8 -0
  243. package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.js +9 -0
  244. package/dist/service/scheduler/command/schedule/sim-scheduler-update-schedule.js +1 -0
  245. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.d.ts +15 -0
  246. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.js +22 -0
  247. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.d.ts +4 -10
  248. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.js +13 -31
  249. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.d.ts +17 -0
  250. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.js +30 -0
  251. package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.d.ts +6 -0
  252. package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.js +8 -3
  253. package/dist/service/sns/command/authorize/sim-sns-topic-resource-policies.d.ts +1 -1
  254. package/dist/service/sqs/command/authorize/sim-sqs-queue-resource-policies.d.ts +1 -1
  255. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.d.ts +16 -0
  256. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.js +23 -0
  257. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.d.ts +2 -4
  258. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.js +5 -5
  259. package/dist/service/ssm/parameter/sim-ssm-kms-crypto.d.ts +6 -4
  260. package/dist/service/ssm/parameter/sim-ssm-kms-crypto.js +4 -4
  261. package/dist/service/ssm/parameter/sim-ssm-parameter-arn.d.ts +17 -0
  262. package/dist/service/ssm/parameter/sim-ssm-parameter-arn.js +20 -0
  263. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.d.ts +15 -9
  264. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.js +20 -10
  265. package/dist/service/ssm/parameter/sim-ssm-parameter-name.js +3 -12
  266. package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.d.ts +41 -0
  267. package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.js +64 -0
  268. package/dist/service/stepfunctions/command/machine/sim-state-machine-create.d.ts +5 -2
  269. package/dist/service/stepfunctions/command/machine/sim-state-machine-create.js +6 -2
  270. package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.d.ts +26 -0
  271. package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.js +29 -0
  272. package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.d.ts +7 -0
  273. package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.js +12 -3
  274. package/dist/service/stepfunctions/command/machine/sim-state-machine-update.d.ts +19 -0
  275. package/dist/service/stepfunctions/command/machine/{sim-state-machine-writes.js → sim-state-machine-update.js} +3 -14
  276. package/dist/service/stepfunctions/sim-step-functions.d.ts +8 -2
  277. package/dist/service/stepfunctions/sim-step-functions.js +26 -9
  278. package/dist/service/sts/command/assume-role/assume-role.handler.d.ts +5 -0
  279. package/dist/service/sts/command/assume-role/assume-role.handler.js +1 -0
  280. package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.d.ts +5 -0
  281. package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.js +1 -0
  282. package/dist/service/sts/sim-sts.d.ts +9 -0
  283. package/dist/service/sts/sim-sts.js +4 -0
  284. package/dist/util/memo/bounded-memo.d.ts +36 -0
  285. package/dist/util/memo/bounded-memo.js +58 -0
  286. package/docs/sdk/README.md +3 -1
  287. package/docs/services/cloudformation/README.md +196 -11
  288. package/docs/services/cloudfront/README.md +230 -6
  289. package/docs/services/cloudwatch/README.md +6 -4
  290. package/docs/services/cognito/README.md +8 -7
  291. package/docs/services/dynamodb/README.md +6 -5
  292. package/docs/services/ecs/README.md +20 -9
  293. package/docs/services/elbv2/README.md +6 -2
  294. package/docs/services/eventbridge/README.md +9 -1
  295. package/docs/services/firehose/README.md +9 -3
  296. package/docs/services/glue/README.md +6 -0
  297. package/docs/services/iam/README.md +322 -27
  298. package/docs/services/kinesis/README.md +3 -2
  299. package/docs/services/kms/README.md +7 -2
  300. package/docs/services/lambda/README.md +76 -2
  301. package/docs/services/logs/README.md +16 -2
  302. package/docs/services/s3/README.md +7 -2
  303. package/docs/services/scheduler/README.md +12 -4
  304. package/docs/services/secretsmanager/README.md +6 -3
  305. package/docs/services/ses/README.md +3 -1
  306. package/docs/services/sns/README.md +5 -5
  307. package/docs/services/sqs/README.md +5 -5
  308. package/docs/services/ssm/README.md +40 -16
  309. package/docs/services/stepfunctions/README.md +11 -2
  310. package/docs/services/wafv2/README.md +5 -3
  311. package/package.json +1 -1
  312. package/dist/service/stepfunctions/command/machine/sim-state-machine-writes.d.ts +0 -25
@@ -1009,7 +1009,13 @@ A `viewer-response` Function runs for an Origin status below 400. CloudFront ski
1009
1009
  viewer-response event once the Origin has answered 400 or higher (see
1010
1010
  [Limitations](#limitations)), and so does this simulation.
1011
1011
 
1012
- Use `makeCffFunctionCodeInput` to pass a JavaScript handler function to `CreateFunctionCommand`.
1012
+ Use `makeCffFunctionCodeInput` to pass a JavaScript handler function to `CreateFunctionCommand`, or
1013
+ [CloudFormation bindings](https://yulinsim.dev/services/cloudformation/#cloudfront-function-bindings "CloudFront Function bindings usage docs")
1014
+ to back a template Resource with one. A handler reference is what to reach for first. It stops on a
1015
+ breakpoint and can close over the test's own state. Publish the source itself where the test is
1016
+ about the code the Distribution carries, down to the 10 KB it has to fit in. A
1017
+ [Lambda@Edge](#simulated-lambdaedge) function is an ordinary simulated Lambda function, and the same
1018
+ choice covers it.
1013
1019
 
1014
1020
  The `host` header a function sees is the hostname the request was made to CloudFront with, being the
1015
1021
  Distribution domain name or one of its alternate domain names. Requests served on localhost arrive
@@ -1254,6 +1260,84 @@ service does. A test that deploys the Stack reports the overrun where the rest o
1254
1260
  ahead of `cdk deploy`. A handler passed as a function reference carries no source to count, and the
1255
1261
  limit leaves it alone.
1256
1262
 
1263
+ ### Reading a Function back
1264
+
1265
+ `ListFunctions` reports the Functions the Account holds. Each carries the `FunctionConfig` it was
1266
+ created with and the `FunctionMetadata` CloudFront gave it. `DescribeFunction` reports one by name,
1267
+ and `GetFunction` reports its code. A test that wants to know which Function a stack deployed, and
1268
+ on which runtime, asks one of these.
1269
+
1270
+ ```typescript sim-cloudfront-function-read
1271
+ /**
1272
+ * Reading a deployed CloudFront Function back.
1273
+ */
1274
+
1275
+ import {
1276
+ CreateFunctionCommand,
1277
+ DescribeFunctionCommand,
1278
+ GetFunctionCommand,
1279
+ ListFunctionsCommand,
1280
+ } from "@aws-sdk/client-cloudfront";
1281
+
1282
+ import { SimAws } from "@kensio/yulin";
1283
+
1284
+ const simAws = new SimAws();
1285
+ const simCloudFront = simAws.cloudFront();
1286
+
1287
+ await simCloudFront.createFunction(
1288
+ new CreateFunctionCommand({
1289
+ Name: "beacon",
1290
+ FunctionConfig: {
1291
+ Comment: "Answers the analytics beacon",
1292
+ Runtime: "cloudfront-js-2.0",
1293
+ },
1294
+ FunctionCode: Buffer.from(`
1295
+ function handler(event) {
1296
+ return { statusCode: 204, statusDescription: "No Content" };
1297
+ }
1298
+ `),
1299
+ }),
1300
+ );
1301
+
1302
+ // CloudFront publishes a new Function in the background.
1303
+ await simAws.backgroundTasksComplete();
1304
+
1305
+ const listed = await simCloudFront.listFunctions(new ListFunctionsCommand({}));
1306
+
1307
+ // cloudfront-js-2.0
1308
+ console.log(listed.FunctionList.Items[0]?.FunctionConfig.Runtime);
1309
+
1310
+ const described = await simCloudFront.describeFunction(
1311
+ new DescribeFunctionCommand({ Name: "beacon", Stage: "LIVE" }),
1312
+ );
1313
+
1314
+ // Answers the analytics beacon
1315
+ console.log(described.FunctionSummary.FunctionConfig.Comment);
1316
+
1317
+ const got = await simCloudFront.getFunction(
1318
+ new GetFunctionCommand({ Name: "beacon" }),
1319
+ );
1320
+
1321
+ // The source the Function was created with.
1322
+ console.log(Buffer.from(got.FunctionCode).toString());
1323
+ ```
1324
+
1325
+ `Stage` picks the copy to read. A Function is created into `DEVELOPMENT` and reaches `LIVE` once
1326
+ CloudFront has published it, and an omitted `Stage` means `DEVELOPMENT`, as it does on AWS. Asking
1327
+ for the `LIVE` copy of a Function still waiting to publish fails with `NoSuchFunctionExists`, and so
1328
+ does a name the Account holds no Function under.
1329
+
1330
+ `CreatedTime` and `LastModifiedTime` come off the simulated clock. Freezing time before the deploy
1331
+ pins both to an instant the test picked (see
1332
+ [Controlling simulated time](https://yulinsim.dev/time/ "Simulated time usage docs")).
1333
+
1334
+ A Function backed by a handler function reference was given no source to keep. `GetFunction` answers
1335
+ with that handler's own source text. That is the code the Function runs.
1336
+
1337
+ The whole list comes back. `Marker` and `MaxItems` paging is left out, matching the paging left out
1338
+ of the other simulated listings. `UpdateFunction`, `PublishFunction` and `TestFunction` are not
1339
+ simulated.
1340
+
1257
1341
  ### Calling a Function handler without a Distribution
1258
1342
 
1259
1343
  A test of the handler on its own, with no Distribution in front of it, still has to pass it a whole
@@ -2107,6 +2191,139 @@ Behavior is recorded under its `PathPattern`, the way a skipped Lambda@Edge asso
2107
2191
  `CreateDistribution` and `UpdateDistribution` still refuse the same ID, as real CloudFront refuses
2108
2192
  it.
2109
2193
 
2194
+ ## Cache policies
2195
+
2196
+ A cache policy decides what a cache Behavior keys its cache on and how long an object stays there.
2197
+ Declare one as `AWS::CloudFront::CachePolicy` and point a Behavior's `CachePolicyId` at it with a
2198
+ `Ref`, which is what CDK's `CachePolicy` construct synthesizes.
2199
+
2200
+ ```typescript sim-cloudfront-cache-policy
2201
+ /**
2202
+ * Reading back the cache policy a Behavior was given.
2203
+ */
2204
+
2205
+ import { GetDistributionCommand } from "@aws-sdk/client-cloudfront";
2206
+ import { SimAws } from "@kensio/yulin";
2207
+
2208
+ const simAws = new SimAws();
2209
+
2210
+ const stack = await simAws.cloudFormation().deployTemplate({
2211
+ stackName: "site-stack",
2212
+ template: {
2213
+ Resources: {
2214
+ SiteBucket: {
2215
+ Type: "AWS::S3::Bucket",
2216
+ Properties: { BucketName: "site-bucket" },
2217
+ },
2218
+ BeaconPolicy: {
2219
+ Type: "AWS::CloudFront::CachePolicy",
2220
+ Properties: {
2221
+ CachePolicyConfig: {
2222
+ Name: "BeaconPolicy",
2223
+ MinTTL: 0,
2224
+ DefaultTTL: 0,
2225
+ MaxTTL: 0,
2226
+ ParametersInCacheKeyAndForwardedToOrigin: {
2227
+ EnableAcceptEncodingGzip: false,
2228
+ CookiesConfig: { CookieBehavior: "none" },
2229
+ HeadersConfig: { HeaderBehavior: "none" },
2230
+ QueryStringsConfig: { QueryStringBehavior: "none" },
2231
+ },
2232
+ },
2233
+ },
2234
+ },
2235
+ SiteDistribution: {
2236
+ Type: "AWS::CloudFront::Distribution",
2237
+ DependsOn: ["SiteBucket", "BeaconPolicy"],
2238
+ Properties: {
2239
+ DistributionConfig: {
2240
+ DefaultRootObject: "index.html",
2241
+ Origins: [
2242
+ {
2243
+ Id: "SiteOrigin",
2244
+ DomainName: "site-bucket.s3.amazonaws.com",
2245
+ S3OriginConfig: {},
2246
+ },
2247
+ ],
2248
+ DefaultCacheBehavior: {
2249
+ TargetOriginId: "SiteOrigin",
2250
+ ViewerProtocolPolicy: "allow-all",
2251
+ // CachingOptimized, one of CloudFront's managed policies.
2252
+ CachePolicyId: "658327ea-f89d-4fab-a63d-7e88639e58f6",
2253
+ },
2254
+ CacheBehaviors: [
2255
+ {
2256
+ PathPattern: "/beacon",
2257
+ TargetOriginId: "SiteOrigin",
2258
+ ViewerProtocolPolicy: "allow-all",
2259
+ CachePolicyId: { Ref: "BeaconPolicy" },
2260
+ },
2261
+ ],
2262
+ },
2263
+ },
2264
+ },
2265
+ },
2266
+ Outputs: {
2267
+ DistributionId: { Value: { Ref: "SiteDistribution" } },
2268
+ BeaconPolicyId: { Value: { Ref: "BeaconPolicy" } },
2269
+ },
2270
+ },
2271
+ });
2272
+
2273
+ await stack.waitForDeployComplete();
2274
+
2275
+ const read = await simAws
2276
+ .cloudFront()
2277
+ .getDistribution(
2278
+ new GetDistributionCommand({ Id: stack.output("DistributionId") }),
2279
+ );
2280
+ const config = read.Distribution?.DistributionConfig;
2281
+
2282
+ // The managed ID the default Behavior was given.
2283
+ console.log(config?.DefaultCacheBehavior?.CachePolicyId);
2284
+
2285
+ // The ID of the policy the template created, which the path Behavior Refs.
2286
+ console.log(
2287
+ config?.CacheBehaviors?.Items?.[0]?.CachePolicyId ===
2288
+ stack.output("BeaconPolicyId"),
2289
+ );
2290
+ ```
2291
+
2292
+ A Behavior records the ID it was given, and `GetDistribution` reports it back for both the default
2293
+ Behavior and a named one. An update changing the policy is reported the same way.
2294
+
2295
+ Nothing here reads the policy itself. The TTLs, the cache key and the compression settings need a
2296
+ cache, and sim CloudFront holds none. Every request reaches the Origin whatever the policy would
2297
+ have cached on real CloudFront.
2298
+
2299
+ A policy name is unique within an account, as it is in CloudFront. A second
2300
+ `AWS::CloudFront::CachePolicy` claiming a name is refused with `CachePolicyAlreadyExists`.
2301
+ `Name` and `Comment` are the parts of `CachePolicyConfig` the policy carries.
2302
+
2303
+ ### Managed cache policies
2304
+
2305
+ CloudFront's seven managed policies are here from the start, under the IDs AWS publishes, and a
2306
+ Behavior names one without a template creating anything. `CachingOptimized`
2307
+ (`658327ea-f89d-4fab-a63d-7e88639e58f6`), `CachingDisabled` (`4135ea2d-6df8-44a3-9df3-4b5a84be39ad`),
2308
+ `CachingOptimizedForUncompressedObjects` (`b2884449-e4de-46a7-ac36-70bc7f1ddd6d`), `Amplify`
2309
+ (`2e54312d-136d-493c-8eb9-b001f22f67d2`), `Elemental-MediaPackage`
2310
+ (`08627262-05a9-4f76-9ded-b50ca2e3a84f`), `UseOriginCacheControlHeaders`
2311
+ (`83da9c7e-98b4-4e11-a168-04f0df8e2c65`) and `UseOriginCacheControlHeaders-QueryStrings`
2312
+ (`4cc15a8a-d715-48a4-82b8-cc0b614638fe`) are each held under the name
2313
+ [AWS publishes](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-cache-policies.html)
2314
+ for it. CDK's `CachePolicy.CACHING_OPTIMIZED` and its six siblings synthesize those IDs. A stack
2315
+ reaching for one deploys.
2316
+
2317
+ The managed policies sit in CloudFront's own namespace. A template may create a policy called
2318
+ `CachingDisabled` of its own, and deleting that stack leaves the managed one where it was.
2319
+
2320
+ A CloudFormation Distribution whose Behavior names a policy that is neither managed nor created here
2321
+ deploys without one. The `CachePolicyId` lands on `stack.ignoredProperties` under that Behavior, the
2322
+ way an absent response headers policy does, and the Behavior reports no policy.
2323
+
2324
+ `CreateDistribution` and `UpdateDistribution` still refuse the same ID with `NoSuchCachePolicy`, as
2325
+ real CloudFront refuses it.
2326
+
2110
2327
  ## Origin access controls
2111
2328
 
2112
2329
  An origin access control is how a Distribution authenticates to a private Origin. The Origin then
@@ -2712,7 +2929,8 @@ Sim CloudFront currently supports:
2712
2929
 
2713
2930
  - `CreateDistributionCommand`, `GetDistributionCommand`, `UpdateDistributionCommand` and
2714
2931
  `DeleteDistributionCommand`
2715
- - `CreateFunctionCommand` and `DeleteFunctionCommand`
2932
+ - `CreateFunctionCommand`, `ListFunctionsCommand`, `DescribeFunctionCommand`, `GetFunctionCommand`
2933
+ and `DeleteFunctionCommand`
2716
2934
  - Refusing Function code over CloudFront's 10 KB size limit, with `FunctionSizeLimitExceeded`
2717
2935
  - Key value stores, through both the CloudFront client and the key value store data client
2718
2936
  - S3 Origins backed by sim S3 Buckets, reading them as the Bucket policy allows
@@ -2726,6 +2944,7 @@ Sim CloudFront currently supports:
2726
2944
  - `LambdaFunctionAssociations` on a template's Distribution, and CDK's `edgeLambdas`
2727
2945
  - CloudFront Functions reading an associated key value store through `cf.kvs()`
2728
2946
  - `AWS::CloudFront::ResponseHeadersPolicy`, for headers a cache Behavior sets on every response
2947
+ - `AWS::CloudFront::CachePolicy`, and a Behavior's `CachePolicyId` read back through `GetDistribution`
2729
2948
  - `AWS::CloudFront::KeyValueStore`, and `KeyValueStoreAssociations` on `AWS::CloudFront::Function`
2730
2949
  - `AWS::CloudFront::OriginAccessControl`, letting an Origin read a private Bucket as CloudFront
2731
2950
  - Viewer certificates from sim ACM, including CloudFront's `us-east-1` requirement
@@ -2868,7 +3087,12 @@ Where sim CloudFront knowingly behaves differently from AWS:
2868
3087
  share of real responses carry `Server-Timing`. This simulation adds it to every response once
2869
3088
  `Enabled` is true. A test asserting on it never depends on chance. The header's value is a
2870
3089
  fixed placeholder, since nothing here measures an Origin fetch the way CloudFront's edge does.
2871
- - **`CachePolicyId` and `OriginRequestPolicyId` are accepted and ignored.** Sim CloudFront models no
2872
- edge caching. A Behavior's cache policy, including an AWS managed policy such as
2873
- `CachingOptimized`, is left unvalidated and unapplied to TTLs and the cache key. Every request
2874
- reaches the Origin, whatever the policy would have cached on real CloudFront.
3090
+ - **A cache policy is recorded and never applied.** Sim CloudFront models no edge caching. A
3091
+ Behavior's `CachePolicyId` is checked against the policies this simulation holds and reported
3092
+ back, and the TTLs, the cache key and the compression settings behind it decide nothing. Every
3093
+ request reaches the Origin, whatever the policy would have cached on real CloudFront.
3094
+ - **A cache policy carries its name and its comment, and nothing else.** The TTLs and
3095
+ `ParametersInCacheKeyAndForwardedToOrigin` of an `AWS::CloudFront::CachePolicy` are read past,
3096
+ since nothing here would act on them.
3097
+ - **`OriginRequestPolicyId` is accepted and ignored.** A Behavior's origin request policy is left
3098
+ unvalidated, and `AWS::CloudFront::OriginRequestPolicy` is skipped.
@@ -285,10 +285,12 @@ deploy the stack, publish a breaching datapoint, advance the clock and read the
285
285
  whatever is subscribed. Deleting the stack deletes the alarm and takes its scheduled evaluation back
286
286
  off the clock with it.
287
287
 
288
- `AlarmName` may be left out, and the alarm is then named after the stack and the logical ID. A test
289
- still has a name to pass to `DescribeAlarms`. Real CloudFormation generates a physical ID of the
290
- same shape with a random tail on the end. The tail is left off here, so the name is one a test can
291
- predict.
288
+ `AlarmName` may be left out, and the alarm is then named after the stack, the logical ID and a tail
289
+ derived from both. Real CloudFormation ends a physical ID of the same shape in twelve random
290
+ characters, and the tail here comes from the name it follows, giving one alarm the same name at
291
+ every deployment. `simAws.cloudWatch().allAlarms()` hands a test the name to pass to
292
+ `DescribeAlarms`, and [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
293
+ cover how a long name is trimmed.
292
294
 
293
295
  These are the properties acted on: `AlarmName`, `AlarmDescription`, `ActionsEnabled`,
294
296
  `AlarmActions`, `OKActions`, `InsufficientDataActions`, `Namespace`, `MetricName`, `Dimensions`,
@@ -3314,10 +3314,11 @@ same thing about the property and differ in what they do about it. A direct API
3314
3314
  request to fail, and a template has every other resource in it to think about.
3315
3315
 
3316
3316
  `UserPoolName` and `ClientName` are optional. A template that sets neither gets
3317
- `<stack name>-<logical id>`, as real CloudFormation generates a name, trimmed to the 128 characters
3318
- Cognito allows if the two are longer than that together. Real CloudFormation adds random characters
3319
- on the end and this adds none. The name is the same on every deployment of the same template, and a
3320
- test can assert it.
3317
+ `<stack name>-<logical id>-<tail>`, as real CloudFormation generates a name, trimmed to the 128
3318
+ characters Cognito allows if the parts are longer than that together. The tail is twelve characters
3319
+ derived from the other two, where real CloudFormation ends the name in twelve random ones. The name
3320
+ is the same on every deployment of the same template, and [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
3321
+ cover how a long name is trimmed.
3321
3322
 
3322
3323
  ## Registering a pool with a chosen pool id
3323
3324
 
@@ -3461,13 +3462,13 @@ await stack.waitForDeployComplete();
3461
3462
 
3462
3463
  const userPoolId = stack.output("PoolId");
3463
3464
 
3464
- // The pool is named after the stack and the logical id, as the template named
3465
- // neither it nor the client.
3465
+ // The pool is named after the stack, the logical id and a tail derived from
3466
+ // both, as the template named neither it nor the client.
3466
3467
  const described = await simAws
3467
3468
  .cognitoIdentityProvider()
3468
3469
  .describeUserPool(new DescribeUserPoolCommand({ UserPoolId: userPoolId }));
3469
3470
 
3470
- console.log(described.UserPool?.Name); // "app-stack-Pool"
3471
+ console.log(described.UserPool?.Name); // "app-stack-Pool-2c3041dc539d"
3471
3472
 
3472
3473
  // What the template declared is reported back. This one is acted on: it is
3473
3474
  // what says only an admin creates users in this pool.
@@ -3107,11 +3107,12 @@ the template gets wrong fails the same way it would for an SDK caller.
3107
3107
  updates it. A specification the template got wrong is refused in the words `UpdateTimeToLive`
3108
3108
  refuses it in.
3109
3109
 
3110
- A table with no `TableName` is named after the stack and its logical ID. The table above with its
3111
- name left out would be `orders-stack-OrdersTable`. Real CloudFormation adds random characters to
3112
- that, which a template cannot predict either way. Two stacks deploying the same template get two
3113
- differently named tables. The generated name is trimmed to the 255 characters a table name allows,
3114
- ending in a hash of the untrimmed name so two long names that start the same stay apart.
3110
+ A table with no `TableName` is named after the stack, its logical ID and a tail derived from both.
3111
+ The table above with its name left out would be `orders-stack-OrdersTable-` and twelve more
3112
+ characters, where real CloudFormation ends the name in twelve random ones. Two stacks deploying the
3113
+ same template get two differently named tables. The name is trimmed to the 255 characters a table
3114
+ name allows, and [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
3115
+ cover how the stack name and the logical ID share what is left.
3115
3116
 
3116
3117
  `Fn::GetAtt … StreamArn` gives the ARN of the stream the table's `StreamSpecification` gave it. On a
3117
3118
  table with no `StreamSpecification` it is refused by name, naming the table, since an invented
@@ -706,7 +706,8 @@ real ECS accepts for a parameter in the task's own region. A Secrets Manager ARN
706
706
  key, a version stage and a version id after the secret id, in the form
707
707
  `...:secret:orders/db-AbCdEf:password::` that a CDK construct given a field writes. The key selects
708
708
  one field of a secret holding a JSON object. A `SecureString` parameter is decrypted, as it is for a
709
- real task.
709
+ real task. The decryption is made with the execution role's own permissions, and that role needs
710
+ `kms:Decrypt` on top of `ssm:GetParameter`.
710
711
 
711
712
  A secret that cannot be resolved stops the task before any container runs, with a
712
713
  `ResourceInitializationError` reason naming the variable:
@@ -1431,7 +1432,9 @@ console.log(processedOrders); // ["outstanding orders"]
1431
1432
 
1432
1433
  A binding can name the task definition Resource instead, which is what a CDK stack gives a test to
1433
1434
  name. The construct ID is accepted as well as the synthesized logical ID, and the container name can
1434
- be left out where the task definition declares one container. A binding naming an image repository
1435
+ be left out where the task definition declares one container. This is the form to use for a task
1436
+ definition the template declares no `Family` for, since the family CloudFormation generates for it
1437
+ ends in a tail a test would have to deploy the stack to learn. A binding naming an image repository
1435
1438
  matches any container running an image from it, whichever family declares it, which covers a tag
1436
1439
  that changes with every build.
1437
1440
 
@@ -1604,9 +1607,9 @@ const listed = await simAws
1604
1607
  console.log(listed.taskArns?.length); // 2
1605
1608
  ```
1606
1609
 
1607
- An unnamed service is named after the stack and the logical ID, as a cluster and a family are. A
1608
- service declaring no `DesiredCount` keeps one task running, which is what real CloudFormation gives
1609
- a new service.
1610
+ An unnamed service is named after the stack, the logical ID and a tail derived from both, as a
1611
+ cluster and a family are. `Fn::GetAtt ... Name` answers with the generated name. A service declaring
1612
+ no `DesiredCount` keeps one task running, which is what real CloudFormation gives a new service.
1610
1613
 
1611
1614
  Updating the stack moves the service. A changed `DesiredCount` scales it, and a changed task
1612
1615
  definition moves it onto the revision the update registered, replacing the tasks it was keeping.
@@ -1645,6 +1648,10 @@ task definition revision it would run, `DescribeTasks` and `StopTask`, which tak
1645
1648
  and the service operations, which take the service's ARN. `CreateService` authorizes against the ARN
1646
1649
  the service is about to have, and a policy can therefore name one service by name before it exists.
1647
1650
 
1651
+ A registration carrying a `taskRoleArn` or an `executionRoleArn` hands ECS a Role it runs the task
1652
+ as, and `RegisterTaskDefinition` authorizes `iam:PassRole` against each of them. Either Role left out
1653
+ passes nothing. See [passing a Role to a service](https://yulinsim.dev/services/iam/#passing-a-role-to-a-service) in the IAM docs.
1654
+
1648
1655
  ```typescript sim-ecs-iam-policy
1649
1656
  /**
1650
1657
  * A simulated IAM policy allowing a Role to register task definitions.
@@ -1782,7 +1789,8 @@ console.log(described.taskDefinition?.revision); // 1
1782
1789
 
1783
1790
  ## Available functionality
1784
1791
 
1785
- - `RegisterTaskDefinitionCommand`, with revisions numbered per family from one
1792
+ - `RegisterTaskDefinitionCommand`, with revisions numbered per family from one, authorizing
1793
+ `iam:PassRole` on the `taskRoleArn` and the `executionRoleArn` it names
1786
1794
  - `DeregisterTaskDefinitionCommand`, marking one revision `INACTIVE`
1787
1795
  - `DescribeTaskDefinitionCommand`, taking a family, a `family:revision` or a full ARN
1788
1796
  - `ListTaskDefinitionsCommand` and `ListTaskDefinitionFamiliesCommand`, with prefix, status and
@@ -1967,9 +1975,12 @@ Current documented limitations:
1967
1975
  `DescribeServices` and `ListTasks` are what report those.
1968
1976
  - Task definition and cluster tags are stored and reported, but `TagResource`, `UntagResource` and
1969
1977
  `ListTagsForResource` are absent.
1970
- - An unnamed cluster, task definition or service gets a name composed from the stack name and the
1971
- logical ID, without the random part real CloudFormation adds, which makes it predictable in a
1972
- test. A stack deployed twice under different names therefore gets two different families.
1978
+ - An unnamed cluster, task definition or service gets a name composed from the stack name, the
1979
+ logical ID and a tail derived from both, in place of the random characters real CloudFormation
1980
+ ends one with. The same stack redeployed gets the same names, and a stack deployed twice under
1981
+ different names gets two different families.
1982
+ [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
1983
+ cover the tail and how a long name is trimmed.
1973
1984
  - A service that declares no `DesiredCount` keeps one task running. That is the default real
1974
1985
  CloudFormation documents for a new service. A `DesiredCount` written as the text of a number is
1975
1986
  taken as that number, since a String Parameter resolves to text, and anything else is refused
@@ -1421,8 +1421,12 @@ fails the deployment.
1421
1421
  - `TargetGroupArn`, `TargetGroupName` and `TargetGroupFullName` on a target group
1422
1422
  - `ListenerArn` on a listener, and `RuleArn` and `IsDefault` on a rule
1423
1423
 
1424
- An unnamed load balancer or target group is named after the stack and the logical ID, trimmed to the
1425
- 32 characters ELB allows. A target group declaring `Targets` has them registered as part of creating
1424
+ An unnamed load balancer or target group is named after the stack, the logical ID and a tail derived
1425
+ from both, trimmed to the 32 characters ELB allows. The tail takes 13 of those. A name that has to
1426
+ be trimmed gives the stack name and the logical ID nine characters each, and either takes what the
1427
+ other leaves.
1428
+ [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
1429
+ cover the rule. A target group declaring `Targets` has them registered as part of creating
1426
1430
  it, and the group routes as soon as the stack has deployed.
1427
1431
 
1428
1432
  ```typescript sim-elbv2-cloudformation
@@ -909,7 +909,10 @@ console.log(handled.length); // 1
909
909
  `Ref` returns the **name** of a bus or a rule, and never its ARN. That is what AWS returns, and it
910
910
  makes a bus `Ref` usable straight away as another resource's `EventBusName`. The ARN comes from
911
911
  `Fn::GetAtt ... Arn`, which an `AWS::Lambda::Permission` `SourceArn` needs. An unnamed rule gets a
912
- name generated from the stack name and the logical ID, as real CloudFormation generates one.
912
+ name generated from the stack name, the logical ID and a tail derived from both, as
913
+ [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
914
+ describe. A rule name caps at 64 characters. A stack name and logical ID longer than that together
915
+ are trimmed to 25 characters each, and either takes what the other leaves.
913
916
 
914
917
  A target property this simulation leaves out, such as `InputTransformer` or `InputPath`, is refused
915
918
  at deploy time naming the property and the Resource. The alternative is a rule that sends the whole
@@ -1005,6 +1008,10 @@ console.log(JSON.stringify(policy).length > 0); // true
1005
1008
  A caller refused by IAM gets `AccessDeniedException`. Permission is checked before the bus is looked
1006
1009
  up, and a caller who may not reach a bus is refused whether or not that bus exists.
1007
1010
 
1011
+ An ECS target carries a `RoleArn`, which the rule runs the task as. Adding one hands EventBridge that
1012
+ Role, and `PutTargets` authorizes `iam:PassRole` against it. See
1013
+ [passing a Role to a service](https://yulinsim.dev/services/iam/#passing-a-role-to-a-service) in the IAM docs.
1014
+
1008
1015
  ## Scoping
1009
1016
 
1010
1017
  Buses belong to one account and region, as they do on real AWS:
@@ -1057,6 +1064,7 @@ no permission for.
1057
1064
  listings.
1058
1065
  - The event envelope EventBridge builds from an entry, reached through `eventsOn(...)`.
1059
1066
  - IAM authorization against the bus ARN.
1067
+ - `iam:PassRole` authorization of the `RoleArn` an ECS target carries.
1060
1068
  - SDK interception of `EventBridgeClient`.
1061
1069
 
1062
1070
  ## Limitations
@@ -378,6 +378,10 @@ Deleting the delivery stream stops it reading. Records put afterwards stay on th
378
378
  Every Firehose operation authorizes against the `firehose:` action of the same name, on the ARN of
379
379
  the delivery stream it names. `ListDeliveryStreams` names none, and authorizes against `*`.
380
380
 
381
+ Creating a delivery stream hands Firehose the destination `RoleARN`, and the source `RoleARN` too
382
+ where it reads a Kinesis stream. `CreateDeliveryStream` authorizes `iam:PassRole` against each of
383
+ them. See [passing a Role to a service](https://yulinsim.dev/services/iam/#passing-a-role-to-a-service) in the IAM docs.
384
+
381
385
  The delivery itself is a separate request, made as the delivery stream's `RoleARN`. The caller who
382
386
  put the record needs no S3 permission at all, and a Role that cannot write to the Bucket fails the
383
387
  delivery. Real
@@ -607,8 +611,10 @@ writes into the Bucket beside it, as the Role beside it, and a Role without `s3:
607
611
  delivery the same way one created through `CreateDeliveryStream` does. Deleting the stack deletes the
608
612
  delivery stream.
609
613
 
610
- A delivery stream the template does not name is named after the stack and the logical ID, as real
611
- CloudFormation names one. The name is trimmed to the 64 characters Firehose allows.
614
+ A delivery stream the template does not name is named after the stack, the logical ID and a tail
615
+ derived from both, as real CloudFormation names one. The name is trimmed to the 64 characters
616
+ Firehose allows, and [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
617
+ cover how the two parts share what is left.
612
618
 
613
619
  `DeliveryStreamEncryptionConfigurationInput` and `DirectPutSourceConfiguration` are recorded against
614
620
  the resource as unsimulated, and the delivery stream deploys anyway. The destination properties this
@@ -737,7 +743,7 @@ console.log(Contents?.length);
737
743
 
738
744
  | Command | Notes |
739
745
  | ------------------------ | ------------------------------------------------------------------------------------------------------- |
740
- | `CreateDeliveryStream` | A name already in use raises `ResourceInUseException`. |
746
+ | `CreateDeliveryStream` | A name already in use raises `ResourceInUseException`. Authorizes `iam:PassRole` on each Role it names. |
741
747
  | `DeleteDeliveryStream` | The name is free again at once. Whatever was buffered goes with it. |
742
748
  | `ListDeliveryStreams` | Sorted by name, paged with `Limit` and `ExclusiveStartDeliveryStreamName`. |
743
749
  | `DescribeDeliveryStream` | Reports the one destination, and a Kinesis source under `Source`. |
@@ -131,6 +131,12 @@ Column names keep the case they were given, including partition keys. Real Glue
131
131
  and simulated [Athena](https://yulinsim.dev/services/athena/ "Simulated Athena usage docs") folds a
132
132
  column name only when it runs a query.
133
133
 
134
+ A database or a table the template leaves unnamed is named from the stack name, the logical ID and a
135
+ tail derived from both, folded the same way. A `LogTable` in `analytics-stack` becomes
136
+ `analytics-stack-logtable-` and twelve more characters, where real CloudFormation ends the name in
137
+ twelve random ones. The name is trimmed to the 255 bytes the catalog allows, and [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
138
+ cover how the stack name and the logical ID share what is left.
139
+
134
140
  ## Reading the catalog back
135
141
 
136
142
  `GetDatabase`, `GetDatabases`, `GetTable` and `GetTables` answer through the SDK. A `SimGlue` also