@kensio/yulin 1.20.15 → 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 (355) hide show
  1. package/README.md +13 -0
  2. package/dist/sdk/module/sim-sdk-module-client-interceptor.d.ts +5 -0
  3. package/dist/sdk/module/sim-sdk-module-client-interceptor.js +14 -0
  4. package/dist/sdk/module/sim-sdk-static-client-factory.d.ts +26 -0
  5. package/dist/sdk/module/sim-sdk-static-client-factory.js +59 -0
  6. package/dist/sdk/send-patch.d.ts +8 -0
  7. package/dist/sdk/send-patch.js +11 -0
  8. package/dist/service/aws/caller/sim-aws-ambient-caller.d.ts +23 -0
  9. package/dist/service/aws/caller/sim-aws-ambient-caller.js +12 -0
  10. package/dist/service/aws/caller/sim-aws-caller-resolver.d.ts +39 -6
  11. package/dist/service/aws/caller/sim-aws-caller-resolver.js +32 -30
  12. package/dist/service/aws/caller/sim-aws-caller.d.ts +9 -0
  13. package/dist/service/aws/caller/sim-aws-resolved-caller.d.ts +19 -0
  14. package/dist/service/aws/caller/sim-aws-resolved-caller.js +26 -0
  15. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts +12 -0
  16. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +6 -0
  17. package/dist/service/aws/factory/sim-aws-account-service-cache.d.ts +12 -0
  18. package/dist/service/aws/factory/sim-aws-account-service-cache.js +9 -0
  19. package/dist/service/aws/factory/sim-aws-registered-service-builder.js +3 -1
  20. package/dist/service/aws/factory/sim-aws-service-factory.d.ts +5 -0
  21. package/dist/service/aws/factory/sim-aws-service-factory.js +14 -0
  22. package/dist/service/aws/sim-aws-properties.d.ts +15 -0
  23. package/dist/service/aws/sim-aws.js +2 -1
  24. package/dist/service/cloudformation/command/create-stack/create-stack.handler.d.ts +4 -0
  25. package/dist/service/cloudformation/command/create-stack/create-stack.handler.js +4 -1
  26. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-deployer.js +2 -1
  27. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.d.ts +11 -2
  28. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.js +2 -1
  29. package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-stack-options.d.ts +6 -0
  30. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +11 -0
  31. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +17 -15
  32. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +12 -0
  33. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +2 -1
  34. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.d.ts +23 -0
  35. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.js +30 -0
  36. package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cfn-value-adapter.js +8 -0
  37. package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.d.ts +29 -12
  38. package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.js +51 -20
  39. package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.d.ts +19 -0
  40. package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.js +6 -0
  41. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.d.ts +7 -0
  42. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.js +9 -2
  43. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.d.ts +2 -0
  44. package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.js +2 -1
  45. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +6 -0
  46. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +4 -1
  47. package/dist/service/cloudformation/stack/sim-cfn-stack.js +2 -1
  48. package/dist/service/cloudformation/stack/sim-cfn-stack.type.d.ts +6 -0
  49. package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts +5 -0
  50. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.d.ts +37 -0
  51. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.js +50 -0
  52. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.d.ts +25 -0
  53. package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.js +21 -0
  54. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.d.ts +28 -0
  55. package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.js +48 -0
  56. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.d.ts +8 -0
  57. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.js +13 -0
  58. package/dist/service/cloudfront/cff/sim-cf-function-commands.d.ts +52 -0
  59. package/dist/service/cloudfront/cff/sim-cf-function-commands.js +51 -0
  60. package/dist/service/cloudfront/cff/sim-cff-configuration.d.ts +41 -0
  61. package/dist/service/cloudfront/cff/sim-cff-configuration.js +34 -0
  62. package/dist/service/cloudfront/cff/sim-cff-stage.d.ts +23 -0
  63. package/dist/service/cloudfront/cff/sim-cff-stage.js +30 -0
  64. package/dist/service/cloudfront/cff/sim-cloudfront-function.d.ts +6 -1
  65. package/dist/service/cloudfront/cff/sim-cloudfront-function.js +6 -0
  66. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.d.ts +27 -0
  67. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.js +42 -0
  68. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.d.ts +24 -0
  69. package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.js +32 -0
  70. 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
  71. package/dist/service/cloudfront/cfn/distro/{sim-cfn-cf-distro-response-headers-policy.js → sim-cfn-cf-distro-behavior-policies.js} +11 -37
  72. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +6 -5
  73. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +8 -7
  74. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.d.ts +23 -0
  75. package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.js +50 -0
  76. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts +1 -0
  77. package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +10 -0
  78. package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts +1 -0
  79. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
  80. package/dist/service/cloudfront/command/create-function/create-function.handler.js +7 -1
  81. package/dist/service/cloudfront/command/function/sim-cf-describe-function.d.ts +22 -0
  82. package/dist/service/cloudfront/command/function/sim-cf-describe-function.js +32 -0
  83. package/dist/service/cloudfront/command/function/sim-cf-function-access.d.ts +48 -0
  84. package/dist/service/cloudfront/command/function/sim-cf-function-access.js +48 -0
  85. package/dist/service/cloudfront/command/function/sim-cf-function-command.types.d.ts +97 -0
  86. package/dist/service/cloudfront/command/function/sim-cf-function-command.types.js +10 -0
  87. package/dist/service/cloudfront/command/function/sim-cf-function-lookup.d.ts +12 -0
  88. package/dist/service/cloudfront/command/function/sim-cf-function-lookup.js +21 -0
  89. package/dist/service/cloudfront/command/function/sim-cf-function-summary.d.ts +11 -0
  90. package/dist/service/cloudfront/command/function/sim-cf-function-summary.js +30 -0
  91. package/dist/service/cloudfront/command/function/sim-cf-get-function.d.ts +23 -0
  92. package/dist/service/cloudfront/command/function/sim-cf-get-function.js +33 -0
  93. package/dist/service/cloudfront/command/function/sim-cf-list-functions.d.ts +22 -0
  94. package/dist/service/cloudfront/command/function/sim-cf-list-functions.js +38 -0
  95. package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
  96. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.d.ts +18 -0
  97. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.js +30 -0
  98. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.d.ts +28 -0
  99. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.js +41 -0
  100. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts +2 -2
  101. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +6 -3
  102. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts +0 -10
  103. package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js +0 -19
  104. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
  105. package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +4 -2
  106. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +3 -3
  107. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +5 -5
  108. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +3 -3
  109. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +4 -4
  110. package/dist/service/cloudfront/distribution/sim-cf-distribution-configuration-state.d.ts +3 -1
  111. package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +2 -0
  112. package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +21 -0
  113. package/dist/service/cloudfront/error/sim-cloudfront.error.js +25 -0
  114. package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store-access.js +2 -10
  115. package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store.js +2 -1
  116. package/dist/service/cloudfront/sdk/sim-cloudfront-sdk-command-router.js +12 -0
  117. package/dist/service/cloudfront/sim-cf-authorize.d.ts +16 -0
  118. package/dist/service/cloudfront/sim-cf-authorize.js +19 -0
  119. package/dist/service/cloudfront/sim-cf-etag.d.ts +7 -0
  120. package/dist/service/cloudfront/sim-cf-etag.js +10 -0
  121. package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +8 -12
  122. package/dist/service/cloudfront/sim-cloudfront-commands.js +8 -17
  123. package/dist/service/cloudfront/sim-cloudfront-policies.d.ts +43 -0
  124. package/dist/service/cloudfront/sim-cloudfront-policies.js +53 -0
  125. package/dist/service/cloudfront/sim-cloudfront.d.ts +13 -17
  126. package/dist/service/cloudfront/sim-cloudfront.js +22 -25
  127. package/dist/service/ecr/authorize/sim-ecr-authorizer.d.ts +31 -0
  128. package/dist/service/ecr/authorize/sim-ecr-authorizer.js +38 -0
  129. package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.d.ts +11 -2
  130. package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.js +11 -2
  131. package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.d.ts +4 -2
  132. package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.js +8 -9
  133. package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.d.ts +7 -0
  134. package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.js +9 -0
  135. package/dist/service/ecr/sim-ecr.d.ts +7 -0
  136. package/dist/service/ecr/sim-ecr.js +16 -4
  137. package/dist/service/ecs/command/authorize/sim-ecs-authorizer.d.ts +12 -0
  138. package/dist/service/ecs/command/authorize/sim-ecs-authorizer.js +21 -0
  139. package/dist/service/ecs/command/register-task-definition/register-task-definition.handler.js +1 -0
  140. package/dist/service/ecs/sim-ecs-service-principal.d.ts +8 -0
  141. package/dist/service/ecs/sim-ecs-service-principal.js +8 -0
  142. package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.d.ts +12 -0
  143. package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.js +21 -0
  144. package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.d.ts +13 -0
  145. package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.js +9 -0
  146. package/dist/service/eventbridge/command/target/sim-event-bridge-put-targets.js +1 -0
  147. package/dist/service/firehose/command/authorize/sim-firehose-authorizer.d.ts +12 -0
  148. package/dist/service/firehose/command/authorize/sim-firehose-authorizer.js +20 -0
  149. package/dist/service/firehose/command/sim-firehose-delivery-stream-access.d.ts +4 -0
  150. package/dist/service/firehose/command/sim-firehose-delivery-stream-access.js +6 -0
  151. package/dist/service/firehose/command/stream/sim-firehose-create-delivery-stream.js +3 -1
  152. package/dist/service/firehose/sim-firehose-service-principal.d.ts +8 -0
  153. package/dist/service/firehose/sim-firehose-service-principal.js +8 -0
  154. package/dist/service/firehose/source/sim-firehose-source.d.ts +5 -0
  155. package/dist/service/firehose/source/sim-firehose-source.js +5 -0
  156. package/dist/service/glue/cfn/database/sim-cfn-glue-database-properties.js +2 -2
  157. package/dist/service/glue/cfn/sim-cfn-glue-generated-name.d.ts +10 -0
  158. package/dist/service/glue/cfn/sim-cfn-glue-generated-name.js +25 -0
  159. package/dist/service/glue/cfn/table/sim-cfn-glue-table-properties.js +2 -3
  160. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.d.ts +33 -2
  161. package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.js +33 -2
  162. package/dist/service/iam/authorize/allow/sim-iam-allow-statements.d.ts +4 -3
  163. package/dist/service/iam/authorize/allow/sim-iam-allow-statements.js +9 -3
  164. package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.d.ts +14 -5
  165. package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.js +16 -12
  166. package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.d.ts +36 -7
  167. package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.js +22 -11
  168. package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.d.ts +10 -71
  169. package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.js +7 -2
  170. package/dist/service/iam/authorize/context/sim-iam-auth-z-input.d.ts +87 -0
  171. package/dist/service/iam/authorize/context/sim-iam-auth-z-input.js +1 -0
  172. package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.d.ts +21 -3
  173. package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.js +34 -10
  174. package/dist/service/iam/authorize/match/sim-iam-principal-match.d.ts +29 -8
  175. package/dist/service/iam/authorize/match/sim-iam-principal-match.js +38 -13
  176. package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.d.ts +74 -0
  177. package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.js +92 -0
  178. package/dist/service/iam/authorize/sim-iam-account-auth-z.d.ts +21 -5
  179. package/dist/service/iam/authorize/sim-iam-account-auth-z.js +7 -3
  180. package/dist/service/iam/authorize/sim-iam-authorizer.d.ts +5 -2
  181. package/dist/service/iam/authorize/sim-iam-authorizer.js +3 -1
  182. package/dist/service/iam/authorize/sim-iam-inter-service-auth-z.d.ts +1 -1
  183. package/dist/service/iam/authorize/sim-iam-wildcard.js +39 -4
  184. package/dist/service/iam/cfn/managed-policy/sim-cfn-iam-managed-policy-creator.js +2 -1
  185. package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.d.ts +16 -0
  186. package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.js +36 -0
  187. package/dist/service/iam/cfn/role/sim-cfn-iam-role-properties-parser.js +9 -8
  188. package/dist/service/iam/cfn/sim-cfn-iam-optional-string.d.ts +17 -0
  189. package/dist/service/iam/cfn/sim-cfn-iam-optional-string.js +17 -0
  190. package/dist/service/iam/cfn/user/sim-cfn-iam-user-properties-parser.js +4 -8
  191. package/dist/service/iam/command/policy/create-policy/create-policy-input-resolver.js +2 -0
  192. package/dist/service/iam/command/policy/put-role-policy/put-role-policy.handler.js +5 -0
  193. package/dist/service/iam/command/policy/put-user-policy/put-user-policy.handler.js +5 -0
  194. package/dist/service/iam/command/role/create-role/create-role.handler.js +4 -1
  195. package/dist/service/iam/error/sim-iam.error.d.ts +11 -0
  196. package/dist/service/iam/error/sim-iam.error.js +13 -0
  197. package/dist/service/iam/index.d.ts +1 -0
  198. package/dist/service/iam/policy/sim-iam-policy-document-of-size.d.ts +18 -0
  199. package/dist/service/iam/policy/sim-iam-policy-document-of-size.js +41 -0
  200. package/dist/service/iam/role/sim-iam-deploy-role.d.ts +56 -0
  201. package/dist/service/iam/role/sim-iam-deploy-role.js +50 -0
  202. package/dist/service/iam/role/sim-iam-role-with-policy.factory.d.ts +11 -0
  203. package/dist/service/iam/role/sim-iam-role-with-policy.factory.js +4 -2
  204. package/dist/service/iam/sim-iam-account-parts.d.ts +16 -0
  205. package/dist/service/iam/sim-iam-account-parts.js +2 -0
  206. package/dist/service/iam/sim-iam.d.ts +12 -2
  207. package/dist/service/iam/sim-iam.js +12 -0
  208. package/dist/service/iam/validate/size/sim-iam-policy-document-size.d.ts +57 -0
  209. package/dist/service/iam/validate/size/sim-iam-policy-document-size.js +71 -0
  210. package/dist/service/kms/command/authorize/sim-kms-authorizer.d.ts +3 -1
  211. package/dist/service/kms/command/authorize/sim-kms-authorizer.js +4 -1
  212. package/dist/service/kms/command/sim-kms-request-options.d.ts +11 -0
  213. package/dist/service/kms/key/sim-kms-key-policy.d.ts +5 -4
  214. package/dist/service/kms/key/sim-kms-key-policy.js +4 -3
  215. package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.d.ts +2 -2
  216. package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.js +4 -3
  217. package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.d.ts +10 -0
  218. package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.js +25 -0
  219. package/dist/service/lambda/command/authorize/sim-lambda-resource-policies.d.ts +1 -1
  220. package/dist/service/lambda/command/create-function/create-function-authorizer.d.ts +9 -2
  221. package/dist/service/lambda/command/create-function/create-function-authorizer.js +16 -2
  222. package/dist/service/lambda/command/create-function/create-function.handler.js +1 -1
  223. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.d.ts +7 -2
  224. package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js +14 -2
  225. package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.js +1 -1
  226. package/dist/service/lambda/function/logging/sim-lambda-function-logging.d.ts +10 -1
  227. package/dist/service/lambda/function/logging/sim-lambda-function-logging.js +25 -1
  228. package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.d.ts +13 -0
  229. package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.js +18 -0
  230. package/dist/service/lambda/sim-lambda-service-principal.d.ts +7 -0
  231. package/dist/service/lambda/sim-lambda-service-principal.js +7 -0
  232. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.d.ts +46 -0
  233. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.js +49 -0
  234. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.d.ts +5 -0
  235. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.js +6 -0
  236. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.d.ts +5 -0
  237. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.js +6 -0
  238. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.d.ts +5 -0
  239. package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.js +6 -0
  240. package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.d.ts +9 -2
  241. package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.js +34 -5
  242. package/dist/service/logs/cfn/sim-logs-cfn-resource-deleter.js +1 -1
  243. package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.d.ts +4 -0
  244. package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.js +9 -4
  245. package/dist/service/logs/sim-logs-commands.d.ts +3 -0
  246. package/dist/service/logs/sim-logs-commands.js +4 -0
  247. package/dist/service/logs/sim-logs.js +6 -1
  248. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.d.ts +2 -2
  249. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.js +4 -3
  250. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.d.ts +12 -0
  251. package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.js +22 -0
  252. package/dist/service/s3/command/authorize/sim-s3-bucket-resource-policies.d.ts +1 -1
  253. package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.d.ts +10 -1
  254. package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.js +19 -1
  255. package/dist/service/scheduler/command/schedule/sim-scheduler-create-schedule.js +1 -0
  256. package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.d.ts +8 -0
  257. package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.js +9 -0
  258. package/dist/service/scheduler/command/schedule/sim-scheduler-update-schedule.js +1 -0
  259. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.d.ts +15 -0
  260. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.js +22 -0
  261. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.d.ts +4 -10
  262. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.js +13 -31
  263. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.d.ts +17 -0
  264. package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.js +30 -0
  265. package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.d.ts +6 -0
  266. package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.js +8 -3
  267. package/dist/service/sns/command/authorize/sim-sns-topic-resource-policies.d.ts +1 -1
  268. package/dist/service/sqs/command/authorize/sim-sqs-queue-resource-policies.d.ts +1 -1
  269. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.d.ts +16 -0
  270. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.js +23 -0
  271. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.d.ts +2 -4
  272. package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.js +5 -5
  273. package/dist/service/ssm/parameter/sim-ssm-kms-crypto.d.ts +6 -4
  274. package/dist/service/ssm/parameter/sim-ssm-kms-crypto.js +4 -4
  275. package/dist/service/ssm/parameter/sim-ssm-parameter-arn.d.ts +17 -0
  276. package/dist/service/ssm/parameter/sim-ssm-parameter-arn.js +20 -0
  277. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.d.ts +15 -9
  278. package/dist/service/ssm/parameter/sim-ssm-parameter-kms.js +20 -10
  279. package/dist/service/ssm/parameter/sim-ssm-parameter-name.js +3 -12
  280. package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.d.ts +41 -0
  281. package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.js +64 -0
  282. package/dist/service/stepfunctions/command/machine/sim-state-machine-create.d.ts +5 -2
  283. package/dist/service/stepfunctions/command/machine/sim-state-machine-create.js +6 -2
  284. package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.d.ts +26 -0
  285. package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.js +29 -0
  286. package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.d.ts +7 -0
  287. package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.js +12 -3
  288. package/dist/service/stepfunctions/command/machine/sim-state-machine-update.d.ts +19 -0
  289. package/dist/service/stepfunctions/command/machine/{sim-state-machine-writes.js → sim-state-machine-update.js} +3 -14
  290. package/dist/service/stepfunctions/sim-step-functions.d.ts +8 -2
  291. package/dist/service/stepfunctions/sim-step-functions.js +26 -9
  292. package/dist/service/sts/auth-z/assume-role-auth-z-coordinator.d.ts +9 -2
  293. package/dist/service/sts/auth-z/assume-role-auth-z-coordinator.js +2 -2
  294. package/dist/service/sts/auth-z/assume-role-source-account-auth-z.d.ts +10 -4
  295. package/dist/service/sts/auth-z/assume-role-source-account-auth-z.js +8 -7
  296. package/dist/service/sts/auth-z/assume-role-target-auth-z.d.ts +2 -2
  297. package/dist/service/sts/auth-z/assume-role-trust-policy-authorizer.d.ts +6 -2
  298. package/dist/service/sts/auth-z/assume-role-trust-policy-authorizer.js +14 -11
  299. package/dist/service/sts/command/assume-role/assume-role.handler.d.ts +10 -1
  300. package/dist/service/sts/command/assume-role/assume-role.handler.js +6 -2
  301. package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.d.ts +10 -1
  302. package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.js +5 -1
  303. package/dist/service/sts/service-role/sim-service-role.js +5 -1
  304. package/dist/service/sts/sim-sts.d.ts +18 -1
  305. package/dist/service/sts/sim-sts.js +8 -0
  306. package/dist/util/memo/bounded-memo.d.ts +36 -0
  307. package/dist/util/memo/bounded-memo.js +58 -0
  308. package/docs/README.md +54 -0
  309. package/docs/ai-skill/README.md +69 -0
  310. package/docs/cli/README.md +284 -0
  311. package/docs/factories/README.md +140 -0
  312. package/docs/lint/README.md +176 -0
  313. package/docs/non-aws-dependencies/README.md +261 -0
  314. package/docs/sdk/README.md +274 -0
  315. package/docs/serve/README.md +1126 -0
  316. package/docs/services/acm/README.md +823 -0
  317. package/docs/services/apigateway/README.md +1919 -0
  318. package/docs/services/apigatewayv2/README.md +2678 -0
  319. package/docs/services/athena/README.md +1044 -0
  320. package/docs/services/bedrock/README.md +350 -0
  321. package/docs/services/cloudformation/README.md +3625 -0
  322. package/docs/services/cloudfront/README.md +3098 -0
  323. package/docs/services/cloudwatch/README.md +422 -0
  324. package/docs/services/cognito/README.md +4924 -0
  325. package/docs/services/dynamodb/README.md +3785 -0
  326. package/docs/services/ecr/README.md +302 -0
  327. package/docs/services/ecs/README.md +2021 -0
  328. package/docs/services/elbv2/README.md +1901 -0
  329. package/docs/services/eventbridge/README.md +1118 -0
  330. package/docs/services/firehose/README.md +811 -0
  331. package/docs/services/glue/README.md +507 -0
  332. package/docs/services/iam/README.md +1578 -0
  333. package/docs/services/kinesis/README.md +455 -0
  334. package/docs/services/kms/README.md +664 -0
  335. package/docs/services/lambda/README.md +3719 -0
  336. package/docs/services/logs/README.md +882 -0
  337. package/docs/services/organizations/README.md +574 -0
  338. package/docs/services/personalize/README.md +835 -0
  339. package/docs/services/rekognition/README.md +1070 -0
  340. package/docs/services/route53/README.md +1783 -0
  341. package/docs/services/s3/README.md +3029 -0
  342. package/docs/services/scheduler/README.md +814 -0
  343. package/docs/services/secretsmanager/README.md +670 -0
  344. package/docs/services/ses/README.md +1013 -0
  345. package/docs/services/sns/README.md +1904 -0
  346. package/docs/services/sqs/README.md +1185 -0
  347. package/docs/services/ssm/README.md +1096 -0
  348. package/docs/services/stepfunctions/README.md +1341 -0
  349. package/docs/services/sts/README.md +245 -0
  350. package/docs/services/wafv2/README.md +1380 -0
  351. package/docs/terraform/README.md +248 -0
  352. package/docs/time/README.md +284 -0
  353. package/llms.txt +59 -0
  354. package/package.json +7 -4
  355. package/dist/service/stepfunctions/command/machine/sim-state-machine-writes.d.ts +0 -25
