@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.
- package/dist/service/aws/caller/sim-aws-ambient-caller.d.ts +23 -0
- package/dist/service/aws/caller/sim-aws-ambient-caller.js +12 -0
- package/dist/service/aws/caller/sim-aws-caller-resolver.d.ts +17 -6
- package/dist/service/aws/caller/sim-aws-caller-resolver.js +21 -26
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts +6 -0
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +3 -0
- package/dist/service/aws/factory/sim-aws-account-service-cache.d.ts +6 -0
- package/dist/service/aws/factory/sim-aws-account-service-cache.js +5 -1
- package/dist/service/aws/factory/sim-aws-registered-service-builder.js +3 -1
- package/dist/service/aws/factory/sim-aws-service-factory.js +9 -1
- package/dist/service/cloudformation/command/create-stack/create-stack.handler.d.ts +4 -0
- package/dist/service/cloudformation/command/create-stack/create-stack.handler.js +4 -1
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-deployer.js +2 -1
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.d.ts +11 -2
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-plan.js +2 -1
- package/dist/service/cloudformation/deploy/sim-cfn-cdk-out-stack-options.d.ts +6 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +11 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +17 -15
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +12 -0
- package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +2 -1
- package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.d.ts +23 -0
- package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cache-policy-cfn.js +30 -0
- package/dist/service/cloudformation/resource/cfn/cloudfront/sim-cloudfront-cfn-value-adapter.js +8 -0
- package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.d.ts +29 -12
- package/dist/service/cloudformation/resource/name/sim-cfn-generated-resource-name.js +51 -20
- package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.d.ts +19 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-resource-order.js +6 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.d.ts +7 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-batch-creator.js +9 -2
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.d.ts +2 -0
- package/dist/service/cloudformation/stack/deploy/sim-cfn-stack-resource-creator.js +2 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +6 -0
- package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +4 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.js +2 -1
- package/dist/service/cloudformation/stack/sim-cfn-stack.type.d.ts +6 -0
- package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts +5 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.d.ts +37 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy-registry.js +50 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.d.ts +25 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-cache-policy.js +21 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.d.ts +28 -0
- package/dist/service/cloudfront/cache-policy/sim-cf-managed-cache-policies.js +48 -0
- package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.d.ts +8 -0
- package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.js +13 -0
- package/dist/service/cloudfront/cff/sim-cf-function-commands.d.ts +52 -0
- package/dist/service/cloudfront/cff/sim-cf-function-commands.js +51 -0
- package/dist/service/cloudfront/cff/sim-cff-configuration.d.ts +41 -0
- package/dist/service/cloudfront/cff/sim-cff-configuration.js +34 -0
- package/dist/service/cloudfront/cff/sim-cff-stage.d.ts +23 -0
- package/dist/service/cloudfront/cff/sim-cff-stage.js +30 -0
- package/dist/service/cloudfront/cff/sim-cloudfront-function.d.ts +6 -1
- package/dist/service/cloudfront/cff/sim-cloudfront-function.js +6 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.d.ts +27 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-config.js +42 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.d.ts +24 -0
- package/dist/service/cloudfront/cfn/cache-policy/sim-cfn-cf-cache-policy-creator.js +32 -0
- 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
- package/dist/service/cloudfront/cfn/distro/{sim-cfn-cf-distro-response-headers-policy.js → sim-cfn-cf-distro-behavior-policies.js} +11 -37
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.d.ts +6 -5
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-creator.js +8 -7
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.d.ts +23 -0
- package/dist/service/cloudfront/cfn/distro/sim-cfn-cf-distro-policy-drops.js +50 -0
- package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.d.ts +1 -0
- package/dist/service/cloudfront/cfn/sim-cfn-cloudfront-resource-factory.js +10 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts +1 -0
- package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
- package/dist/service/cloudfront/command/create-function/create-function.handler.js +7 -1
- package/dist/service/cloudfront/command/function/sim-cf-describe-function.d.ts +22 -0
- package/dist/service/cloudfront/command/function/sim-cf-describe-function.js +32 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-access.d.ts +48 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-access.js +48 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-command.types.d.ts +97 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-command.types.js +10 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-lookup.d.ts +12 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-lookup.js +21 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-summary.d.ts +11 -0
- package/dist/service/cloudfront/command/function/sim-cf-function-summary.js +30 -0
- package/dist/service/cloudfront/command/function/sim-cf-get-function.d.ts +23 -0
- package/dist/service/cloudfront/command/function/sim-cf-get-function.js +33 -0
- package/dist/service/cloudfront/command/function/sim-cf-list-functions.d.ts +22 -0
- package/dist/service/cloudfront/command/function/sim-cf-list-functions.js +38 -0
- package/dist/service/cloudfront/command/update-distribution/update-distribution.handler.d.ts +2 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.d.ts +18 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-cache-policy.js +30 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.d.ts +28 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-policies.js +41 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.d.ts +2 -2
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-properties.js +6 -3
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.d.ts +0 -10
- package/dist/service/cloudfront/distribution/configurator/sim-cf-behavior-response-headers-policy.js +0 -19
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.d.ts +2 -0
- package/dist/service/cloudfront/distribution/configurator/sim-cf-distribution-configurator.factory.js +4 -2
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +3 -3
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +5 -5
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +3 -3
- package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +4 -4
- package/dist/service/cloudfront/distribution/sim-cf-distribution-configuration-state.d.ts +3 -1
- package/dist/service/cloudfront/distribution/sim-cf-distribution-reconfigurer.d.ts +2 -0
- package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +21 -0
- package/dist/service/cloudfront/error/sim-cloudfront.error.js +25 -0
- package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store-access.js +2 -10
- package/dist/service/cloudfront/key-value-store/sim-cf-key-value-store.js +2 -1
- package/dist/service/cloudfront/sdk/sim-cloudfront-sdk-command-router.js +12 -0
- package/dist/service/cloudfront/sim-cf-authorize.d.ts +16 -0
- package/dist/service/cloudfront/sim-cf-authorize.js +19 -0
- package/dist/service/cloudfront/sim-cf-etag.d.ts +7 -0
- package/dist/service/cloudfront/sim-cf-etag.js +10 -0
- package/dist/service/cloudfront/sim-cloudfront-commands.d.ts +8 -12
- package/dist/service/cloudfront/sim-cloudfront-commands.js +8 -17
- package/dist/service/cloudfront/sim-cloudfront-policies.d.ts +43 -0
- package/dist/service/cloudfront/sim-cloudfront-policies.js +53 -0
- package/dist/service/cloudfront/sim-cloudfront.d.ts +13 -17
- package/dist/service/cloudfront/sim-cloudfront.js +22 -25
- package/dist/service/ecr/authorize/sim-ecr-authorizer.d.ts +31 -0
- package/dist/service/ecr/authorize/sim-ecr-authorizer.js +38 -0
- package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.d.ts +11 -2
- package/dist/service/ecr/cfn/repository/sim-cfn-ecr-repository-creator.js +11 -2
- package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.d.ts +4 -2
- package/dist/service/ecr/cfn/sim-ecr-cfn-resource-factory.js +8 -9
- package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.d.ts +7 -0
- package/dist/service/ecr/cfn/sim-ecr-cfn-unsupported-resource.js +9 -0
- package/dist/service/ecr/sim-ecr.d.ts +7 -0
- package/dist/service/ecr/sim-ecr.js +16 -4
- package/dist/service/ecs/command/authorize/sim-ecs-authorizer.d.ts +12 -0
- package/dist/service/ecs/command/authorize/sim-ecs-authorizer.js +21 -0
- package/dist/service/ecs/command/register-task-definition/register-task-definition.handler.js +1 -0
- package/dist/service/ecs/sim-ecs-service-principal.d.ts +8 -0
- package/dist/service/ecs/sim-ecs-service-principal.js +8 -0
- package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.d.ts +12 -0
- package/dist/service/eventbridge/command/authorize/sim-event-bridge-authorizer.js +21 -0
- package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.d.ts +13 -0
- package/dist/service/eventbridge/command/rule/sim-event-bridge-rule-access.js +9 -0
- package/dist/service/eventbridge/command/target/sim-event-bridge-put-targets.js +1 -0
- package/dist/service/firehose/command/authorize/sim-firehose-authorizer.d.ts +12 -0
- package/dist/service/firehose/command/authorize/sim-firehose-authorizer.js +20 -0
- package/dist/service/firehose/command/sim-firehose-delivery-stream-access.d.ts +4 -0
- package/dist/service/firehose/command/sim-firehose-delivery-stream-access.js +6 -0
- package/dist/service/firehose/command/stream/sim-firehose-create-delivery-stream.js +3 -1
- package/dist/service/firehose/sim-firehose-service-principal.d.ts +8 -0
- package/dist/service/firehose/sim-firehose-service-principal.js +8 -0
- package/dist/service/firehose/source/sim-firehose-source.d.ts +5 -0
- package/dist/service/firehose/source/sim-firehose-source.js +5 -0
- package/dist/service/glue/cfn/database/sim-cfn-glue-database-properties.js +2 -2
- package/dist/service/glue/cfn/sim-cfn-glue-generated-name.d.ts +10 -0
- package/dist/service/glue/cfn/sim-cfn-glue-generated-name.js +25 -0
- package/dist/service/glue/cfn/table/sim-cfn-glue-table-properties.js +2 -3
- package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.d.ts +33 -2
- package/dist/service/iam/authorize/allow/sim-iam-allow-requirement.js +33 -2
- package/dist/service/iam/authorize/allow/sim-iam-allow-statements.d.ts +4 -3
- package/dist/service/iam/authorize/allow/sim-iam-allow-statements.js +9 -3
- package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.d.ts +14 -5
- package/dist/service/iam/authorize/context/sim-iam-auth-z-allow-requirement.js +16 -12
- package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.d.ts +9 -3
- package/dist/service/iam/authorize/context/sim-iam-auth-z-caller-context-builder.js +5 -3
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.d.ts +9 -71
- package/dist/service/iam/authorize/context/sim-iam-auth-z-context-builder.js +2 -1
- package/dist/service/iam/authorize/context/sim-iam-auth-z-input.d.ts +87 -0
- package/dist/service/iam/authorize/context/sim-iam-auth-z-input.js +1 -0
- package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.d.ts +11 -3
- package/dist/service/iam/authorize/match/sim-iam-policy-principal-matcher.js +20 -8
- package/dist/service/iam/authorize/match/sim-iam-principal-match.d.ts +29 -8
- package/dist/service/iam/authorize/match/sim-iam-principal-match.js +38 -13
- package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.d.ts +74 -0
- package/dist/service/iam/authorize/pass-role/sim-iam-pass-role-authorizer.js +92 -0
- package/dist/service/iam/authorize/sim-iam-account-auth-z.d.ts +14 -5
- package/dist/service/iam/authorize/sim-iam-account-auth-z.js +6 -4
- package/dist/service/iam/authorize/sim-iam-authorizer.d.ts +3 -1
- package/dist/service/iam/authorize/sim-iam-authorizer.js +2 -1
- package/dist/service/iam/authorize/sim-iam-inter-service-auth-z.d.ts +1 -1
- package/dist/service/iam/authorize/sim-iam-wildcard.js +39 -4
- package/dist/service/iam/cfn/managed-policy/sim-cfn-iam-managed-policy-creator.js +2 -1
- package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.d.ts +16 -0
- package/dist/service/iam/cfn/name/sim-cfn-iam-generated-name.js +36 -0
- package/dist/service/iam/cfn/role/sim-cfn-iam-role-properties-parser.js +9 -8
- package/dist/service/iam/cfn/sim-cfn-iam-optional-string.d.ts +17 -0
- package/dist/service/iam/cfn/sim-cfn-iam-optional-string.js +17 -0
- package/dist/service/iam/cfn/user/sim-cfn-iam-user-properties-parser.js +4 -8
- package/dist/service/iam/command/policy/create-policy/create-policy-input-resolver.js +2 -0
- package/dist/service/iam/command/policy/put-role-policy/put-role-policy.handler.js +5 -0
- package/dist/service/iam/command/policy/put-user-policy/put-user-policy.handler.js +5 -0
- package/dist/service/iam/command/role/create-role/create-role.handler.js +4 -1
- package/dist/service/iam/error/sim-iam.error.d.ts +11 -0
- package/dist/service/iam/error/sim-iam.error.js +13 -0
- package/dist/service/iam/index.d.ts +1 -0
- package/dist/service/iam/policy/sim-iam-policy-document-of-size.d.ts +18 -0
- package/dist/service/iam/policy/sim-iam-policy-document-of-size.js +41 -0
- package/dist/service/iam/role/sim-iam-deploy-role.d.ts +56 -0
- package/dist/service/iam/role/sim-iam-deploy-role.js +50 -0
- package/dist/service/iam/role/sim-iam-role-with-policy.factory.d.ts +3 -1
- package/dist/service/iam/sim-iam-account-parts.d.ts +8 -0
- package/dist/service/iam/sim-iam-account-parts.js +1 -0
- package/dist/service/iam/sim-iam.d.ts +12 -2
- package/dist/service/iam/sim-iam.js +12 -0
- package/dist/service/iam/validate/size/sim-iam-policy-document-size.d.ts +57 -0
- package/dist/service/iam/validate/size/sim-iam-policy-document-size.js +71 -0
- package/dist/service/kms/command/authorize/sim-kms-authorizer.d.ts +3 -1
- package/dist/service/kms/command/authorize/sim-kms-authorizer.js +4 -1
- package/dist/service/kms/command/sim-kms-request-options.d.ts +11 -0
- package/dist/service/kms/key/sim-kms-key-policy.d.ts +5 -4
- package/dist/service/kms/key/sim-kms-key-policy.js +4 -3
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.d.ts +2 -2
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-function-properties-parser.js +4 -3
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.d.ts +10 -0
- package/dist/service/lambda/cfn/function/sim-cfn-lambda-generated-function-name.js +25 -0
- package/dist/service/lambda/command/authorize/sim-lambda-resource-policies.d.ts +1 -1
- package/dist/service/lambda/command/create-function/create-function-authorizer.d.ts +9 -2
- package/dist/service/lambda/command/create-function/create-function-authorizer.js +16 -2
- package/dist/service/lambda/command/create-function/create-function.handler.js +1 -1
- package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.d.ts +7 -2
- package/dist/service/lambda/command/update-function-configuration/update-function-configuration-authorizer.js +14 -2
- package/dist/service/lambda/command/update-function-configuration/update-function-configuration.handler.js +1 -1
- package/dist/service/lambda/function/logging/sim-lambda-function-logging.d.ts +10 -1
- package/dist/service/lambda/function/logging/sim-lambda-function-logging.js +25 -1
- package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.d.ts +13 -0
- package/dist/service/lambda/function/logging/sim-lambda-invoke-error-log.js +18 -0
- package/dist/service/lambda/sim-lambda-service-principal.d.ts +7 -0
- package/dist/service/lambda/sim-lambda-service-principal.js +7 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.d.ts +46 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-authorization.js +49 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.d.ts +5 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-creator.js +6 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.d.ts +5 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-destination-creator.js +6 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.d.ts +5 -0
- package/dist/service/logs/cfn/delivery/sim-cfn-delivery-source-creator.js +6 -0
- package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.d.ts +9 -2
- package/dist/service/logs/cfn/group/sim-cfn-log-group-creator.js +34 -5
- package/dist/service/logs/cfn/sim-logs-cfn-resource-deleter.js +1 -1
- package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.d.ts +4 -0
- package/dist/service/logs/cfn/sim-logs-cfn-resource-factory.js +9 -4
- package/dist/service/logs/sim-logs-commands.d.ts +3 -0
- package/dist/service/logs/sim-logs-commands.js +4 -0
- package/dist/service/logs/sim-logs.js +6 -1
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.d.ts +2 -2
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-creator.js +4 -3
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.d.ts +12 -0
- package/dist/service/s3/cfn/bucket/sim-cfn-s3-bucket-generated-name.js +22 -0
- package/dist/service/s3/command/authorize/sim-s3-bucket-resource-policies.d.ts +1 -1
- package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.d.ts +10 -1
- package/dist/service/scheduler/command/authorize/sim-scheduler-authorizer.js +19 -1
- package/dist/service/scheduler/command/schedule/sim-scheduler-create-schedule.js +1 -0
- package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.d.ts +8 -0
- package/dist/service/scheduler/command/schedule/sim-scheduler-schedule-access.js +9 -0
- package/dist/service/scheduler/command/schedule/sim-scheduler-update-schedule.js +1 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.d.ts +15 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-generated-name.js +22 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.d.ts +4 -10
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-properties.js +13 -31
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.d.ts +17 -0
- package/dist/service/secretsmanager/cfn/secret/sim-cfn-secrets-manager-secret-value.js +30 -0
- package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.d.ts +6 -0
- package/dist/service/secretsmanager/secret/sim-secrets-manager-secret-name.js +8 -3
- package/dist/service/sns/command/authorize/sim-sns-topic-resource-policies.d.ts +1 -1
- package/dist/service/sqs/command/authorize/sim-sqs-queue-resource-policies.d.ts +1 -1
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.d.ts +16 -0
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-generated-parameter-name.js +23 -0
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.d.ts +2 -4
- package/dist/service/ssm/cfn/parameter/sim-cfn-ssm-parameter-properties.js +5 -5
- package/dist/service/ssm/parameter/sim-ssm-kms-crypto.d.ts +6 -4
- package/dist/service/ssm/parameter/sim-ssm-kms-crypto.js +4 -4
- package/dist/service/ssm/parameter/sim-ssm-parameter-arn.d.ts +17 -0
- package/dist/service/ssm/parameter/sim-ssm-parameter-arn.js +20 -0
- package/dist/service/ssm/parameter/sim-ssm-parameter-kms.d.ts +15 -9
- package/dist/service/ssm/parameter/sim-ssm-parameter-kms.js +20 -10
- package/dist/service/ssm/parameter/sim-ssm-parameter-name.js +3 -12
- package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.d.ts +41 -0
- package/dist/service/stepfunctions/command/authorize/sim-step-functions-authorizer.js +64 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-create.d.ts +5 -2
- package/dist/service/stepfunctions/command/machine/sim-state-machine-create.js +6 -2
- package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.d.ts +26 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-delete.js +29 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.d.ts +7 -0
- package/dist/service/stepfunctions/command/machine/sim-state-machine-lookup.js +12 -3
- package/dist/service/stepfunctions/command/machine/sim-state-machine-update.d.ts +19 -0
- package/dist/service/stepfunctions/command/machine/{sim-state-machine-writes.js → sim-state-machine-update.js} +3 -14
- package/dist/service/stepfunctions/sim-step-functions.d.ts +8 -2
- package/dist/service/stepfunctions/sim-step-functions.js +26 -9
- package/dist/service/sts/command/assume-role/assume-role.handler.d.ts +5 -0
- package/dist/service/sts/command/assume-role/assume-role.handler.js +1 -0
- package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.d.ts +5 -0
- package/dist/service/sts/command/get-caller-identity/get-caller-identity.handler.js +1 -0
- package/dist/service/sts/sim-sts.d.ts +9 -0
- package/dist/service/sts/sim-sts.js +4 -0
- package/dist/util/memo/bounded-memo.d.ts +36 -0
- package/dist/util/memo/bounded-memo.js +58 -0
- package/docs/sdk/README.md +3 -1
- package/docs/services/cloudformation/README.md +196 -11
- package/docs/services/cloudfront/README.md +230 -6
- package/docs/services/cloudwatch/README.md +6 -4
- package/docs/services/cognito/README.md +8 -7
- package/docs/services/dynamodb/README.md +6 -5
- package/docs/services/ecs/README.md +20 -9
- package/docs/services/elbv2/README.md +6 -2
- package/docs/services/eventbridge/README.md +9 -1
- package/docs/services/firehose/README.md +9 -3
- package/docs/services/glue/README.md +6 -0
- package/docs/services/iam/README.md +322 -27
- package/docs/services/kinesis/README.md +3 -2
- package/docs/services/kms/README.md +7 -2
- package/docs/services/lambda/README.md +76 -2
- package/docs/services/logs/README.md +16 -2
- package/docs/services/s3/README.md +7 -2
- package/docs/services/scheduler/README.md +12 -4
- package/docs/services/secretsmanager/README.md +6 -3
- package/docs/services/ses/README.md +3 -1
- package/docs/services/sns/README.md +5 -5
- package/docs/services/sqs/README.md +5 -5
- package/docs/services/ssm/README.md +40 -16
- package/docs/services/stepfunctions/README.md +11 -2
- package/docs/services/wafv2/README.md +5 -3
- package/package.json +1 -1
- package/dist/service/stepfunctions/command/machine/sim-state-machine-writes.d.ts +0 -25
|
@@ -220,6 +220,21 @@ Creating a duplicate Policy name in the same path throws an error, while the sam
|
|
|
220
220
|
paths is allowed. Stored Policies can be inspected with `GetPolicyCommand` and
|
|
221
221
|
`ListPoliciesCommand`.
|
|
222
222
|
|
|
223
|
+
## Policy document character limits
|
|
224
|
+
|
|
225
|
+
IAM caps a policy document by where it is going. A managed policy takes 6,144 characters, an inline
|
|
226
|
+
policy on a Role or a User takes 10,240, and a Role trust policy takes 2,048. `CreatePolicy`,
|
|
227
|
+
`PutRolePolicy`, `PutUserPolicy` and `CreateRole` refuse a document past the cap with
|
|
228
|
+
`LimitExceeded`, in IAM's own wording. An `AWS::IAM::ManagedPolicy` or an `AWS::IAM::Policy`
|
|
229
|
+
carrying one fails its Resource.
|
|
230
|
+
|
|
231
|
+
IAM leaves whitespace out of the count, and so does the check here. A document indented for a
|
|
232
|
+
reader measures the same as the one line `JSON.stringify` writes.
|
|
233
|
+
|
|
234
|
+
A policy that has outgrown its cap cannot be deployed. The account keeps whichever version last
|
|
235
|
+
fit, and the permission the policy was grown to grant goes missing weeks later, against a
|
|
236
|
+
repository that still says it is there.
|
|
237
|
+
|
|
223
238
|
## Policy conditions
|
|
224
239
|
|
|
225
240
|
Policy statements can carry `Condition` blocks. Sim IAM currently supports the `StringEquals`,
|
|
@@ -558,37 +573,37 @@ const simAws = new SimAws({
|
|
|
558
573
|
},
|
|
559
574
|
});
|
|
560
575
|
|
|
561
|
-
// The Role is created as the Account root. A simulation with a
|
|
562
|
-
// attributes these commands to it, and it holds no policy until
|
|
563
|
-
|
|
576
|
+
// The Role is created inside a run as the Account root. A simulation with a
|
|
577
|
+
// default caller attributes these commands to it, and it holds no policy until
|
|
578
|
+
// they are done.
|
|
564
579
|
const simIam = simAws.iam();
|
|
565
580
|
|
|
566
|
-
await
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
581
|
+
await simAws.runAs(simAws.account().rootPrincipal, async () => {
|
|
582
|
+
await simIam.createRole(
|
|
583
|
+
new CreateRoleCommand({
|
|
584
|
+
RoleName: "Administrator",
|
|
585
|
+
AssumeRolePolicyDocument: JSON.stringify({
|
|
586
|
+
Version: "2012-10-17",
|
|
587
|
+
Statement: {
|
|
588
|
+
Effect: "Allow",
|
|
589
|
+
Principal: { AWS: "arn:aws:iam::123456789012:root" },
|
|
590
|
+
Action: "sts:AssumeRole",
|
|
591
|
+
},
|
|
592
|
+
}),
|
|
576
593
|
}),
|
|
577
|
-
|
|
578
|
-
{ caller: root },
|
|
579
|
-
);
|
|
594
|
+
);
|
|
580
595
|
|
|
581
|
-
await simIam.putRolePolicy(
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
596
|
+
await simIam.putRolePolicy(
|
|
597
|
+
new PutRolePolicyCommand({
|
|
598
|
+
RoleName: "Administrator",
|
|
599
|
+
PolicyName: "Administer",
|
|
600
|
+
PolicyDocument: JSON.stringify({
|
|
601
|
+
Version: "2012-10-17",
|
|
602
|
+
Statement: { Effect: "Allow", Action: "*", Resource: "*" },
|
|
603
|
+
}),
|
|
588
604
|
}),
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
);
|
|
605
|
+
);
|
|
606
|
+
});
|
|
592
607
|
|
|
593
608
|
const decision = simAws.iam().authorize({
|
|
594
609
|
action: "s3:GetObject",
|
|
@@ -605,7 +620,8 @@ Account that issued a key can authenticate it, and a default is held for a whole
|
|
|
605
620
|
|
|
606
621
|
The default reaches a direct sim service call, an intercepted SDK Command, a CloudFormation
|
|
607
622
|
deployment and STS. Three things outrank it, each of them a caller stated for the request in hand.
|
|
608
|
-
An operation's own `caller` wins, as does the ambient caller of a `runAs` block
|
|
623
|
+
An operation's own `caller` wins, as does the ambient caller of a `runAs` block (covered in
|
|
624
|
+
[Run a block of calls as one caller](#run-a-block-of-calls-as-one-caller)) and the `caller` a
|
|
609
625
|
deployment is given.
|
|
610
626
|
|
|
611
627
|
A simulation told no `defaultCaller` decides an unattributed call as the Account root, which is what
|
|
@@ -617,6 +633,86 @@ The reason to name one is a service control policy denying the Account root.
|
|
|
617
633
|
[Simulated Organizations](https://yulinsim.dev/services/organizations/) covers that case, where
|
|
618
634
|
every unattributed read is otherwise denied on a message about the root.
|
|
619
635
|
|
|
636
|
+
## Run a block of calls as one caller
|
|
637
|
+
|
|
638
|
+
`simAws.runAs(caller, run)` sets an ambient caller for the length of a run. Everything called during
|
|
639
|
+
the run is attributed to that principal, and the code being tested says nothing about it.
|
|
640
|
+
|
|
641
|
+
```typescript sim-iam-run-as
|
|
642
|
+
/**
|
|
643
|
+
* Attributing a block of calls to one simulated caller.
|
|
644
|
+
*/
|
|
645
|
+
|
|
646
|
+
import { CreateRoleCommand, PutRolePolicyCommand } from "@aws-sdk/client-iam";
|
|
647
|
+
import { SimAws } from "@kensio/yulin";
|
|
648
|
+
|
|
649
|
+
const simAws = new SimAws({ defaultAccountId: "123456789012" });
|
|
650
|
+
const simIam = simAws.iam();
|
|
651
|
+
|
|
652
|
+
await simIam.createRole(
|
|
653
|
+
new CreateRoleCommand({
|
|
654
|
+
RoleName: "Reporter",
|
|
655
|
+
AssumeRolePolicyDocument: JSON.stringify({
|
|
656
|
+
Version: "2012-10-17",
|
|
657
|
+
Statement: {
|
|
658
|
+
Effect: "Allow",
|
|
659
|
+
Principal: { AWS: "arn:aws:iam::123456789012:root" },
|
|
660
|
+
Action: "sts:AssumeRole",
|
|
661
|
+
},
|
|
662
|
+
}),
|
|
663
|
+
}),
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
await simIam.putRolePolicy(
|
|
667
|
+
new PutRolePolicyCommand({
|
|
668
|
+
RoleName: "Reporter",
|
|
669
|
+
PolicyName: "ReadParameters",
|
|
670
|
+
PolicyDocument: JSON.stringify({
|
|
671
|
+
Version: "2012-10-17",
|
|
672
|
+
Statement: { Effect: "Allow", Action: "ssm:GetParameter", Resource: "*" },
|
|
673
|
+
}),
|
|
674
|
+
}),
|
|
675
|
+
);
|
|
676
|
+
|
|
677
|
+
await simAws.ssm().putParameter({
|
|
678
|
+
input: { Name: "/reports/last-run", Type: "String", Value: "done" },
|
|
679
|
+
});
|
|
680
|
+
|
|
681
|
+
const reporter = "arn:aws:iam::123456789012:role/Reporter";
|
|
682
|
+
|
|
683
|
+
await simAws.runAs({ kind: "arn", arn: reporter }, async () => {
|
|
684
|
+
// The read is a direct sim service call, decided as the Reporter Role.
|
|
685
|
+
const read = await simAws
|
|
686
|
+
.ssm()
|
|
687
|
+
.getParameter({ input: { Name: "/reports/last-run" } });
|
|
688
|
+
|
|
689
|
+
const write = simIam.authorize({
|
|
690
|
+
action: "ssm:PutParameter",
|
|
691
|
+
resource: "*",
|
|
692
|
+
});
|
|
693
|
+
|
|
694
|
+
console.log(read.Parameter?.Value); // "done"
|
|
695
|
+
console.log(write.caller.arn); // "arn:aws:iam::123456789012:role/Reporter"
|
|
696
|
+
console.log(write.isDenied); // true
|
|
697
|
+
});
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
The ambient caller reaches a direct sim service call and an intercepted SDK Command. An operation's
|
|
701
|
+
own `caller` still wins, and `deployTemplate` and `deployCdkOut` take a `caller` of their own. Runs
|
|
702
|
+
nest, and the innermost caller applies.
|
|
703
|
+
|
|
704
|
+
A run belongs to the `SimAws` instance it was started on. Two simulations in one test file are two
|
|
705
|
+
simulated universes, and a run on one leaves the other's calls where they were.
|
|
706
|
+
|
|
707
|
+
Simulated Lambda and ECS set an ambient caller the same way. A Lambda handler runs as the function's
|
|
708
|
+
execution Role and an ECS container runs as its task Role. A direct sim service call from inside
|
|
709
|
+
either is decided as that Role, matching what the deployed code has credentials for.
|
|
710
|
+
|
|
711
|
+
This is also how a simulation bootstraps the principal its own `defaultCaller` names. That Role has
|
|
712
|
+
to be created before it can decide anything, and the creation therefore runs as something else.
|
|
713
|
+
Wrapping it in `runAs(simAws.account().rootPrincipal, ...)` is the shape for that, since sim IAM
|
|
714
|
+
gives the Account root unrestricted access.
|
|
715
|
+
|
|
620
716
|
## Callers of HTTP requests
|
|
621
717
|
|
|
622
718
|
An in-process SDK call can be told who its caller is. A request arriving over HTTP, through
|
|
@@ -840,6 +936,186 @@ action, resource, and caller for diagnostics, before the service mutates any sta
|
|
|
840
936
|
caller defaults to the Account root. The Account root is allowed within its own Account, and a test
|
|
841
937
|
that never mentions IAM keeps working.
|
|
842
938
|
|
|
939
|
+
## Passing a Role to a service
|
|
940
|
+
|
|
941
|
+
A simulated service handed a Role keeps it and uses it later, under its own identity. AWS asks two
|
|
942
|
+
questions about that. The first is whether the caller may create the thing. The second is whether the
|
|
943
|
+
caller may hand that Role over, and its resource is the Role.
|
|
944
|
+
|
|
945
|
+
Six simulated services ask the second question. A caller allowed the create action and refused
|
|
946
|
+
`iam:PassRole` fails the request with an access-denied error naming the Role and the caller. A scoped
|
|
947
|
+
deployment role refused `iam:PassRole` is one of the commoner ways a real deployment stops, and a
|
|
948
|
+
deployment through
|
|
949
|
+
[simulated CloudFormation](https://yulinsim.dev/services/cloudformation/ "Simulated CloudFormation usage docs")
|
|
950
|
+
carries the same decision to every Resource it creates.
|
|
951
|
+
|
|
952
|
+
| Request | The Role it hands over | `iam:PassedToService` |
|
|
953
|
+
| ------------------------------------------------------ | ---------------------------------------- | ------------------------- |
|
|
954
|
+
| Lambda `CreateFunction`, `UpdateFunctionConfiguration` | `Role` | `lambda.amazonaws.com` |
|
|
955
|
+
| Scheduler `CreateSchedule`, `UpdateSchedule` | `Target.RoleArn` | `scheduler.amazonaws.com` |
|
|
956
|
+
| EventBridge `PutTargets` | a target's `RoleArn` | `events.amazonaws.com` |
|
|
957
|
+
| Step Functions `CreateStateMachine` | `roleArn` | `states.amazonaws.com` |
|
|
958
|
+
| ECS `RegisterTaskDefinition` | `taskRoleArn` and `executionRoleArn` | `ecs-tasks.amazonaws.com` |
|
|
959
|
+
| Firehose `CreateDeliveryStream` | the destination Role and the source Role | `firehose.amazonaws.com` |
|
|
960
|
+
|
|
961
|
+
Each Role is a separate decision, so a caller allowed one of an ECS task definition's two Roles is
|
|
962
|
+
refused on the other. A request leaving an optional Role out passes nothing and is asked nothing.
|
|
963
|
+
|
|
964
|
+
The condition key `iam:PassedToService` carries the service principal the Role goes to. A
|
|
965
|
+
CDK-generated deployment policy commonly conditions its `iam:PassRole` statement on that key, and a
|
|
966
|
+
policy written that way matches here.
|
|
967
|
+
|
|
968
|
+
```typescript sim-iam-pass-role
|
|
969
|
+
/**
|
|
970
|
+
* Authorizing the execution role a Lambda function is created with.
|
|
971
|
+
*/
|
|
972
|
+
|
|
973
|
+
import { CreateRoleCommand, PutRolePolicyCommand } from "@aws-sdk/client-iam";
|
|
974
|
+
import { CreateFunctionCommand } from "@aws-sdk/client-lambda";
|
|
975
|
+
import { SimAws } from "@kensio/yulin";
|
|
976
|
+
import { makeLambdaZipFileInput } from "@kensio/yulin/lambda";
|
|
977
|
+
|
|
978
|
+
const simAws = new SimAws({ defaultAccountId: "123456789012" });
|
|
979
|
+
const simIam = simAws.iam();
|
|
980
|
+
|
|
981
|
+
const deployerCreation = await simIam.createRole(
|
|
982
|
+
new CreateRoleCommand({
|
|
983
|
+
RoleName: "Deployer",
|
|
984
|
+
AssumeRolePolicyDocument: JSON.stringify({
|
|
985
|
+
Version: "2012-10-17",
|
|
986
|
+
Statement: {
|
|
987
|
+
Effect: "Allow",
|
|
988
|
+
Principal: { Service: "cloudformation.amazonaws.com" },
|
|
989
|
+
Action: "sts:AssumeRole",
|
|
990
|
+
},
|
|
991
|
+
}),
|
|
992
|
+
}),
|
|
993
|
+
);
|
|
994
|
+
|
|
995
|
+
await simIam.putRolePolicy(
|
|
996
|
+
new PutRolePolicyCommand({
|
|
997
|
+
RoleName: "Deployer",
|
|
998
|
+
PolicyName: "DeployFunctions",
|
|
999
|
+
PolicyDocument: JSON.stringify({
|
|
1000
|
+
Version: "2012-10-17",
|
|
1001
|
+
Statement: [
|
|
1002
|
+
{ Effect: "Allow", Action: "lambda:CreateFunction", Resource: "*" },
|
|
1003
|
+
{
|
|
1004
|
+
Effect: "Allow",
|
|
1005
|
+
Action: "iam:PassRole",
|
|
1006
|
+
Resource: "arn:aws:iam::123456789012:role/ReportsExecutionRole",
|
|
1007
|
+
Condition: {
|
|
1008
|
+
StringEquals: { "iam:PassedToService": "lambda.amazonaws.com" },
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
],
|
|
1012
|
+
}),
|
|
1013
|
+
}),
|
|
1014
|
+
);
|
|
1015
|
+
|
|
1016
|
+
const asDeployer = {
|
|
1017
|
+
caller: { kind: "arn", arn: deployerCreation.Role.Arn },
|
|
1018
|
+
} as const;
|
|
1019
|
+
|
|
1020
|
+
await simAws.lambda().createFunction(
|
|
1021
|
+
new CreateFunctionCommand({
|
|
1022
|
+
FunctionName: "reports",
|
|
1023
|
+
Role: "arn:aws:iam::123456789012:role/ReportsExecutionRole",
|
|
1024
|
+
Code: { ZipFile: makeLambdaZipFileInput(() => null) },
|
|
1025
|
+
}),
|
|
1026
|
+
asDeployer,
|
|
1027
|
+
);
|
|
1028
|
+
|
|
1029
|
+
try {
|
|
1030
|
+
await simAws.lambda().createFunction(
|
|
1031
|
+
new CreateFunctionCommand({
|
|
1032
|
+
FunctionName: "invoices",
|
|
1033
|
+
Role: "arn:aws:iam::123456789012:role/AdminRole",
|
|
1034
|
+
Code: { ZipFile: makeLambdaZipFileInput(() => null) },
|
|
1035
|
+
}),
|
|
1036
|
+
asDeployer,
|
|
1037
|
+
);
|
|
1038
|
+
} catch (error) {
|
|
1039
|
+
console.error("Passing AdminRole to Lambda was refused", error);
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
await simAws.backgroundTasksComplete();
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
A request naming no caller is decided as the Account root, which may pass any Role. A test that never
|
|
1046
|
+
mentions IAM keeps working.
|
|
1047
|
+
|
|
1048
|
+
## A Role for a CloudFormation deployment
|
|
1049
|
+
|
|
1050
|
+
`makeDeployRole(...)` creates a Role from a policy document and hands back a caller. Pass it as
|
|
1051
|
+
`caller` to `deployTemplate(...)`, `deployTemplateFile(...)` or `deployCdkOut(...)`, and every
|
|
1052
|
+
resource the deployment creates is authorized against the document.
|
|
1053
|
+
|
|
1054
|
+
```typescript sim-iam-make-deploy-role
|
|
1055
|
+
/**
|
|
1056
|
+
* Making a deploy Role from a policy document a project already holds.
|
|
1057
|
+
*/
|
|
1058
|
+
|
|
1059
|
+
import { SimAws } from "@kensio/yulin";
|
|
1060
|
+
|
|
1061
|
+
const simAws = new SimAws({ defaultAccountId: "123456789012" });
|
|
1062
|
+
|
|
1063
|
+
const deployer = await simAws.iam().makeDeployRole({
|
|
1064
|
+
roleName: "cdk-exec",
|
|
1065
|
+
policyDocument: {
|
|
1066
|
+
Version: "2012-10-17",
|
|
1067
|
+
Statement: {
|
|
1068
|
+
Effect: "Allow",
|
|
1069
|
+
Action: ["s3:*", "kms:*"],
|
|
1070
|
+
Resource: "*",
|
|
1071
|
+
},
|
|
1072
|
+
},
|
|
1073
|
+
});
|
|
1074
|
+
|
|
1075
|
+
console.log(deployer.arn); // "arn:aws:iam::123456789012:role/cdk-exec"
|
|
1076
|
+
|
|
1077
|
+
await simAws
|
|
1078
|
+
.cloudFormation()
|
|
1079
|
+
.deployCdkOut({ directoryPath: "cdk.out", caller: deployer });
|
|
1080
|
+
```
|
|
1081
|
+
|
|
1082
|
+
The Role trusts `cloudformation.amazonaws.com` and holds the document as an inline policy. A
|
|
1083
|
+
deployment that asks for something the document leaves out fails the resource, with the Role's ARN in
|
|
1084
|
+
the message.
|
|
1085
|
+
|
|
1086
|
+
`policyDocument` also takes the JSON a synthesized policy is carried as, and a list of documents for
|
|
1087
|
+
a policy split in two to stay under IAM's size cap. Each document goes on the Role as its own inline
|
|
1088
|
+
policy, and the Role is allowed the union of them.
|
|
1089
|
+
|
|
1090
|
+
```typescript sim-iam-deploy-role-documents
|
|
1091
|
+
/**
|
|
1092
|
+
* A deploy Role from a policy split across two documents.
|
|
1093
|
+
*/
|
|
1094
|
+
|
|
1095
|
+
import { SimAws } from "@kensio/yulin";
|
|
1096
|
+
|
|
1097
|
+
const simAws = new SimAws({ defaultAccountId: "123456789012" });
|
|
1098
|
+
|
|
1099
|
+
const deployer = await simAws.iam().makeDeployRole({
|
|
1100
|
+
roleName: "cdk-exec",
|
|
1101
|
+
policyDocument: [
|
|
1102
|
+
JSON.stringify({
|
|
1103
|
+
Version: "2012-10-17",
|
|
1104
|
+
Statement: { Effect: "Allow", Action: "s3:*", Resource: "*" },
|
|
1105
|
+
}),
|
|
1106
|
+
{
|
|
1107
|
+
Version: "2012-10-17",
|
|
1108
|
+
Statement: { Effect: "Allow", Action: "kms:*", Resource: "*" },
|
|
1109
|
+
},
|
|
1110
|
+
],
|
|
1111
|
+
});
|
|
1112
|
+
|
|
1113
|
+
console.log(deployer.kind); // "arn"
|
|
1114
|
+
```
|
|
1115
|
+
|
|
1116
|
+
Making the Role is two ordinary IAM commands. A simulation with a restrictive default caller has to
|
|
1117
|
+
be allowed them, or the call wrapped in `simAws.runAs(...)`.
|
|
1118
|
+
|
|
843
1119
|
## CloudFormation IAM resources
|
|
844
1120
|
|
|
845
1121
|
Sim CloudFormation can create IAM resources from `AWS::IAM::Role`, `AWS::IAM::User`,
|
|
@@ -860,6 +1136,18 @@ is created (the attachment `AttachRolePolicy` records). A name no simulated Role
|
|
|
860
1136
|
answers to fails the resource. Deleting the stack takes the policy back off the Roles still
|
|
861
1137
|
carrying it, and then deletes the policy.
|
|
862
1138
|
|
|
1139
|
+
A Role with no `RoleName`, a User with no `UserName` and a Managed Policy with no
|
|
1140
|
+
`ManagedPolicyName` are each named from the stack name, the logical ID and a tail derived from both.
|
|
1141
|
+
A `ServiceRole` in `iam-stack` becomes `iam-stack-ServiceRole-` and twelve more characters, where
|
|
1142
|
+
real CloudFormation ends the name in twelve random ones. The case is kept as it was written, the way
|
|
1143
|
+
IAM keeps it. A Role name and a User name are trimmed to 64 characters and a policy name to 128, and
|
|
1144
|
+
[the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
|
|
1145
|
+
cover how the stack name and the logical ID share what is left.
|
|
1146
|
+
|
|
1147
|
+
That name is what an IAM policy scoped by name prefix matches. A deploy Role allowed `iam:CreateRole`
|
|
1148
|
+
on `arn:aws:iam::123456789012:role/iam-stack-*` covers the Roles its own stack creates, here and in
|
|
1149
|
+
an account.
|
|
1150
|
+
|
|
863
1151
|
```typescript sim-iam-cloudformation
|
|
864
1152
|
/**
|
|
865
1153
|
* Creating IAM resources through simulated CloudFormation.
|
|
@@ -1231,10 +1519,12 @@ instance when a test should exercise real IAM enforcement.
|
|
|
1231
1519
|
|
|
1232
1520
|
Sim IAM currently supports:
|
|
1233
1521
|
|
|
1522
|
+
- `makeDeployRole(...)`, creating a Role for a CloudFormation deployment to run as
|
|
1234
1523
|
- `CreateRoleCommand`, including trust-policy validation
|
|
1235
1524
|
- `GetRoleCommand` and `ListRolesCommand`, with pagination
|
|
1236
1525
|
- `PutRolePolicyCommand`, for inline Role policies
|
|
1237
1526
|
- `CreatePolicyCommand`, `GetPolicyCommand` and `ListPoliciesCommand`, for managed Policies
|
|
1527
|
+
- Refusing a policy document over IAM's character limit, with `LimitExceeded`
|
|
1238
1528
|
- `AttachRolePolicyCommand`
|
|
1239
1529
|
- `CreateUserCommand`, `DeleteUserCommand`, `PutUserPolicyCommand` and `AttachUserPolicyCommand`
|
|
1240
1530
|
- `CreateLoginProfileCommand`, for a User's console password
|
|
@@ -1242,6 +1532,8 @@ Sim IAM currently supports:
|
|
|
1242
1532
|
- Allow/deny authorization decisions with `authorize(...)`, evaluating identity policies,
|
|
1243
1533
|
service-supplied resource policies, and policy conditions with explicit-deny precedence
|
|
1244
1534
|
- IAM authorization at simulated service boundaries, such as Route53 actions
|
|
1535
|
+
- `iam:PassRole` authorization of a Role handed to simulated Lambda, Scheduler, EventBridge, Step
|
|
1536
|
+
Functions, ECS or Firehose, with `iam:PassedToService` supplied
|
|
1245
1537
|
- Resolving the caller of an HTTP request, from an `x-sim-aws-caller` header or a verified SigV4
|
|
1246
1538
|
signature, defaulting to anonymous, and the resource it is made on behalf of from
|
|
1247
1539
|
`x-sim-aws-source-arn` and `x-sim-aws-source-account`
|
|
@@ -1262,6 +1554,9 @@ Sim IAM models the policy behaviour that multi-service tests most commonly need.
|
|
|
1262
1554
|
- Permissions boundaries and session policies are not evaluated. Service control policies are, and
|
|
1263
1555
|
are attached through [simulated Organizations](https://yulinsim.dev/services/organizations/ "Simulated Organizations service control policies usage docs")
|
|
1264
1556
|
- Managed Policies have a single version, and the policy version commands are absent
|
|
1557
|
+
- A policy document is measured against IAM's character limit one document at a time. The
|
|
1558
|
+
20,480-character cap on the sum of a User's inline policies is absent, and so is the cap on how
|
|
1559
|
+
many managed policies a Role may carry
|
|
1265
1560
|
- `DeleteUserPolicy` and `DetachUserPolicy` are absent, along with `DeleteAccessKey` and
|
|
1266
1561
|
`DeleteLoginProfile`. `DeleteUserCommand` refuses a User that still holds a policy, and
|
|
1267
1562
|
CloudFormation teardown clears a User's policies before deleting it
|
|
@@ -275,8 +275,9 @@ await simAws.kinesis().putRecord(
|
|
|
275
275
|
```
|
|
276
276
|
|
|
277
277
|
`Name`, `ShardCount`, `RetentionPeriodHours`, `StreamModeDetails` and `Tags` are read. A stream the
|
|
278
|
-
template does not name is named after the stack
|
|
279
|
-
|
|
278
|
+
template does not name is named after the stack, the logical ID and a tail derived from both, as
|
|
279
|
+
[the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
|
|
280
|
+
describe.
|
|
280
281
|
|
|
281
282
|
`RetentionPeriodHours` is applied after the stream is created, because `CreateStream` takes no
|
|
282
283
|
retention on real Kinesis either. It only ever goes up: a new stream keeps records for 24 hours,
|
|
@@ -351,13 +351,18 @@ customer default:
|
|
|
351
351
|
- The account root is allowed to read the key's metadata. That is the whole of what this policy
|
|
352
352
|
delegates to IAM.
|
|
353
353
|
|
|
354
|
-
That is why a role holding
|
|
355
|
-
and why a role holding `kms:Decrypt` on that key still cannot use it by calling KMS itself.
|
|
354
|
+
That is why a role holding `kms:Decrypt` on such a key cannot use it by calling KMS itself.
|
|
356
355
|
|
|
357
356
|
`kms:ViaService` is set by the service making the call on the caller's behalf. Sim SSM does this for
|
|
358
357
|
`SecureString` parameters. Code calling simulated KMS directly sets it with the `viaService` request
|
|
359
358
|
option, naming the service on its own (`ssm`), since the region is the key's.
|
|
360
359
|
|
|
360
|
+
A service passing on the caller's own KMS permissions sets `withCallerPermissions` alongside it.
|
|
361
|
+
What the policy above admits is the service a request came through. A request carrying this option
|
|
362
|
+
is allowed only where IAM allows the caller the KMS action too, and a key policy naming the caller
|
|
363
|
+
allows it on its own. Sim SSM sets the option when it decrypts a `SecureString`. A role holding
|
|
364
|
+
`ssm:GetParameter` and no `kms:Decrypt` is refused the decrypted value.
|
|
365
|
+
|
|
361
366
|
```typescript sim-kms-aws-managed-key
|
|
362
367
|
/**
|
|
363
368
|
* An AWS managed key, usable only through the service that owns it.
|
|
@@ -4,7 +4,10 @@ Yulin includes a simulated AWS Lambda service for tests and local development. F
|
|
|
4
4
|
and invoked in-process and in memory, with no containers and no real AWS infrastructure.
|
|
5
5
|
|
|
6
6
|
Handlers run with their execution role as the simulated caller, so AWS calls made inside a handler
|
|
7
|
-
are authorized by simulated IAM, as on real Lambda.
|
|
7
|
+
are authorized by simulated IAM, as on real Lambda. Creating a function and changing its role are
|
|
8
|
+
authorized as well, both against `lambda:` actions and against `iam:PassRole` on the execution role
|
|
9
|
+
the request names. See [passing a Role to a service](https://yulinsim.dev/services/iam/#passing-a-role-to-a-service)
|
|
10
|
+
in the IAM docs.
|
|
8
11
|
|
|
9
12
|
Lambda-specific helpers are imported from the `@kensio/yulin/lambda` subpath. Real `LambdaClient`
|
|
10
13
|
instances can be routed into sim Lambda with
|
|
@@ -81,6 +84,13 @@ The invoke call itself returns normally.
|
|
|
81
84
|
|
|
82
85
|
## Zip-packaged code and the vm runtime
|
|
83
86
|
|
|
87
|
+
A real in-process handler is the one to reach for first. `makeLambdaZipFileInput(...)` backs a
|
|
88
|
+
function created through the SDK with one, and an [executable binding](#executable-bindings) backs
|
|
89
|
+
one a template declares. The handler stops on a breakpoint and can close over the test's own state.
|
|
90
|
+
Run the packaged code where the test is about the bundle a deployment ships, its imports and its
|
|
91
|
+
bundling included. Both paths invoke through simulated Lambda, and simulated IAM authorizes the
|
|
92
|
+
handler's own AWS calls under the execution role either way.
|
|
93
|
+
|
|
84
94
|
Real Lambda receives function code as a zip archive. `makeLambdaCodeZip(...)` builds real zip
|
|
85
95
|
bytes from a source string (which becomes a single `index.js` module) or from a files map keyed by
|
|
86
96
|
archive path (like a bundled deployment package). The archive runs in a Node.js `vm` context with
|
|
@@ -276,6 +286,62 @@ console.log(logged.events?.map((event) => event.message));
|
|
|
276
286
|
await simAws.backgroundTasksComplete();
|
|
277
287
|
```
|
|
278
288
|
|
|
289
|
+
### When a handler throws
|
|
290
|
+
|
|
291
|
+
An invocation that ends in an error nothing caught leaves an `ERROR Invoke Error` line in the
|
|
292
|
+
function's log group, as it does in an account. The line carries a JSON document holding the error's
|
|
293
|
+
type, its message and its stack, with one array element per stack frame. Whatever the handler
|
|
294
|
+
printed before it failed is recorded above it. A handler bound in-process and one packaged as zip
|
|
295
|
+
code are both recorded this way.
|
|
296
|
+
|
|
297
|
+
```typescript sim-lambda-unhandled-error-output
|
|
298
|
+
/**
|
|
299
|
+
* Reading why an invocation failed out of the function's log group.
|
|
300
|
+
*/
|
|
301
|
+
|
|
302
|
+
import { FilterLogEventsCommand } from "@aws-sdk/client-cloudwatch-logs";
|
|
303
|
+
import { CreateFunctionCommand, InvokeCommand } from "@aws-sdk/client-lambda";
|
|
304
|
+
|
|
305
|
+
import { SimAws } from "@kensio/yulin";
|
|
306
|
+
import { makeLambdaZipFileInput } from "@kensio/yulin/lambda";
|
|
307
|
+
|
|
308
|
+
const simAws = new SimAws();
|
|
309
|
+
|
|
310
|
+
await simAws.lambda().createFunction(
|
|
311
|
+
new CreateFunctionCommand({
|
|
312
|
+
FunctionName: "orders",
|
|
313
|
+
Role: "arn:aws:iam::111111111111:role/OrdersRole",
|
|
314
|
+
Code: {
|
|
315
|
+
ZipFile: makeLambdaZipFileInput(() => {
|
|
316
|
+
console.log("INFO handling order-1");
|
|
317
|
+
|
|
318
|
+
throw new Error("order has no items");
|
|
319
|
+
}),
|
|
320
|
+
},
|
|
321
|
+
}),
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
await simAws.lambda().invoke(new InvokeCommand({ FunctionName: "orders" }));
|
|
325
|
+
|
|
326
|
+
const failure = await simAws.logs().filterLogEvents(
|
|
327
|
+
new FilterLogEventsCommand({
|
|
328
|
+
logGroupName: "/aws/lambda/orders",
|
|
329
|
+
filterPattern: '"Invoke Error"',
|
|
330
|
+
}),
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
// ERROR Invoke Error {"errorType":"Error","errorMessage":"order has no items",...}
|
|
334
|
+
console.log(failure.events?.at(0)?.message);
|
|
335
|
+
|
|
336
|
+
await simAws.backgroundTasksComplete();
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
The caller still hears about it too. `Invoke` answers with `FunctionError` set to `Unhandled` and
|
|
340
|
+
the same error document in its response payload.
|
|
341
|
+
|
|
342
|
+
Real Lambda writes `START`, `END` and `REPORT` lines around every invocation. Simulated Lambda
|
|
343
|
+
writes none of those.
|
|
344
|
+
|
|
279
345
|
## Function code from S3
|
|
280
346
|
|
|
281
347
|
Function code can also be fetched from a zip object stored in sim S3, as SAM and CDK deployments
|
|
@@ -2772,7 +2838,7 @@ For `AWS::Lambda::Function`, `Ref` returns the function name and `Fn::GetAtt` su
|
|
|
2772
2838
|
|
|
2773
2839
|
Supported function properties:
|
|
2774
2840
|
|
|
2775
|
-
- `FunctionName` (
|
|
2841
|
+
- `FunctionName` (a function with none is named after the stack and the logical ID)
|
|
2776
2842
|
- `Role` (typically a `Ref`/`Fn::GetAtt` to a same-stack `AWS::IAM::Role`, both resolving to the
|
|
2777
2843
|
role's ARN)
|
|
2778
2844
|
- `Code` (inline `ZipFile` source string, or `S3Bucket`/`S3Key` fetched from same-scope sim S3)
|
|
@@ -2785,6 +2851,12 @@ Supported function properties:
|
|
|
2785
2851
|
- `DeadLetterConfig`, whose `TargetArn` names a queue or a topic. See
|
|
2786
2852
|
[retries and destinations in templates](#retries-and-destinations-in-templates)
|
|
2787
2853
|
|
|
2854
|
+
A function with no `FunctionName` is named from the stack name, the logical ID and a tail derived
|
|
2855
|
+
from both. A `RatesFunction` in `orders-stack` becomes `orders-stack-RatesFunction-` and twelve more
|
|
2856
|
+
characters, where real CloudFormation ends the name in twelve random ones. The name is trimmed to
|
|
2857
|
+
the 64 characters a function name allows, and [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
|
|
2858
|
+
cover how the stack name and the logical ID share what is left.
|
|
2859
|
+
|
|
2788
2860
|
Code in a missing bucket fails the deploy AWS-style with a `NoSuchBucket` diagnostic.
|
|
2789
2861
|
|
|
2790
2862
|
### CDK asset code
|
|
@@ -3439,6 +3511,8 @@ Sim Lambda currently supports:
|
|
|
3439
3511
|
event to a simulated SQS queue or SNS topic
|
|
3440
3512
|
- Function URLs, created with `CreateFunctionUrlConfigCommand` and served over HTTP on localhost
|
|
3441
3513
|
with `serveSimAws`
|
|
3514
|
+
- `iam:PassRole` authorization of the execution role named by `CreateFunctionCommand` and
|
|
3515
|
+
`UpdateFunctionConfigurationCommand`, with `iam:PassedToService` supplied
|
|
3442
3516
|
- `AuthType: "AWS_IAM"` Function URLs, authorizing `lambda:InvokeFunctionUrl` against the caller
|
|
3443
3517
|
resolved from the request, and `lambda:InvokeFunction` as well for a CloudFront origin access
|
|
3444
3518
|
control
|
|
@@ -260,6 +260,11 @@ The output still reaches the terminal as well. Real Lambda sends it to CloudWatc
|
|
|
260
260
|
else, but a test tool that swallowed it would make a failing test harder to debug. Recording is a
|
|
261
261
|
tee.
|
|
262
262
|
|
|
263
|
+
An invocation that ends in an error nothing caught leaves an `ERROR Invoke Error` line in the group
|
|
264
|
+
after whatever it printed, carrying the error's type, its message and its stack. The
|
|
265
|
+
[simulated Lambda docs](https://yulinsim.dev/services/lambda/ "Simulated Lambda usage docs") show
|
|
266
|
+
one.
|
|
267
|
+
|
|
263
268
|
Each invocation's `context.logGroupName` and `context.logStreamName` name the group and stream that
|
|
264
269
|
were actually written to. Stream names use the real `YYYY/MM/DD/[$LATEST]<hash>` format. The hash
|
|
265
270
|
identifies the execution environment, and one environment serves more than one request. Match the
|
|
@@ -736,6 +741,14 @@ exactly as on real AWS.
|
|
|
736
741
|
`DescribeLogGroups` names no particular group. It authorizes against every log group in the account
|
|
737
742
|
and region, and a policy scoped to one group cannot describe them all.
|
|
738
743
|
|
|
744
|
+
A Stack deploying the three delivery Resource types authorizes the actions CloudFormation names.
|
|
745
|
+
Each handler reads its own resource back before it writes. `AWS::Logs::DeliverySource` therefore
|
|
746
|
+
needs `logs:GetDeliverySource` alongside `logs:PutDeliverySource`, and the destination and the
|
|
747
|
+
delivery need `logs:GetDeliveryDestination` and `logs:GetDelivery` the same way. The `Describe` actions cover
|
|
748
|
+
the three listing operations an SDK caller reaches, and a deployment goes near none of them. A
|
|
749
|
+
CloudFormation execution Role therefore carries the same policy here that a real deploy of the
|
|
750
|
+
template needs.
|
|
751
|
+
|
|
739
752
|
```typescript sim-logs-permissions
|
|
740
753
|
/**
|
|
741
754
|
* A simulated IAM policy allowing a Role to write one function's logs.
|
|
@@ -847,8 +860,9 @@ console.log(described.logGroups?.[0]?.logGroupArn);
|
|
|
847
860
|
log group and the three delivery resource types are what simulated CloudFormation deploys here.
|
|
848
861
|
- **Nothing is actually delivered.** A delivery records that a source was joined to a destination
|
|
849
862
|
and how the records would be written. No access log file ever reaches the bucket.
|
|
850
|
-
- **`GetDeliverySource`, `GetDeliveryDestination` and `GetDelivery`.** Absent. The
|
|
851
|
-
operations report the same resources.
|
|
863
|
+
- **`GetDeliverySource`, `GetDeliveryDestination` and `GetDelivery`.** Absent as SDK operations. The
|
|
864
|
+
three `Describe` operations report the same resources. The three action names are authorized where
|
|
865
|
+
CloudFormation reads a delivery Resource back.
|
|
852
866
|
- **Delivery resource tags and cross-account delivery.** `PutDeliverySource`,
|
|
853
867
|
`PutDeliveryDestination` and `CreateDelivery` refuse tags outright. `DeliveryDestinationPolicy` in
|
|
854
868
|
a template is recorded and acted on by nothing.
|
|
@@ -1697,8 +1697,13 @@ writes fall outside it. Without that, the simulation stops after a thousand deli
|
|
|
1697
1697
|
An `AWS::S3::Bucket` resource carries five properties simulated S3 acts on. Those are `BucketName`,
|
|
1698
1698
|
`LifecycleConfiguration`, `NotificationConfiguration`, `PublicAccessBlockConfiguration` and
|
|
1699
1699
|
`WebsiteConfiguration`. See [Lifecycle configuration](#lifecycle-configuration) for the parts of a
|
|
1700
|
-
rule that are read.
|
|
1701
|
-
|
|
1700
|
+
rule that are read.
|
|
1701
|
+
|
|
1702
|
+
A Bucket with no `BucketName` is named from the stack name, the logical ID and a tail derived from
|
|
1703
|
+
both, lower cased as a bucket name has to be. A `SiteBucket` in `orders-stack` becomes
|
|
1704
|
+
`orders-stack-sitebucket-` and twelve more characters, where real CloudFormation ends the name in
|
|
1705
|
+
twelve random ones. The name is trimmed to the 63 characters a bucket name allows, and [the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
|
|
1706
|
+
cover how the stack name and the logical ID share what is left.
|
|
1702
1707
|
|
|
1703
1708
|
Any other property is left out and recorded in
|
|
1704
1709
|
[`stack.ignoredProperties`](https://yulinsim.dev/services/cloudformation/#properties-a-resource-was-created-without),
|
|
@@ -510,7 +510,12 @@ no group with nowhere to go.
|
|
|
510
510
|
|
|
511
511
|
## Permissions
|
|
512
512
|
|
|
513
|
-
Every operation is authorized against the schedule ARN, which carries the group
|
|
513
|
+
Every operation is authorized against the schedule ARN, which carries the group. A Create or an
|
|
514
|
+
Update also hands Scheduler the `Target.RoleArn` the schedule fires as, and authorizes `iam:PassRole`
|
|
515
|
+
against that Role. See [passing a Role to a service](https://yulinsim.dev/services/iam/#passing-a-role-to-a-service)
|
|
516
|
+
in the IAM docs.
|
|
517
|
+
|
|
518
|
+
The schedule ARN is what an operation authorizes against:
|
|
514
519
|
|
|
515
520
|
```typescript sim-scheduler-iam-policy
|
|
516
521
|
/**
|
|
@@ -678,7 +683,9 @@ console.log(simAws.scheduler().deliveryFailures.length); // 0
|
|
|
678
683
|
|
|
679
684
|
`Ref` returns the schedule's **name** and `Fn::GetAtt ... Arn` its ARN, which carries the schedule
|
|
680
685
|
group as it always does. A schedule the template leaves unnamed gets one generated from the stack
|
|
681
|
-
name
|
|
686
|
+
name, the logical ID and a tail derived from both, as
|
|
687
|
+
[the CloudFormation docs](https://yulinsim.dev/services/cloudformation/#names-cloudformation-generates "Names CloudFormation generates")
|
|
688
|
+
describe.
|
|
682
689
|
|
|
683
690
|
A property this simulation leaves out is refused at deploy time, naming the Resource. Deploying a
|
|
684
691
|
schedule that behaves differently from the one declared would be worse. Tearing the stack down
|
|
@@ -735,8 +742,8 @@ console.log(stack.output("GroupArn"));
|
|
|
735
742
|
```
|
|
736
743
|
|
|
737
744
|
`Ref` returns the group's **name** and `Fn::GetAtt` answers `Arn`, `State`, `CreationDate` and
|
|
738
|
-
`LastModificationDate`. A group the template leaves unnamed gets one generated from the stack name
|
|
739
|
-
|
|
745
|
+
`LastModificationDate`. A group the template leaves unnamed gets one generated from the stack name,
|
|
746
|
+
the logical ID and a tail derived from both, as a schedule does.
|
|
740
747
|
|
|
741
748
|
`Tags` on a group are recorded as an ignored property and the group deploys without them. The CDK
|
|
742
749
|
puts a stack's tags on every taggable Resource in it, so a template gains them without asking.
|
|
@@ -763,6 +770,7 @@ Resources of the same stack.
|
|
|
763
770
|
- Creation and modification timestamps from the simulation's clock, and prefix-narrowed,
|
|
764
771
|
state-narrowed, paged listings.
|
|
765
772
|
- IAM authorization against the schedule ARN.
|
|
773
|
+
- `iam:PassRole` authorization of the `Target.RoleArn` a Create or an Update hands over.
|
|
766
774
|
- SDK interception of `SchedulerClient`.
|
|
767
775
|
|
|
768
776
|
## Limitations
|