@@ -0,0 +1,248 @@
1
+ # Terraform
2
+
3
+ A team whose infrastructure is written in Terraform can deploy it into simulated AWS without
4
+ hand-writing a second CloudFormation template describing the same infrastructure. `TerraformAdapter`
5
+ reads the JSON `terraform show -json` writes for a saved plan file and creates the resources the
6
+ plan declares.
7
+
8
+ ```bash
9
+ npm i -D @kensio/yulin
10
+ ```
11
+
12
+ ## Deploying a plan
13
+
14
+ Write the JSON first. `terraform plan` produces the saved plan in Terraform's own binary format, and
15
+ `terraform show -json` turns that into the document the adapter reads.
16
+
17
+ ```bash
18
+ terraform plan -out=orders.tfplan
19
+ terraform show -json orders.tfplan > orders.tfplan.json
20
+ ```
21
+
22
+ A plan carries no code for its functions. It points at a zip on disk, an S3 object or a container
23
+ image, and none of the three is a handler Yulin can run. A binding matched on the function name the
24
+ plan declares is where the behaviour comes from.
25
+
26
+ ```typescript terraform-deploy-plan
27
+ /**
28
+ * Deploying a Terraform plan into simulated AWS.
29
+ */
30
+
31
+ import { SimAws } from "@kensio/yulin";
32
+ import { TerraformAdapter } from "@kensio/yulin/terraform";
33
+
34
+ const simAws = new SimAws();
35
+
36
+ const { stack } = await new TerraformAdapter(simAws).deployPlan({
37
+ planPath: "terraform/orders.tfplan.json",
38
+ bindings: [
39
+ {
40
+ functionName: "orders-processor",
41
+ handler: (event: { orderId: string }): string => `took ${event.orderId}`,
42
+ },
43
+ ],
44
+ });
45
+
46
+ // The bucket, the table and the queue the configuration declared.
47
+ console.log(simAws.s3().getSimBucketByName("orders-uploads")?.bucketName);
48
+ console.log(simAws.dynamoDb().findTable("orders-orders")?.tableName);
49
+
50
+ console.log(stack.status);
51
+ ```
52
+
53
+ The Stack is named after the plan file when the deployment does not name one, so
54
+ `orders.tfplan.json` deploys as `orders`. Pass `stackName` to name it yourself, and pass the path on
55
+ its own where nothing else needs saying.
56
+
57
+ ```typescript terraform-deploy-plan-path
58
+ /**
59
+ * Deploying a Terraform plan named by path alone.
60
+ */
61
+
62
+ import { SimAws } from "@kensio/yulin";
63
+ import { TerraformAdapter } from "@kensio/yulin/terraform";
64
+
65
+ const simAws = new SimAws();
66
+
67
+ const { stack } = await new TerraformAdapter(simAws).deployPlan(
68
+ "terraform/orders.tfplan.json",
69
+ );
70
+
71
+ console.log(stack.stackName);
72
+ ```
73
+
74
+ ## What comes back
75
+
76
+ `deployPlan` answers with the Stack and a report of what reading the plan made of it.
77
+
78
+ The Stack is an ordinary simulated CloudFormation Stack, and everything the [CloudFormation
79
+ docs](https://yulinsim.dev/services/cloudformation/ "Simulated CloudFormation usage docs") describe applies to it.
80
+ Resources are read with `stack.getResource(...)`, Outputs with `stack.output(...)`, and the whole
81
+ thing is torn down with `stack.delete()`.
82
+
83
+ ## What the adapter reads
84
+
85
+ A resource declared with `count` or `for_each` arrives in the plan already expanded, and each
86
+ instance becomes a resource of its own. Resources declared inside a module are reached through the
87
+ module path they were declared under, however many modules deep.
88
+
89
+ An attribute Terraform could not resolve at plan time is absent from the plan's values. The plan
90
+ keeps the reference behind it, and that reference becomes the link a hand-written template would
91
+ have carried.
92
+
93
+ Ordering is rebuilt. Terraform resolves what it can before writing the plan, so a Lambda permission
94
+ naming a function the same plan creates carries the function's name as a plain string. The value is
95
+ right and the edge CloudFormation orders from has gone with it. Every reference a resource declares
96
+ becomes an ordering edge, whether or not the value resolved.
97
+
98
+ ## Supplying environment variables and role policies
99
+
100
+ Terraform resolves nothing inside a value it could not build. A Lambda `environment.variables` map
101
+ holding one reference to a queue of the same plan arrives unknown in its entirety, and the variable
102
+ names go with it. An `aws_iam_role_policy` written with `jsonencode` around an ARN of the same plan
103
+ arrives without its statements.
104
+
105
+ Those two cost more than their count suggests (four attributes out of 154 on a hand-written
106
+ application configuration). A handler reads its configuration out of environment variables, and
107
+ simulated IAM evaluates authorization.
108
+
109
+ `overrides` supplies them, matched on the name the plan carries, the way a binding is matched on a
110
+ function name. An environment is matched on the function's name and an inline policy on the role's.
111
+
112
+ ```typescript terraform-plan-overrides
113
+ /**
114
+ * Supplying the values a Terraform plan could not carry.
115
+ */
116
+
117
+ import { SimAws } from "@kensio/yulin";
118
+ import { TerraformAdapter } from "@kensio/yulin/terraform";
119
+
120
+ const simAws = new SimAws();
121
+
122
+ const { report } = await new TerraformAdapter(simAws).deployPlan({
123
+ planPath: "terraform/orders.tfplan.json",
124
+ bindings: [
125
+ {
126
+ functionName: "orders-processor",
127
+ handler: (): string => process.env["QUEUE_URL"] ?? "",
128
+ },
129
+ ],
130
+ overrides: [
131
+ {
132
+ functionName: "orders-processor",
133
+ environment: {
134
+ TABLE_NAME: "orders-orders",
135
+ QUEUE_URL:
136
+ "https://sqs.eu-west-1.amazonaws.com/123456789012/orders-processing",
137
+ },
138
+ },
139
+ {
140
+ roleName: "orders-processor",
141
+ policy: {
142
+ Version: "2012-10-17",
143
+ Statement: [
144
+ {
145
+ Effect: "Allow",
146
+ Action: [
147
+ "sqs:ReceiveMessage",
148
+ "sqs:DeleteMessage",
149
+ "sqs:GetQueueAttributes",
150
+ ],
151
+ Resource: "*",
152
+ },
153
+ ],
154
+ },
155
+ },
156
+ ],
157
+ });
158
+
159
+ // The attributes the plan lost that no override covered.
160
+ console.log(report.lost);
161
+ ```
162
+
163
+ An override fills a gap. Where Terraform resolved the value, the plan wins, and environment
164
+ variables are merged one variable at a time. A configuration that stops collapsing a value stops
165
+ needing the override written for it.
166
+
167
+ A role whose policy no override supplies is created allowing everything, and `policy` is named on
168
+ the report's `lost`. Simulated IAM evaluates authorization, and a role holding no policy would deny
169
+ what the configuration allowed and fail the resources using it (an event source mapping is refused
170
+ outright when its execution role cannot poll the queue). Supplying the policy takes that default
171
+ off. The document is evaluated as it stands, and one omitting `sqs:ReceiveMessage` fails the mapping
172
+ the way AWS fails it.
173
+
174
+ ## What it maps
175
+
176
+ The adapter maps 24 Terraform resource types and folds 11 more into the resource they configure. The
177
+ set covers API Gateway, CloudWatch (log groups, metric alarms and EventBridge rules), Cognito,
178
+ DynamoDB, ECR, IAM, KMS, Lambda, S3, Secrets Manager, SNS, SQS and SSM Parameter Store.
179
+
180
+ A hand-written application configuration of 46 resources deploys whole. A configuration built out of
181
+ published `terraform-aws-modules` modules reaches 21 of its 25. Of the four it leaves, the Lambda
182
+ module uses `null_resource` and `local_file` to package a zip, and an integration and a route read
183
+ their values through a `for_each` hop the adapter steps over.
184
+
185
+ ## What the report says
186
+
187
+ A type with no mapping, and a resource from a provider other than AWS, are recorded and stepped over
188
+ rather than failing the deployment.
189
+
190
+ ```typescript terraform-plan-report
191
+ /**
192
+ * Reading what a Terraform plan import made of the plan.
193
+ */
194
+
195
+ import { SimAws } from "@kensio/yulin";
196
+ import { TerraformAdapter } from "@kensio/yulin/terraform";
197
+
198
+ const simAws = new SimAws();
199
+
200
+ const { report } = await new TerraformAdapter(simAws).deployPlan(
201
+ "terraform/orders.tfplan.json",
202
+ );
203
+
204
+ // [ { address: 'aws_s3_bucket.uploads', type: 'aws_s3_bucket',
205
+ // cfnType: 'AWS::S3::Bucket', logicalId: 'AwsS3BucketUploads' } ]
206
+ console.log(report.mapped);
207
+
208
+ // [ { address: 'aws_route53_zone.public', type: 'aws_route53_zone',
209
+ // reason: 'no mapping for resource type' } ]
210
+ console.log(report.skipped);
211
+
212
+ // The aws_s3_bucket_versioning and friends that became bucket properties.
213
+ console.log(report.folded);
214
+
215
+ // Attributes a mapping could not carry and no override supplied, such as a
216
+ // Lambda's environment variables, which Terraform collapses whole when one of
217
+ // them is unknown.
218
+ console.log(report.lost);
219
+ ```
220
+
221
+ `mapped`, `folded` and `skipped` add up to the plan's managed resource count. `lost` names the
222
+ attributes that did not survive the plan and that no override covered, per resource. A Terraform
223
+ value that names a resource of the same plan and sits inside something Terraform builds in one go,
224
+ such as a `jsonencode` document or a `for_each` map, is unknown in its entirety and its contents go
225
+ with it.
226
+
227
+ ## What a reference cannot reach
228
+
229
+ A value a plan resolved arrives as a value. A value the plan could not resolve arrives as a
230
+ reference, and the import follows that reference to the resource that will produce it, through
231
+ module outputs, module variables, `each.value` and `each.key`. That covers what a community module
232
+ such as `terraform-aws-modules/apigateway-v2/aws` does with a `routes` map.
233
+
234
+ Two shapes stop it, and both are recorded as `unresolved required attribute` on `report.skipped`.
235
+
236
+ A plan records the references of a whole collection in one list, and the list says what the
237
+ collection was built from without saying which entry holds which. A `routes` map naming one function
238
+ is unambiguous. A `routes` map naming two functions leaves `each.value.uri` able to mean either, and
239
+ the import declines. Setting the value with a resource of its own, or with one module call per
240
+ function, gives each reference a collection to itself.
241
+
242
+ A value reaching a resource through a `local` is out of range whatever it holds. A plan carries the
243
+ locals' effects and none of their definitions, so there is nothing to follow.
244
+
245
+ ## The scope of what it reads
246
+
247
+ One plan JSON file, already produced. Reading HCL, reading `terraform.tfstate`, and running
248
+ `terraform` as a subprocess are all outside it.
@@ -0,0 +1,284 @@
1
+ # Simulated time
2
+
3
+ Every timestamp a simulated AWS service produces comes from that simulation's own clock, and that
4
+ clock can be moved. Time can be frozen, set to an instant, or advanced by a duration. Behaviour that
5
+ depends on time passing, such as a temporary session expiring, can be tested without waiting for it.
6
+
7
+ Time belongs to a `SimAws` instance. Moving it affects that instance only. The host clock, another
8
+ simulation running in the same test file, and any other code in the process all carry on unchanged.
9
+
10
+ ## Reading the time
11
+
12
+ `simAws.now()` is what the simulation means by "now". The host clock may say something different. It
13
+ also stamps simulated resources, such as an IAM User's `CreateDate` and an `AssumeRole` session's
14
+ `Expiration`.
15
+
16
+ By default a new `SimAws` runs in step with the real system clock.
17
+
18
+ ## Starting at a known instant
19
+
20
+ Pass a clock to start somewhere specific. `SimFixedClock` is the usual choice, since it reports one
21
+ instant and stays there:
22
+
23
+ ```typescript sim-clock-freeze-and-advance
24
+ /**
25
+ * Starting a simulation at a known instant, then moving its clock on.
26
+ */
27
+
28
+ import { CreateUserCommand } from "@aws-sdk/client-iam";
29
+ import { SimAws, SimFixedClock } from "@kensio/yulin";
30
+
31
+ const simAws = new SimAws({
32
+ clock: new SimFixedClock(new Date("2026-07-26T09:00:00.000Z")),
33
+ });
34
+
35
+ const output = await simAws
36
+ .iam()
37
+ .createUser(new CreateUserCommand({ UserName: "Clockwatcher" }));
38
+
39
+ console.log(output.User.CreateDate); // 2026-07-26T09:00:00.000Z
40
+
41
+ await simAws.clock().advanceBy({ hours: 2, minutes: 30 });
42
+
43
+ console.log(simAws.now()); // 2026-07-26T11:30:00.000Z
44
+
45
+ // Still two and a half hours ahead of the clock it was given. That clock is a
46
+ // fixed one, so simulated time stays at 11:30 rather than running on.
47
+ simAws.clock().resume();
48
+ ```
49
+
50
+ Simulated time is layered over whatever clock is supplied. A simulation started at a fixed instant
51
+ is still free to move from there, and it stays measured against that clock. Resuming a simulation
52
+ built on a `SimFixedClock` puts it back in running mode, and its time then moves whenever the clock
53
+ underneath moves. A fixed clock stays where it is. Leave the default real clock in place for a
54
+ simulation whose time should pass by itself.
55
+
56
+ ## Frozen and running
57
+
58
+ There are two modes:
59
+
60
+ - **Frozen**: simulated time only moves when something moves it. A frozen clock reports the same
61
+ instant however long the host takes, and a slow test holds the state it set up. This is what a
62
+ deterministic assertion wants.
63
+ - **Running**: simulated time tracks the clock underneath, offset from it. On the default real clock
64
+ time passes by itself. Use it to jump forward an hour and carry on.
65
+
66
+ Moving time deliberately freezes it. `setTo(...)` and `advanceBy(...)` both leave the clock stopped
67
+ where they put it. A test that asked for a specific instant then asserts on that instant, however
68
+ long the assertion takes. `resume()` is the way back to running, and it carries on from where the
69
+ clock stopped.
70
+
71
+ `simAws.clock().isFrozen` reports which mode the clock is in.
72
+
73
+ ## Advancing time
74
+
75
+ `advanceBy(...)` takes a duration written as any combination of `days`, `hours`, `minutes`,
76
+ `seconds` and `milliseconds`, which add together. A bare number counts milliseconds, as it does for
77
+ `setTimeout`, and `advanceBy(3_600_000)` moves an hour. Durations are never negative, since time
78
+ passing only runs forwards. `setTo(...)` is the explicit way to move a clock back.
79
+
80
+ Advancing moves the clock, and it runs whatever the passage of time should have caused. Work
81
+ scheduled for an instant inside the interval is dispatched in due order, each task running with the
82
+ clock reading its own due time. Further work it schedules settles before `advanceBy` returns where
83
+ that work is itself due by the new time, and stays queued where it falls later. So a test can
84
+ advance and then assert, with no additional waiting:
85
+
86
+ ```typescript sim-clock-session-expiry
87
+ /**
88
+ * Advancing simulated time past a temporary session's expiry.
89
+ */
90
+
91
+ import { CreateRoleCommand } from "@aws-sdk/client-iam";
92
+ import { AssumeRoleCommand } from "@aws-sdk/client-sts";
93
+ import { SimAws } from "@kensio/yulin";
94
+
95
+ const simAws = new SimAws();
96
+ const simIam = simAws.iam();
97
+
98
+ await simIam.createRole(
99
+ new CreateRoleCommand({
100
+ RoleName: "ReportingRole",
101
+ AssumeRolePolicyDocument: JSON.stringify({
102
+ Version: "2012-10-17",
103
+ Statement: {
104
+ Effect: "Allow",
105
+ Principal: { AWS: `arn:aws:iam::${simAws.defaultAccountId}:root` },
106
+ Action: "sts:AssumeRole",
107
+ },
108
+ }),
109
+ }),
110
+ );
111
+
112
+ // A fifteen minute session.
113
+ const assumeRoleOutput = await simAws.sts().assumeRole(
114
+ new AssumeRoleCommand({
115
+ RoleArn: `arn:aws:iam::${simAws.defaultAccountId}:role/ReportingRole`,
116
+ RoleSessionName: "reporting-session",
117
+ DurationSeconds: 900,
118
+ }),
119
+ );
120
+
121
+ const issued = assumeRoleOutput.Credentials!;
122
+ const credentials = {
123
+ accessKeyId: issued.AccessKeyId!,
124
+ secretAccessKey: issued.SecretAccessKey!,
125
+ sessionToken: issued.SessionToken!,
126
+ };
127
+
128
+ // The session authenticates while it is current.
129
+ console.log(simIam.credentials.resolveCredentials(credentials).principal);
130
+
131
+ await simAws.clock().advanceBy({ minutes: 20 });
132
+
133
+ try {
134
+ simIam.credentials.resolveCredentials(credentials);
135
+ } catch (error) {
136
+ // Rejected as an expired session, twenty simulated minutes later.
137
+ console.log((error as Error).message);
138
+ }
139
+ ```
140
+
141
+ Work triggered by advancing that fails throws from `advanceBy(...)`, where the caller can see it.
142
+ The clock is left at the point it failed, and anything still queued stays queued.
143
+
144
+ Delivery to a target is the exception, and deliberately so. An EventBridge rule or a Scheduler
145
+ schedule that cannot reach its target records the failure instead of throwing. Real AWS reports a
146
+ failed delivery to nobody, and one rejected delivery would otherwise fail an unrelated
147
+ `advanceBy(...)` elsewhere in the same test. Read the failures from `eventBridge().deliveryFailures`
148
+ and `scheduler().deliveryFailures`.
149
+
150
+ A Step Functions execution works the same way. A state that fails while the clock is being advanced
151
+ is recorded on the execution, and `DescribeExecution` reports it once the advance has returned.
152
+
153
+ Several parts of the simulator schedule work on the clock. Advancing time does more than change what
154
+ timestamps and expiry checks see. A scheduled EventBridge rule fires, an EventBridge Scheduler
155
+ schedule invokes its target, a DynamoDB item passes its time to live, a Secrets Manager deletion
156
+ falls due, a Step Functions execution moves on from a `Wait` state, and a Lambda event source
157
+ mapping polls again. Each of those runs at its own due instant inside the interval, in the order
158
+ they fall due.
159
+
160
+ ## Time inside a simulated Lambda handler
161
+
162
+ A simulated Lambda function runs on its simulation's clock, and that reaches the JavaScript clock
163
+ the function code itself reads. `Date.now()` and `new Date()` inside a handler report simulated
164
+ time. Code stamping an expiry or building a date-partitioned key can be tested against a clock the
165
+ test controls:
166
+
167
+ ```typescript sim-clock-lambda-handler
168
+ /**
169
+ * A simulated Lambda handler reading the simulation's clock.
170
+ */
171
+
172
+ import { CreateFunctionCommand, InvokeCommand } from "@aws-sdk/client-lambda";
173
+
174
+ import { SimAws, SimFixedClock } from "@kensio/yulin";
175
+ import { makeLambdaZipFileInput } from "@kensio/yulin/lambda";
176
+
177
+ const simAws = new SimAws({
178
+ clock: new SimFixedClock(new Date("2026-07-26T09:00:00.000Z")),
179
+ });
180
+ const lambda = simAws.lambda();
181
+
182
+ await lambda.createFunction(
183
+ new CreateFunctionCommand({
184
+ FunctionName: "stamper",
185
+ Role: "arn:aws:iam::111111111111:role/StamperRole",
186
+ Code: {
187
+ // The handler asks JavaScript for the time, not the simulator.
188
+ ZipFile: makeLambdaZipFileInput(() => ({ at: new Date().toISOString() })),
189
+ },
190
+ }),
191
+ );
192
+
193
+ const first = await lambda.invoke(
194
+ new InvokeCommand({ FunctionName: "stamper" }),
195
+ );
196
+ console.log(Buffer.from(first.Payload!).toString()); // {"at":"2026-07-26T09:00:00.000Z"}
197
+
198
+ await simAws.clock().advanceBy({ hours: 2 });
199
+
200
+ const second = await lambda.invoke(
201
+ new InvokeCommand({ FunctionName: "stamper" }),
202
+ );
203
+ console.log(Buffer.from(second.Payload!).toString()); // {"at":"2026-07-26T11:00:00.000Z"}
204
+ ```
205
+
206
+ How that is arranged depends on where the function code runs. One of the two touches a process
207
+ global:
208
+
209
+ - **Zip code** runs in a vm sandbox owning its own globals, and is handed a `Date` bound to the
210
+ simulation's clock. The globals outside the sandbox are left alone.
211
+ - **A real in-process handler function** is a closure over the module scope it was written in, and
212
+ reads the global `Date` like everything else in the test run. So the global is substituted for one
213
+ reporting the invocation's clock while an invocation is running, and the host clock otherwise,
214
+ tracked with `AsyncLocalStorage` so concurrent invocations of different simulations stay apart. It
215
+ is installed on the first in-process invocation and never removed, and with no invocation running
216
+ it behaves exactly as the host's own `Date` does.
217
+
218
+ Only the current time comes from the clock. `new Date("2020-03-12")`, `Date.parse(...)`,
219
+ `Date.UTC(...)` and `instanceof Date` all behave as they always did.
220
+
221
+ Under a frozen clock `Date.now()` returns the same number for the whole invocation, and handler code
222
+ that waits for it to change never finishes. Call `resume()` before invoking if the code under test
223
+ polls the clock.
224
+
225
+ ### Where real AWS gets the time
226
+
227
+ Real Lambda has no current-time API. The context object carries no timestamp, only
228
+ `getRemainingTimeInMillis()`, and no environment variable holds one. Handler code reading `new
229
+ Date()` is reading the machine clock. AWS does provide the time on the event:
230
+
231
+ | Event source | Field |
232
+ | ------------------------- | ------------------------------------------------- |
233
+ | EventBridge | `time` |
234
+ | Function URL, API Gateway | `requestContext.timeEpoch`, `requestContext.time` |
235
+ | S3 notification | `Records[].eventTime` |
236
+ | SNS | `Records[].Sns.Timestamp` |
237
+ | SQS | `Records[].attributes.SentTimestamp` |
238
+
239
+ For a scheduled invocation AWS advises reading the event's `time` in preference to the system clock,
240
+ because a retry or a delayed delivery runs later than the time the work was for. Simulated Lambda
241
+ follows the same rule where it builds events. A Function URL request carries simulated time in
242
+ `requestContext.time` and `requestContext.timeEpoch`.
243
+
244
+ An SQS event source mapping does the same. The `SentTimestamp` and
245
+ `ApproximateFirstReceiveTimestamp` attributes on a delivered record are simulated time, and a
246
+ handler reading the event's time reads the clock the test controls. See
247
+ [simulated Lambda](https://yulinsim.dev/services/lambda/#triggering-a-function-from-an-sqs-queue "Simulated Lambda event source mapping docs").
248
+
249
+ Handler code that takes a clock as a dependency stays the most testable option, on real AWS and
250
+ here, and needs none of the machinery above.
251
+
252
+ ## Time over HTTP
253
+
254
+ A simulation served over HTTP, through `serveSimAws` or `SimAwsHttp.fetch(...)`, stamps every
255
+ response with simulated time in its `Date` header, as real AWS stamps every API response with server
256
+ time. Advancing the clock changes what that header reports. A client talking to the simulation sees
257
+ the same "now" the simulation does, with no need to know it is talking to a simulator.
258
+
259
+ ## Time and SDK interception
260
+
261
+ A `SimSdk` owns a simulated AWS environment, available as `simSdk.simAws`. Intercepted SDK code runs
262
+ on a clock a test can control with `await simSdk.simAws.clock().advanceBy({ hours: 1 })`.
263
+
264
+ ## Limitations
265
+
266
+ - Advancing the clock is the only thing that fires a scheduled
267
+ [EventBridge rule](https://yulinsim.dev/services/eventbridge/#rules-that-fire-on-a-schedule). Nothing runs on the
268
+ host's clock. A simulation left alone in real time fires nothing however long it is left.
269
+ - Advancing the clock is also the only thing that fires an
270
+ [EventBridge Scheduler schedule](https://yulinsim.dev/services/scheduler/#firing-a-schedule), including a one-time
271
+ `at(...)` one.
272
+ - Only `SimAws` exposes time control. Services constructed standalone, such as `new SimS3()`, get
273
+ their own real clock and no way to move it.
274
+ - A `SimAws` constructed with a `background` scheduler of its own cannot control time, because that
275
+ scheduler brings its own clock. `simAws.clock()` throws a diagnostic error saying so.
276
+ - Simulated time reaches JavaScript's own clock inside a simulated Lambda invocation, and nowhere
277
+ else. `Date.now()` and `new Date()` in code under test that is not running as a simulated Lambda
278
+ function still report real time.
279
+ - Timers are not simulated. `setTimeout` inside a handler is a host timer. A sleeping handler waits
280
+ in real time, and advancing the clock leaves it asleep.
281
+ - A time already read cannot be reached. A handler module doing `const startedAt = Date.now()` at
282
+ module scope read it when the test file imported the module, long before any invocation.
283
+ - Advancing time does not re-evaluate simulated state that was already computed, such as an ACM
284
+ certificate that has finished validating. It changes what is read from the clock next.
package/llms.txt ADDED
@@ -0,0 +1,59 @@
1
+ # Yulin
2
+
3
+ > AWS system behaviour simulation for isolated unit testing.
4
+
5
+ The pages below ship with the package as markdown, and they document the version
6
+ installed. Paths are relative to the package root, which an installed project
7
+ has at `node_modules/@kensio/yulin/`.
8
+
9
+ The same pages are on the web at https://yulinsim.dev/ for whichever release is current.
10
+
11
+ ## Service documentation
12
+
13
+ - [ACM](docs/services/acm/README.md): Simulated ACM usage docs
14
+ - [API Gateway HTTP APIs](docs/services/apigatewayv2/README.md): Simulated API Gateway HTTP API usage docs
15
+ - [API Gateway REST APIs](docs/services/apigateway/README.md): Simulated API Gateway REST API usage docs
16
+ - [Athena](docs/services/athena/README.md): Simulated Amazon Athena usage docs
17
+ - [Bedrock](docs/services/bedrock/README.md): Simulated Amazon Bedrock usage docs
18
+ - [CloudFormation](docs/services/cloudformation/README.md): Simulated CloudFormation usage docs
19
+ - [CloudFront](docs/services/cloudfront/README.md): Simulated CloudFront usage docs
20
+ - [CloudWatch metrics](docs/services/cloudwatch/README.md): Simulated CloudWatch metrics usage docs
21
+ - [Cognito user pools](docs/services/cognito/README.md): Simulated Cognito user pools usage docs
22
+ - [DynamoDB](docs/services/dynamodb/README.md): Simulated DynamoDB usage docs
23
+ - [ECR](docs/services/ecr/README.md): Simulated ECR usage docs
24
+ - [ECS](docs/services/ecs/README.md): Simulated ECS usage docs
25
+ - [Elastic Load Balancing](docs/services/elbv2/README.md): Simulated Application Load Balancer usage docs
26
+ - [EventBridge](docs/services/eventbridge/README.md): Simulated EventBridge usage docs
27
+ - [Glue](docs/services/glue/README.md): Simulated Glue Data Catalog usage docs
28
+ - [IAM](docs/services/iam/README.md): Simulated IAM usage docs
29
+ - [Kinesis Data Firehose](docs/services/firehose/README.md): Simulated Kinesis Data Firehose usage docs
30
+ - [Kinesis Data Streams](docs/services/kinesis/README.md): Simulated Kinesis Data Streams usage docs
31
+ - [KMS](docs/services/kms/README.md): Simulated KMS usage docs
32
+ - [Lambda](docs/services/lambda/README.md): Simulated Lambda usage docs
33
+ - [CloudWatch Logs](docs/services/logs/README.md): Simulated CloudWatch Logs usage docs
34
+ - [Organizations](docs/services/organizations/README.md): Simulated Organizations service control policies usage docs
35
+ - [Personalize](docs/services/personalize/README.md): Simulated Amazon Personalize usage docs
36
+ - [Rekognition](docs/services/rekognition/README.md): Simulated Rekognition usage docs
37
+ - [Route53](docs/services/route53/README.md): Simulated Route53 usage docs
38
+ - [S3](docs/services/s3/README.md): Simulated S3 usage docs
39
+ - [Scheduler](docs/services/scheduler/README.md): Simulated EventBridge Scheduler usage docs
40
+ - [Secrets Manager](docs/services/secretsmanager/README.md): Simulated Secrets Manager usage docs
41
+ - [SES](docs/services/ses/README.md): Simulated SES usage docs
42
+ - [SNS](docs/services/sns/README.md): Simulated SNS usage docs
43
+ - [SQS](docs/services/sqs/README.md): Simulated SQS usage docs
44
+ - [SSM Parameter Store](docs/services/ssm/README.md): Simulated SSM Parameter Store usage docs
45
+ - [Step Functions](docs/services/stepfunctions/README.md): Simulated Step Functions usage docs
46
+ - [STS](docs/services/sts/README.md): Simulated STS usage docs
47
+ - [WAFv2](docs/services/wafv2/README.md): Simulated WAFv2 usage docs
48
+
49
+ ## Feature documentation
50
+
51
+ - [AI skill](docs/ai-skill/README.md): Yulin AI skill usage docs
52
+ - [The AWS CLI](docs/cli/README.md): The AWS CLI against simulated AWS usage docs
53
+ - [AWS SDK interception](docs/sdk/README.md): Simulated AWS SDK usage docs
54
+ - [Event factories](docs/factories/README.md): Test factories for AWS event shapes usage docs
55
+ - [Linting CloudFront Functions JS2](docs/lint/README.md): CloudFront Functions JS2 lint config usage docs
56
+ - [Non-AWS dependencies](docs/non-aws-dependencies/README.md): Dependencies Yulin does not simulate usage docs
57
+ - [Serving on localhost](docs/serve/README.md): Serving simulated AWS on localhost usage docs
58
+ - [Simulated time](docs/time/README.md): Simulated time usage docs
59
+ - [Terraform](docs/terraform/README.md): Deploying Terraform into simulated AWS usage docs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kensio/yulin",
3
- "version": "1.20.15",
3
+ "version": "1.20.17",
4
4
  "description": "AWS system behaviour simulation for isolated unit testing",
5
5
  "repository": "https://github.com/KensioSoftware/yulin",
6
6
  "homepage": "https://yulinsim.dev/",
@@ -11,9 +11,10 @@
11
11
  "yulin": "./dist/cli/yulin.js"
12
12
  },
13
13
  "scripts": {
14
- "clean": "rm -rf ./dist/ ./*.tsbuildinfo ./cffjs2.oxlintrc.json",
15
- "build": "pnpm clean && tsc -p tsconfig.build.json && pnpm oxlint:config",
14
+ "clean": "rm -rf ./dist/ ./*.tsbuildinfo ./cffjs2.oxlintrc.json ./llms.txt",
15
+ "build": "pnpm clean && tsc -p tsconfig.build.json && pnpm oxlint:config && pnpm docs:index",
16
16
  "oxlint:config": "pnpm tsx scripts/mts/write-oxlint-config.mts",
17
+ "docs:index": "pnpm tsx scripts/mts/write-llms-index.mts",
17
18
  "build:check": "tsc -p tsconfig.json --noEmit",
18
19
  "prepack": "pnpm build",
19
20
  "verify:pack": "pnpm tsx scripts/mts/verify-pack.mts",
@@ -27,7 +28,7 @@
27
28
  "examples:tsc": "tsc -p docs/tsconfig.json",
28
29
  "examples:tsc:cdk": "tsc -p docs/tsconfig.cdk.json",
29
30
  "examples:lint": "oxlint --type-aware --max-warnings=0 docs",
30
- "examples:check": "pnpm examples:extract && pnpm examples:tsc && pnpm examples:tsc:cdk && pnpm examples:lint",
31
+ "examples:check": "pnpm docs:index && pnpm examples:extract && pnpm examples:tsc && pnpm examples:tsc:cdk && pnpm examples:lint",
31
32
  "fta": "./scripts/sh/fta.sh",
32
33
  "check": "pnpm fmt && pnpm fta && pnpm build:check && pnpm examples:check && pnpm test:coverage",
33
34
  "tf:init": "./scripts/sh/tf-init.sh"
@@ -213,7 +214,9 @@
213
214
  },
214
215
  "files": [
215
216
  "dist",
217
+ "docs/**/README.md",
216
218
  "cffjs2.oxlintrc.json",
219
+ "llms.txt",
217
220
  "README.md",
218
221
  "LICENSE"
219
222
  ],
@@ -1,25 +0,0 @@
1
- import type { BackgroundScheduler } from "../../../../util/background/background.js";
2
- import type { SimStatesExecutionStore } from "../../execution/sim-states-execution-store.js";
3
- import type { SimStateMachineStore } from "../../machine/sim-state-machine-store.js";
4
- import type { SimDeleteStateMachineCommand, SimDeleteStateMachineCommandOutput, SimUpdateStateMachineCommand, SimUpdateStateMachineCommandOutput } from "./machine.command.js";
5
- interface SimStateMachineWritesProperties {
6
- readonly stateMachines: SimStateMachineStore;
7
- readonly executions: SimStatesExecutionStore;
8
- readonly background: BackgroundScheduler;
9
- }
10
- /**
11
- * The commands that change and delete state machines.
12
- */
13
- export declare class SimStateMachineWrites {
14
- #private;
15
- constructor(properties: SimStateMachineWritesProperties);
16
- /**
17
- * Change a state machine's definition or role.
18
- */
19
- update(command: SimUpdateStateMachineCommand): SimUpdateStateMachineCommandOutput;
20
- /**
21
- * Delete a state machine and forget its executions.
22
- */
23
- delete(command: SimDeleteStateMachineCommand): SimDeleteStateMachineCommandOutput;
24
- }
25
- export {};