localstack-core 4.6.1.dev74__py3-none-any.whl → 4.10.1.dev7__py3-none-any.whl
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.
Potentially problematic release.
This version of localstack-core might be problematic. Click here for more details.
- localstack/aws/api/apigateway/__init__.py +87 -110
- localstack/aws/api/cloudformation/__init__.py +18 -4
- localstack/aws/api/cloudwatch/__init__.py +41 -1
- localstack/aws/api/config/__init__.py +4 -0
- localstack/aws/api/core.py +8 -5
- localstack/aws/api/dynamodb/__init__.py +30 -0
- localstack/aws/api/ec2/__init__.py +1524 -64
- localstack/aws/api/events/__init__.py +12 -16
- localstack/aws/api/iam/__init__.py +7 -0
- localstack/aws/api/kinesis/__init__.py +19 -0
- localstack/aws/api/kms/__init__.py +6 -0
- localstack/aws/api/lambda_/__init__.py +13 -0
- localstack/aws/api/logs/__init__.py +20 -8
- localstack/aws/api/opensearch/__init__.py +16 -0
- localstack/aws/api/pipes/__init__.py +24 -32
- localstack/aws/api/redshift/__init__.py +9 -3
- localstack/aws/api/route53/__init__.py +5 -0
- localstack/aws/api/s3/__init__.py +12 -0
- localstack/aws/api/s3control/__init__.py +56 -0
- localstack/aws/api/scheduler/__init__.py +14 -16
- localstack/aws/api/ssm/__init__.py +2 -0
- localstack/aws/api/stepfunctions/__init__.py +88 -114
- localstack/aws/api/support/__init__.py +8 -9
- localstack/aws/api/transcribe/__init__.py +17 -0
- localstack/aws/chain.py +2 -2
- localstack/aws/client.py +14 -11
- localstack/aws/connect.py +42 -41
- localstack/aws/forwarder.py +57 -9
- localstack/aws/gateway.py +1 -3
- localstack/aws/handlers/analytics.py +2 -3
- localstack/aws/handlers/cors.py +4 -5
- localstack/aws/handlers/internal_requests.py +6 -1
- localstack/aws/handlers/logging.py +13 -4
- localstack/aws/handlers/metric_handler.py +44 -5
- localstack/aws/handlers/service.py +48 -28
- localstack/aws/mocking.py +18 -27
- localstack/aws/patches.py +2 -2
- localstack/aws/protocol/op_router.py +11 -10
- localstack/aws/protocol/parser.py +475 -49
- localstack/aws/protocol/serializer.py +723 -106
- localstack/aws/protocol/service_router.py +133 -33
- localstack/aws/protocol/validate.py +6 -6
- localstack/aws/scaffold.py +9 -10
- localstack/aws/serving/edge.py +5 -6
- localstack/aws/serving/hypercorn.py +2 -2
- localstack/aws/serving/twisted.py +1 -2
- localstack/aws/serving/werkzeug.py +2 -2
- localstack/aws/skeleton.py +12 -11
- localstack/aws/spec-patches.json +58 -0
- localstack/aws/spec.py +66 -46
- localstack/cli/exceptions.py +1 -1
- localstack/cli/localstack.py +11 -11
- localstack/cli/lpm.py +4 -5
- localstack/cli/plugins.py +1 -1
- localstack/cli/profiles.py +1 -2
- localstack/config.py +40 -31
- localstack/constants.py +4 -29
- localstack/deprecations.py +5 -5
- localstack/dev/kubernetes/__main__.py +85 -5
- localstack/dev/run/__main__.py +5 -5
- localstack/dev/run/configurators.py +1 -4
- localstack/dev/run/paths.py +6 -6
- localstack/dns/models.py +2 -1
- localstack/dns/plugins.py +5 -1
- localstack/dns/server.py +16 -6
- localstack/http/dispatcher.py +1 -2
- localstack/http/response.py +2 -2
- localstack/http/router.py +1 -1
- localstack/http/trace.py +2 -1
- localstack/logging/format.py +6 -6
- localstack/packages/api.py +13 -12
- localstack/packages/core.py +4 -4
- localstack/packages/debugpy.py +1 -3
- localstack/packages/ffmpeg.py +1 -2
- localstack/packages/java.py +38 -12
- localstack/packages/plugins.py +0 -8
- localstack/runtime/analytics.py +3 -0
- localstack/runtime/hooks.py +1 -1
- localstack/runtime/init.py +8 -9
- localstack/runtime/main.py +5 -5
- localstack/runtime/patches.py +2 -2
- localstack/runtime/shutdown.py +2 -1
- localstack/services/apigateway/exporter.py +1 -2
- localstack/services/apigateway/helpers.py +7 -10
- localstack/services/apigateway/legacy/context.py +21 -21
- localstack/services/apigateway/legacy/helpers.py +27 -28
- localstack/services/apigateway/legacy/integration.py +11 -10
- localstack/services/apigateway/legacy/invocations.py +6 -5
- localstack/services/apigateway/legacy/provider.py +148 -68
- localstack/services/apigateway/legacy/router_asf.py +2 -2
- localstack/services/apigateway/legacy/templates.py +6 -6
- localstack/services/apigateway/models.py +16 -16
- localstack/services/apigateway/next_gen/execute_api/api.py +2 -2
- localstack/services/apigateway/next_gen/execute_api/context.py +25 -25
- localstack/services/apigateway/next_gen/execute_api/handlers/api_key_validation.py +2 -5
- localstack/services/apigateway/next_gen/execute_api/handlers/method_request.py +7 -2
- localstack/services/apigateway/next_gen/execute_api/handlers/parse.py +1 -2
- localstack/services/apigateway/next_gen/execute_api/handlers/resource_router.py +2 -3
- localstack/services/apigateway/next_gen/execute_api/header_utils.py +1 -1
- localstack/services/apigateway/next_gen/execute_api/helpers.py +2 -2
- localstack/services/apigateway/next_gen/execute_api/integrations/aws.py +9 -6
- localstack/services/apigateway/next_gen/execute_api/integrations/http.py +12 -12
- localstack/services/apigateway/next_gen/execute_api/router.py +31 -0
- localstack/services/apigateway/next_gen/execute_api/template_mapping.py +2 -2
- localstack/services/apigateway/next_gen/execute_api/test_invoke.py +114 -9
- localstack/services/apigateway/next_gen/execute_api/variables.py +63 -63
- localstack/services/apigateway/next_gen/provider.py +5 -0
- localstack/services/apigateway/resource_providers/aws_apigateway_account.py +3 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_account_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_apikey.py +14 -14
- localstack/services/apigateway/resource_providers/aws_apigateway_apikey_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_basepathmapping.py +5 -5
- localstack/services/apigateway/resource_providers/aws_apigateway_basepathmapping_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_deployment.py +46 -46
- localstack/services/apigateway/resource_providers/aws_apigateway_deployment_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_domainname.py +18 -18
- localstack/services/apigateway/resource_providers/aws_apigateway_domainname_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_gatewayresponse.py +7 -7
- localstack/services/apigateway/resource_providers/aws_apigateway_gatewayresponse_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_method.py +36 -36
- localstack/services/apigateway/resource_providers/aws_apigateway_method_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_model.py +6 -6
- localstack/services/apigateway/resource_providers/aws_apigateway_model_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_requestvalidator.py +6 -6
- localstack/services/apigateway/resource_providers/aws_apigateway_requestvalidator_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_resource.py +6 -6
- localstack/services/apigateway/resource_providers/aws_apigateway_resource_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_restapi.py +26 -26
- localstack/services/apigateway/resource_providers/aws_apigateway_restapi_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_stage.py +33 -33
- localstack/services/apigateway/resource_providers/aws_apigateway_stage_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_usageplan.py +18 -18
- localstack/services/apigateway/resource_providers/aws_apigateway_usageplan_plugin.py +1 -3
- localstack/services/apigateway/resource_providers/aws_apigateway_usageplankey.py +5 -5
- localstack/services/apigateway/resource_providers/aws_apigateway_usageplankey_plugin.py +1 -3
- localstack/services/cdk/resource_providers/cdk_metadata.py +4 -3
- localstack/services/cdk/resource_providers/cdk_metadata_plugin.py +1 -3
- localstack/services/certificatemanager/resource_providers/aws_certificatemanager_certificate.py +14 -14
- localstack/services/certificatemanager/resource_providers/aws_certificatemanager_certificate_plugin.py +1 -3
- localstack/services/cloudformation/api_utils.py +4 -8
- localstack/services/cloudformation/cfn_utils.py +2 -2
- localstack/services/cloudformation/deployment_utils.py +14 -12
- localstack/services/cloudformation/engine/changes.py +3 -3
- localstack/services/cloudformation/engine/entities.py +27 -17
- localstack/services/cloudformation/engine/parameters.py +4 -4
- localstack/services/cloudformation/engine/template_deployer.py +15 -14
- localstack/services/cloudformation/engine/template_utils.py +34 -12
- localstack/services/cloudformation/engine/transformers.py +11 -8
- localstack/services/cloudformation/engine/types.py +5 -4
- localstack/services/cloudformation/engine/v2/change_set_model.py +336 -39
- localstack/services/cloudformation/engine/v2/change_set_model_describer.py +96 -17
- localstack/services/cloudformation/engine/v2/change_set_model_executor.py +286 -139
- localstack/services/cloudformation/engine/v2/change_set_model_preproc.py +315 -146
- localstack/services/cloudformation/engine/v2/change_set_model_transform.py +380 -105
- localstack/services/cloudformation/engine/v2/change_set_model_validator.py +161 -31
- localstack/services/cloudformation/engine/v2/change_set_model_visitor.py +6 -0
- localstack/services/cloudformation/engine/v2/resolving.py +102 -0
- localstack/services/cloudformation/engine/yaml_parser.py +9 -2
- localstack/services/cloudformation/provider.py +8 -6
- localstack/services/cloudformation/provider_utils.py +34 -4
- localstack/services/cloudformation/resource_provider.py +31 -21
- localstack/services/cloudformation/resource_providers/aws_cloudformation_macro.py +7 -7
- localstack/services/cloudformation/resource_providers/aws_cloudformation_macro_plugin.py +1 -3
- localstack/services/cloudformation/resource_providers/aws_cloudformation_stack.py +9 -9
- localstack/services/cloudformation/resource_providers/aws_cloudformation_stack_plugin.py +1 -3
- localstack/services/cloudformation/resource_providers/aws_cloudformation_waitcondition.py +6 -6
- localstack/services/cloudformation/resource_providers/aws_cloudformation_waitcondition_plugin.py +1 -3
- localstack/services/cloudformation/resource_providers/aws_cloudformation_waitconditionhandle.py +2 -2
- localstack/services/cloudformation/resource_providers/aws_cloudformation_waitconditionhandle_plugin.py +1 -3
- localstack/services/cloudformation/resources.py +24149 -0
- localstack/services/cloudformation/scaffolding/__main__.py +13 -12
- localstack/services/cloudformation/scaffolding/propgen.py +2 -2
- localstack/services/cloudformation/service_models.py +2 -2
- localstack/services/cloudformation/stores.py +31 -22
- localstack/services/cloudformation/v2/entities.py +65 -92
- localstack/services/cloudformation/v2/provider.py +553 -128
- localstack/services/cloudformation/v2/types.py +38 -0
- localstack/services/cloudformation/v2/utils.py +4 -1
- localstack/services/cloudwatch/alarm_scheduler.py +11 -8
- localstack/services/cloudwatch/cloudwatch_database_helper.py +4 -5
- localstack/services/cloudwatch/models.py +5 -7
- localstack/services/cloudwatch/provider.py +30 -25
- localstack/services/cloudwatch/provider_v2.py +27 -32
- localstack/services/cloudwatch/resource_providers/aws_cloudwatch_alarm.py +40 -40
- localstack/services/cloudwatch/resource_providers/aws_cloudwatch_alarm_plugin.py +1 -3
- localstack/services/cloudwatch/resource_providers/aws_cloudwatch_compositealarm.py +12 -12
- localstack/services/cloudwatch/resource_providers/aws_cloudwatch_compositealarm_plugin.py +1 -3
- localstack/services/dynamodb/packages.py +3 -3
- localstack/services/dynamodb/provider.py +49 -8
- localstack/services/dynamodb/resource_providers/aws_dynamodb_globaltable.py +63 -63
- localstack/services/dynamodb/resource_providers/aws_dynamodb_globaltable_plugin.py +1 -3
- localstack/services/dynamodb/resource_providers/aws_dynamodb_table.py +57 -57
- localstack/services/dynamodb/resource_providers/aws_dynamodb_table_plugin.py +1 -3
- localstack/services/dynamodb/server.py +2 -2
- localstack/services/dynamodb/utils.py +13 -14
- localstack/services/dynamodb/v2/provider.py +48 -7
- localstack/services/dynamodbstreams/dynamodbstreams_api.py +2 -2
- localstack/services/dynamodbstreams/models.py +1 -3
- localstack/services/ec2/patches.py +26 -5
- localstack/services/ec2/provider.py +3 -3
- localstack/services/ec2/resource_providers/aws_ec2_dhcpoptions.py +10 -10
- localstack/services/ec2/resource_providers/aws_ec2_dhcpoptions_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_instance.py +96 -96
- localstack/services/ec2/resource_providers/aws_ec2_instance_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_internetgateway.py +5 -5
- localstack/services/ec2/resource_providers/aws_ec2_internetgateway_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_keypair.py +10 -10
- localstack/services/ec2/resource_providers/aws_ec2_keypair_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_natgateway.py +13 -13
- localstack/services/ec2/resource_providers/aws_ec2_natgateway_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_networkacl.py +6 -6
- localstack/services/ec2/resource_providers/aws_ec2_networkacl_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_prefixlist.py +14 -14
- localstack/services/ec2/resource_providers/aws_ec2_prefixlist_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_route.py +15 -15
- localstack/services/ec2/resource_providers/aws_ec2_route_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_routetable.py +6 -6
- localstack/services/ec2/resource_providers/aws_ec2_routetable_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_securitygroup.py +29 -29
- localstack/services/ec2/resource_providers/aws_ec2_securitygroup_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_subnet.py +19 -19
- localstack/services/ec2/resource_providers/aws_ec2_subnet_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_subnetroutetableassociation.py +4 -4
- localstack/services/ec2/resource_providers/aws_ec2_subnetroutetableassociation_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_transitgateway.py +16 -16
- localstack/services/ec2/resource_providers/aws_ec2_transitgateway_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_transitgatewayattachment.py +9 -9
- localstack/services/ec2/resource_providers/aws_ec2_transitgatewayattachment_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_vpc.py +15 -15
- localstack/services/ec2/resource_providers/aws_ec2_vpc_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_vpcendpoint.py +29 -22
- localstack/services/ec2/resource_providers/aws_ec2_vpcendpoint_plugin.py +1 -3
- localstack/services/ec2/resource_providers/aws_ec2_vpcgatewayattachment.py +5 -5
- localstack/services/ec2/resource_providers/aws_ec2_vpcgatewayattachment_plugin.py +1 -3
- localstack/services/ecr/resource_providers/aws_ecr_repository.py +22 -19
- localstack/services/ecr/resource_providers/aws_ecr_repository_plugin.py +1 -3
- localstack/services/edge.py +6 -6
- localstack/services/es/provider.py +21 -21
- localstack/services/events/archive.py +2 -2
- localstack/services/events/connection.py +5 -5
- localstack/services/events/event_bus.py +9 -9
- localstack/services/events/event_rule_engine.py +31 -13
- localstack/services/events/models.py +29 -30
- localstack/services/events/provider.py +29 -26
- localstack/services/events/replay.py +3 -3
- localstack/services/events/resource_providers/aws_events_apidestination.py +8 -8
- localstack/services/events/resource_providers/aws_events_apidestination_plugin.py +1 -3
- localstack/services/events/resource_providers/aws_events_connection.py +27 -27
- localstack/services/events/resource_providers/aws_events_connection_plugin.py +1 -3
- localstack/services/events/resource_providers/aws_events_eventbus.py +9 -9
- localstack/services/events/resource_providers/aws_events_eventbus_plugin.py +1 -3
- localstack/services/events/resource_providers/aws_events_eventbuspolicy.py +11 -11
- localstack/services/events/resource_providers/aws_events_eventbuspolicy_plugin.py +1 -3
- localstack/services/events/resource_providers/aws_events_rule.py +82 -82
- localstack/services/events/resource_providers/aws_events_rule_plugin.py +1 -3
- localstack/services/events/rule.py +15 -15
- localstack/services/events/target.py +21 -13
- localstack/services/events/utils.py +7 -7
- localstack/services/events/v1/models.py +1 -3
- localstack/services/events/v1/provider.py +15 -15
- localstack/services/firehose/models.py +1 -3
- localstack/services/firehose/provider.py +25 -16
- localstack/services/iam/iam_patches.py +5 -6
- localstack/services/iam/provider.py +14 -119
- localstack/services/iam/resource_providers/aws_iam_accesskey.py +6 -6
- localstack/services/iam/resource_providers/aws_iam_accesskey_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_group.py +9 -9
- localstack/services/iam/resource_providers/aws_iam_group_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_instanceprofile.py +5 -5
- localstack/services/iam/resource_providers/aws_iam_instanceprofile_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_managedpolicy.py +9 -9
- localstack/services/iam/resource_providers/aws_iam_managedpolicy_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_policy.py +7 -7
- localstack/services/iam/resource_providers/aws_iam_policy_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_role.py +16 -16
- localstack/services/iam/resource_providers/aws_iam_role_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_servercertificate.py +10 -10
- localstack/services/iam/resource_providers/aws_iam_servercertificate_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_servicelinkedrole.py +5 -5
- localstack/services/iam/resource_providers/aws_iam_servicelinkedrole_plugin.py +1 -3
- localstack/services/iam/resource_providers/aws_iam_user.py +17 -17
- localstack/services/iam/resource_providers/aws_iam_user_plugin.py +1 -3
- localstack/services/iam/resources/policy_simulator.py +133 -0
- localstack/services/kinesis/kinesis_mock_server.py +7 -8
- localstack/services/kinesis/models.py +17 -5
- localstack/services/kinesis/packages.py +3 -3
- localstack/services/kinesis/provider.py +86 -3
- localstack/services/kinesis/resource_providers/aws_kinesis_stream.py +13 -13
- localstack/services/kinesis/resource_providers/aws_kinesis_stream_plugin.py +1 -3
- localstack/services/kinesis/resource_providers/aws_kinesis_streamconsumer.py +7 -7
- localstack/services/kinesis/resource_providers/aws_kinesis_streamconsumer_plugin.py +1 -3
- localstack/services/kinesisfirehose/resource_providers/aws_kinesisfirehose_deliverystream.py +191 -191
- localstack/services/kinesisfirehose/resource_providers/aws_kinesisfirehose_deliverystream_plugin.py +1 -3
- localstack/services/kms/models.py +21 -18
- localstack/services/kms/provider.py +17 -11
- localstack/services/kms/resource_providers/aws_kms_alias.py +3 -3
- localstack/services/kms/resource_providers/aws_kms_alias_plugin.py +1 -3
- localstack/services/kms/resource_providers/aws_kms_key.py +14 -14
- localstack/services/kms/resource_providers/aws_kms_key_plugin.py +1 -3
- localstack/services/kms/utils.py +4 -3
- localstack/services/lambda_/api_utils.py +19 -16
- localstack/services/lambda_/custom_endpoints.py +2 -2
- localstack/services/lambda_/event_source_mapping/esm_worker_factory.py +4 -7
- localstack/services/lambda_/event_source_mapping/pipe_utils.py +2 -2
- localstack/services/lambda_/event_source_mapping/pollers/stream_poller.py +1 -1
- localstack/services/lambda_/event_source_mapping/senders/sender_utils.py +2 -1
- localstack/services/lambda_/hooks.py +6 -1
- localstack/services/lambda_/invocation/assignment.py +1 -2
- localstack/services/lambda_/invocation/docker_runtime_executor.py +7 -11
- localstack/services/lambda_/invocation/event_manager.py +1 -1
- localstack/services/lambda_/invocation/execution_environment.py +4 -4
- localstack/services/lambda_/invocation/executor_endpoint.py +8 -11
- localstack/services/lambda_/invocation/internal_sqs_queue.py +6 -10
- localstack/services/lambda_/invocation/lambda_models.py +33 -30
- localstack/services/lambda_/invocation/lambda_service.py +12 -5
- localstack/services/lambda_/invocation/logs.py +2 -3
- localstack/services/lambda_/invocation/runtime_executor.py +3 -3
- localstack/services/lambda_/invocation/version_manager.py +31 -8
- localstack/services/lambda_/ldm.py +14 -0
- localstack/services/lambda_/packages.py +3 -4
- localstack/services/lambda_/provider.py +9 -26
- localstack/services/lambda_/provider_utils.py +1 -1
- localstack/services/lambda_/resource_providers/aws_lambda_codesigningconfig.py +8 -8
- localstack/services/lambda_/resource_providers/aws_lambda_codesigningconfig_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_eventinvokeconfig.py +11 -11
- localstack/services/lambda_/resource_providers/aws_lambda_eventinvokeconfig_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_eventsourcemapping.py +39 -39
- localstack/services/lambda_/resource_providers/aws_lambda_eventsourcemapping_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_function.py +54 -54
- localstack/services/lambda_/resource_providers/aws_lambda_function_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_layerversion.py +11 -11
- localstack/services/lambda_/resource_providers/aws_lambda_layerversion_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_layerversionpermission.py +6 -6
- localstack/services/lambda_/resource_providers/aws_lambda_layerversionpermission_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_permission.py +10 -10
- localstack/services/lambda_/resource_providers/aws_lambda_permission_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_url.py +15 -15
- localstack/services/lambda_/resource_providers/aws_lambda_url_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/aws_lambda_version.py +8 -8
- localstack/services/lambda_/resource_providers/aws_lambda_version_plugin.py +1 -3
- localstack/services/lambda_/resource_providers/lambda_alias.py +12 -12
- localstack/services/lambda_/resource_providers/lambda_alias_plugin.py +1 -3
- localstack/services/lambda_/runtimes.py +1 -3
- localstack/services/lambda_/urlrouter.py +14 -1
- localstack/services/logs/models.py +1 -3
- localstack/services/logs/provider.py +4 -4
- localstack/services/logs/resource_providers/aws_logs_loggroup.py +9 -9
- localstack/services/logs/resource_providers/aws_logs_loggroup_plugin.py +1 -3
- localstack/services/logs/resource_providers/aws_logs_logstream.py +4 -4
- localstack/services/logs/resource_providers/aws_logs_logstream_plugin.py +1 -3
- localstack/services/logs/resource_providers/aws_logs_subscriptionfilter.py +7 -7
- localstack/services/logs/resource_providers/aws_logs_subscriptionfilter_plugin.py +1 -3
- localstack/services/moto.py +5 -4
- localstack/services/opensearch/cluster.py +28 -20
- localstack/services/opensearch/cluster_manager.py +13 -14
- localstack/services/opensearch/models.py +1 -3
- localstack/services/opensearch/packages.py +27 -9
- localstack/services/opensearch/provider.py +15 -10
- localstack/services/opensearch/resource_providers/aws_elasticsearch_domain.py +61 -61
- localstack/services/opensearch/resource_providers/aws_elasticsearch_domain_plugin.py +1 -3
- localstack/services/opensearch/resource_providers/aws_opensearchservice_domain.py +89 -89
- localstack/services/opensearch/resource_providers/aws_opensearchservice_domain_plugin.py +1 -3
- localstack/services/opensearch/versions.py +57 -10
- localstack/services/plugins.py +37 -32
- localstack/services/providers.py +10 -2
- localstack/services/redshift/provider.py +0 -21
- localstack/services/redshift/resource_providers/aws_redshift_cluster.py +57 -57
- localstack/services/redshift/resource_providers/aws_redshift_cluster_plugin.py +1 -3
- localstack/services/resource_groups/resource_providers/aws_resourcegroups_group.py +21 -21
- localstack/services/resource_groups/resource_providers/aws_resourcegroups_group_plugin.py +1 -3
- localstack/services/route53/models.py +1 -3
- localstack/services/route53/provider.py +1 -2
- localstack/services/route53/resource_providers/aws_route53_healthcheck.py +6 -6
- localstack/services/route53/resource_providers/aws_route53_healthcheck_plugin.py +1 -3
- localstack/services/route53/resource_providers/aws_route53_recordset.py +27 -27
- localstack/services/route53/resource_providers/aws_route53_recordset_plugin.py +1 -3
- localstack/services/route53resolver/models.py +8 -10
- localstack/services/route53resolver/provider.py +12 -12
- localstack/services/s3/codec.py +2 -2
- localstack/services/s3/constants.py +5 -2
- localstack/services/s3/cors.py +8 -8
- localstack/services/s3/models.py +73 -73
- localstack/services/s3/notifications.py +74 -58
- localstack/services/s3/presigned_url.py +41 -59
- localstack/services/s3/provider.py +86 -29
- localstack/services/s3/resource_providers/aws_s3_bucket.py +180 -180
- localstack/services/s3/resource_providers/aws_s3_bucket_plugin.py +1 -3
- localstack/services/s3/resource_providers/aws_s3_bucketpolicy.py +4 -4
- localstack/services/s3/resource_providers/aws_s3_bucketpolicy_plugin.py +1 -3
- localstack/services/s3/storage/core.py +4 -3
- localstack/services/s3/storage/ephemeral.py +7 -6
- localstack/services/s3/utils.py +51 -31
- localstack/services/s3/validation.py +47 -33
- localstack/services/s3/website_hosting.py +9 -7
- localstack/services/scheduler/resource_providers/aws_scheduler_schedule.py +60 -60
- localstack/services/scheduler/resource_providers/aws_scheduler_schedule_plugin.py +1 -3
- localstack/services/scheduler/resource_providers/aws_scheduler_schedulegroup.py +9 -9
- localstack/services/scheduler/resource_providers/aws_scheduler_schedulegroup_plugin.py +1 -3
- localstack/services/secretsmanager/provider.py +10 -12
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_resourcepolicy.py +5 -5
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_resourcepolicy_plugin.py +1 -3
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_rotationschedule.py +21 -21
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_rotationschedule_plugin.py +1 -3
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_secret.py +23 -23
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_secret_plugin.py +1 -3
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_secrettargetattachment.py +5 -5
- localstack/services/secretsmanager/resource_providers/aws_secretsmanager_secrettargetattachment_plugin.py +1 -3
- localstack/services/ses/models.py +8 -1
- localstack/services/ses/provider.py +128 -55
- localstack/services/ses/resource_providers/aws_ses_emailidentity.py +21 -21
- localstack/services/ses/resource_providers/aws_ses_emailidentity_plugin.py +1 -3
- localstack/services/sns/constants.py +7 -1
- localstack/services/sns/executor.py +9 -2
- localstack/services/sns/models.py +25 -25
- localstack/services/sns/provider.py +9 -7
- localstack/services/sns/publisher.py +37 -23
- localstack/services/sns/resource_providers/aws_sns_subscription.py +13 -13
- localstack/services/sns/resource_providers/aws_sns_subscription_plugin.py +1 -3
- localstack/services/sns/resource_providers/aws_sns_topic.py +16 -16
- localstack/services/sns/resource_providers/aws_sns_topic_plugin.py +1 -3
- localstack/services/sns/resource_providers/aws_sns_topicpolicy.py +4 -4
- localstack/services/sns/resource_providers/aws_sns_topicpolicy_plugin.py +1 -3
- localstack/services/sns/v2/models.py +167 -0
- localstack/services/sns/v2/provider.py +867 -0
- localstack/services/sns/v2/utils.py +130 -0
- localstack/services/sqs/constants.py +2 -2
- localstack/services/sqs/developer_api.py +205 -0
- localstack/services/sqs/models.py +71 -36
- localstack/services/sqs/provider.py +56 -332
- localstack/services/sqs/query_api.py +8 -5
- localstack/services/sqs/resource_providers/aws_sqs_queue.py +21 -21
- localstack/services/sqs/resource_providers/aws_sqs_queue_plugin.py +1 -3
- localstack/services/sqs/resource_providers/aws_sqs_queuepolicy.py +4 -4
- localstack/services/sqs/resource_providers/aws_sqs_queuepolicy_plugin.py +1 -3
- localstack/services/sqs/utils.py +123 -4
- localstack/services/ssm/provider.py +3 -4
- localstack/services/ssm/resource_providers/aws_ssm_maintenancewindow.py +15 -15
- localstack/services/ssm/resource_providers/aws_ssm_maintenancewindow_plugin.py +1 -3
- localstack/services/ssm/resource_providers/aws_ssm_maintenancewindowtarget.py +10 -10
- localstack/services/ssm/resource_providers/aws_ssm_maintenancewindowtarget_plugin.py +1 -3
- localstack/services/ssm/resource_providers/aws_ssm_maintenancewindowtask.py +48 -48
- localstack/services/ssm/resource_providers/aws_ssm_maintenancewindowtask_plugin.py +1 -3
- localstack/services/ssm/resource_providers/aws_ssm_parameter.py +10 -10
- localstack/services/ssm/resource_providers/aws_ssm_parameter_plugin.py +1 -3
- localstack/services/ssm/resource_providers/aws_ssm_patchbaseline.py +29 -29
- localstack/services/ssm/resource_providers/aws_ssm_patchbaseline_plugin.py +1 -3
- localstack/services/stepfunctions/asl/antlt4utils/antlr4utils.py +3 -4
- localstack/services/stepfunctions/asl/component/common/assign/assign_decl.py +1 -1
- localstack/services/stepfunctions/asl/component/common/assign/assign_decl_binding.py +1 -1
- localstack/services/stepfunctions/asl/component/common/assign/assign_template_value_array.py +1 -1
- localstack/services/stepfunctions/asl/component/common/assign/assign_template_value_object.py +1 -1
- localstack/services/stepfunctions/asl/component/common/catch/catcher_decl.py +9 -9
- localstack/services/stepfunctions/asl/component/common/error_name/custom_error_name.py +2 -2
- localstack/services/stepfunctions/asl/component/common/error_name/error_name.py +4 -4
- localstack/services/stepfunctions/asl/component/common/error_name/failure_event.py +8 -8
- localstack/services/stepfunctions/asl/component/common/error_name/states_error_name_type.py +1 -1
- localstack/services/stepfunctions/asl/component/common/jsonata/jsonata_template_binding.py +2 -2
- localstack/services/stepfunctions/asl/component/common/jsonata/jsonata_template_value_array.py +1 -1
- localstack/services/stepfunctions/asl/component/common/jsonata/jsonata_template_value_object.py +1 -1
- localstack/services/stepfunctions/asl/component/common/path/input_path.py +4 -4
- localstack/services/stepfunctions/asl/component/common/path/output_path.py +4 -4
- localstack/services/stepfunctions/asl/component/common/path/result_path.py +3 -3
- localstack/services/stepfunctions/asl/component/common/payload/payloadvalue/payloadarr/payload_arr.py +1 -1
- localstack/services/stepfunctions/asl/component/common/payload/payloadvalue/payloadbinding/payload_binding.py +3 -3
- localstack/services/stepfunctions/asl/component/common/payload/payloadvalue/payloadtmpl/payload_tmpl.py +1 -1
- localstack/services/stepfunctions/asl/component/common/retry/retrier_decl.py +8 -8
- localstack/services/stepfunctions/asl/component/common/string/string_expression.py +3 -3
- localstack/services/stepfunctions/asl/component/common/timeouts/timeout.py +3 -3
- localstack/services/stepfunctions/asl/component/eval_component.py +2 -3
- localstack/services/stepfunctions/asl/component/intrinsic/argument/argument.py +4 -4
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/array/array_partition.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/generic/string_format.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/states_function_array.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/states_function_format.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/jsonata.py +3 -3
- localstack/services/stepfunctions/asl/component/intrinsic/member.py +1 -1
- localstack/services/stepfunctions/asl/component/program/program.py +9 -9
- localstack/services/stepfunctions/asl/component/program/states.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state.py +10 -11
- localstack/services/stepfunctions/asl/component/state/state_choice/choice_rule.py +11 -11
- localstack/services/stepfunctions/asl/component/state/state_choice/comparison/comparison.py +5 -11
- localstack/services/stepfunctions/asl/component/state/state_choice/comparison/operator/implementations/is_operator.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_choice/state_choice.py +3 -5
- localstack/services/stepfunctions/asl/component/state/state_execution/execute_state.py +9 -9
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/item_reader_decl.py +7 -7
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/reader_config/reader_config_decl.py +5 -5
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/resource_eval/resource_eval_s3.py +2 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/resource_eval/resource_output_transformer/resource_output_transformer_csv.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/distributed_iteration_component.py +8 -8
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/inline_iteration_component.py +7 -7
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/itemprocessor/distributed_item_processor_worker.py +4 -4
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/itemprocessor/inline_item_processor_worker.py +5 -5
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/itemprocessor/map_run_record.py +10 -10
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/iteration_component.py +3 -3
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/iteration_declaration.py +3 -3
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/iteration_worker.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/iterator/distributed_iterator_worker.py +3 -5
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/iterator/inline_iterator.py +1 -2
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/iterator/inline_iterator_worker.py +5 -5
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/iteration/job.py +9 -9
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/result_writer/resource_eval/resource_eval_s3.py +2 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/state_map.py +12 -13
- localstack/services/stepfunctions/asl/component/state/state_execution/state_parallel/branch_worker.py +3 -3
- localstack/services/stepfunctions/asl/component/state/state_execution/state_parallel/branches_decl.py +7 -7
- localstack/services/stepfunctions/asl/component/state/state_execution/state_parallel/state_parallel.py +2 -3
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/lambda_eval_utils.py +7 -7
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/resource.py +3 -3
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service.py +10 -10
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_api_gateway.py +18 -18
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_aws_sdk.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_batch.py +8 -7
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_callback.py +18 -17
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_dynamodb.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_ecs.py +5 -4
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_events.py +4 -4
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_glue.py +7 -6
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_lambda.py +4 -4
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_sfn.py +9 -8
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_sns.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_sqs.py +4 -4
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/state_task.py +5 -5
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/state_task_lambda.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_fail/state_fail.py +3 -5
- localstack/services/stepfunctions/asl/component/state/state_pass/state_pass.py +5 -7
- localstack/services/stepfunctions/asl/component/state/state_succeed/state_succeed.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_wait/state_wait.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_wait/wait_function/timestamp.py +2 -2
- localstack/services/stepfunctions/asl/eval/callback/callback.py +18 -18
- localstack/services/stepfunctions/asl/eval/environment.py +22 -24
- localstack/services/stepfunctions/asl/eval/evaluation_details.py +3 -5
- localstack/services/stepfunctions/asl/eval/event/event_manager.py +10 -10
- localstack/services/stepfunctions/asl/eval/event/logging.py +3 -3
- localstack/services/stepfunctions/asl/eval/program_state.py +8 -8
- localstack/services/stepfunctions/asl/eval/states.py +12 -12
- localstack/services/stepfunctions/asl/eval/test_state/environment.py +3 -5
- localstack/services/stepfunctions/asl/eval/variable_store.py +6 -6
- localstack/services/stepfunctions/asl/jsonata/jsonata.py +7 -6
- localstack/services/stepfunctions/asl/parse/asl_parser.py +1 -1
- localstack/services/stepfunctions/asl/parse/intrinsic/preprocessor.py +2 -3
- localstack/services/stepfunctions/asl/parse/preprocessor.py +44 -44
- localstack/services/stepfunctions/asl/parse/typed_props.py +2 -2
- localstack/services/stepfunctions/asl/static_analyser/intrinsic/variable_names_intrinsic_static_analyser.py +1 -1
- localstack/services/stepfunctions/asl/static_analyser/variable_references_static_analyser.py +2 -2
- localstack/services/stepfunctions/asl/utils/encoding.py +2 -2
- localstack/services/stepfunctions/asl/utils/json_path.py +2 -2
- localstack/services/stepfunctions/backend/activity.py +4 -4
- localstack/services/stepfunctions/backend/alias.py +8 -8
- localstack/services/stepfunctions/backend/execution.py +29 -30
- localstack/services/stepfunctions/backend/execution_worker.py +7 -7
- localstack/services/stepfunctions/backend/state_machine.py +28 -28
- localstack/services/stepfunctions/backend/test_state/execution.py +3 -4
- localstack/services/stepfunctions/backend/test_state/execution_worker.py +1 -3
- localstack/services/stepfunctions/mocking/mock_config.py +9 -9
- localstack/services/stepfunctions/mocking/mock_config_file.py +10 -10
- localstack/services/stepfunctions/packages.py +14 -5
- localstack/services/stepfunctions/provider.py +34 -44
- localstack/services/stepfunctions/quotas.py +2 -3
- localstack/services/stepfunctions/resource_providers/aws_stepfunctions_activity.py +6 -6
- localstack/services/stepfunctions/resource_providers/aws_stepfunctions_activity_plugin.py +1 -3
- localstack/services/stepfunctions/resource_providers/aws_stepfunctions_statemachine.py +25 -25
- localstack/services/stepfunctions/resource_providers/aws_stepfunctions_statemachine_plugin.py +1 -3
- localstack/services/stepfunctions/stepfunctions_utils.py +1 -2
- localstack/services/stores.py +8 -8
- localstack/services/transcribe/packages.py +1 -3
- localstack/services/transcribe/provider.py +8 -3
- localstack/state/codecs.py +61 -0
- localstack/state/core.py +11 -5
- localstack/state/inspect.py +4 -4
- localstack/state/pickle.py +22 -60
- localstack/testing/aws/asf_utils.py +3 -2
- localstack/testing/aws/cloudformation_utils.py +1 -1
- localstack/testing/aws/lambda_utils.py +15 -14
- localstack/testing/aws/util.py +3 -2
- localstack/testing/pytest/cloudformation/fixtures.py +68 -18
- localstack/testing/pytest/container.py +5 -5
- localstack/testing/pytest/filters.py +1 -3
- localstack/testing/pytest/fixtures.py +188 -55
- localstack/testing/pytest/in_memory_localstack.py +1 -3
- localstack/testing/pytest/marking.py +42 -15
- localstack/testing/pytest/path_filter.py +1 -1
- localstack/testing/pytest/stepfunctions/fixtures.py +4 -4
- localstack/testing/pytest/stepfunctions/utils.py +11 -10
- localstack/testing/pytest/util.py +1 -1
- localstack/testing/pytest/validation_tracking.py +3 -4
- localstack/testing/scenario/provisioning.py +11 -10
- localstack/testing/snapshots/transformer_utility.py +8 -3
- localstack/testing/testselection/matching.py +2 -2
- localstack/testing/testselection/opt_out.py +1 -1
- localstack/testing/testselection/scripts/filter_by_test_selection.py +1 -1
- localstack/testing/testselection/scripts/generate_test_selection.py +1 -1
- localstack/testing/testselection/testselection.py +2 -2
- localstack/utils/analytics/cli.py +2 -3
- localstack/utils/analytics/client.py +5 -5
- localstack/utils/analytics/events.py +2 -2
- localstack/utils/analytics/metadata.py +6 -4
- localstack/utils/analytics/metrics/counter.py +11 -18
- localstack/utils/analytics/metrics/registry.py +2 -2
- localstack/utils/analytics/publisher.py +4 -5
- localstack/utils/analytics/service_providers.py +19 -0
- localstack/utils/analytics/service_request_aggregator.py +4 -4
- localstack/utils/archives.py +12 -12
- localstack/utils/asyncio.py +2 -2
- localstack/utils/aws/arns.py +26 -31
- localstack/utils/aws/aws_responses.py +21 -28
- localstack/utils/aws/aws_stack.py +7 -12
- localstack/utils/aws/dead_letter_queue.py +4 -9
- localstack/utils/aws/message_forwarding.py +8 -11
- localstack/utils/aws/request_context.py +5 -6
- localstack/utils/aws/resources.py +1 -1
- localstack/utils/aws/templating.py +4 -4
- localstack/utils/batch_policy.py +4 -4
- localstack/utils/bootstrap.py +37 -30
- localstack/utils/catalog/catalog.py +139 -0
- localstack/utils/catalog/catalog_loader.py +11 -0
- localstack/utils/catalog/common.py +58 -0
- localstack/utils/catalog/plugins.py +28 -0
- localstack/utils/cloudwatch/cloudwatch_util.py +5 -5
- localstack/utils/collections.py +33 -27
- localstack/utils/config_listener.py +2 -2
- localstack/utils/container_networking.py +5 -6
- localstack/utils/container_utils/container_client.py +156 -160
- localstack/utils/container_utils/docker_cmd_client.py +97 -81
- localstack/utils/container_utils/docker_sdk_client.py +75 -72
- localstack/utils/crypto.py +12 -13
- localstack/utils/diagnose.py +11 -12
- localstack/utils/docker_utils.py +11 -7
- localstack/utils/files.py +34 -15
- localstack/utils/functions.py +5 -4
- localstack/utils/http.py +14 -14
- localstack/utils/iputils.py +2 -1
- localstack/utils/json.py +21 -7
- localstack/utils/kinesis/kinesis_connector.py +2 -1
- localstack/utils/net.py +25 -17
- localstack/utils/no_exit_argument_parser.py +2 -2
- localstack/utils/numbers.py +9 -2
- localstack/utils/objects.py +15 -14
- localstack/utils/patch.py +14 -7
- localstack/utils/platform.py +2 -2
- localstack/utils/run.py +15 -14
- localstack/utils/scheduler.py +13 -12
- localstack/utils/server/tcp_proxy.py +2 -2
- localstack/utils/serving.py +3 -4
- localstack/utils/strings.py +15 -16
- localstack/utils/sync.py +126 -1
- localstack/utils/tagging.py +10 -8
- localstack/utils/testutil.py +17 -17
- localstack/utils/threads.py +3 -3
- localstack/utils/time.py +12 -4
- localstack/utils/urls.py +1 -3
- localstack/utils/xml.py +1 -1
- localstack/utils/xray/traceid.py +1 -1
- localstack/version.py +16 -3
- {localstack_core-4.6.1.dev74.dist-info → localstack_core-4.10.1.dev7.dist-info}/METADATA +18 -14
- {localstack_core-4.6.1.dev74.dist-info → localstack_core-4.10.1.dev7.dist-info}/RECORD +663 -656
- {localstack_core-4.6.1.dev74.dist-info → localstack_core-4.10.1.dev7.dist-info}/entry_points.txt +8 -4
- localstack_core-4.10.1.dev7.dist-info/plux.json +1 -0
- localstack/packages/terraform.py +0 -47
- localstack/services/cloudformation/deploy.html +0 -144
- localstack/services/cloudformation/deploy_ui.py +0 -47
- localstack/services/cloudformation/plugins.py +0 -12
- localstack/services/lambda_/lambda_debug_mode/ldm.py +0 -375
- localstack/services/lambda_/lambda_debug_mode/ldm_config_file.py +0 -178
- localstack/services/lambda_/lambda_debug_mode/ldm_types.py +0 -11
- localstack/services/lambda_/lambda_debug_mode/ldm_utils.py +0 -43
- localstack_core-4.6.1.dev74.dist-info/plux.json +0 -1
- /localstack/{services/lambda_/lambda_debug_mode/__init__.py → testing/pytest/cloudformation/transformers.py} +0 -0
- {localstack_core-4.6.1.dev74.data → localstack_core-4.10.1.dev7.data}/scripts/localstack +0 -0
- {localstack_core-4.6.1.dev74.data → localstack_core-4.10.1.dev7.data}/scripts/localstack-supervisor +0 -0
- {localstack_core-4.6.1.dev74.data → localstack_core-4.10.1.dev7.data}/scripts/localstack.bat +0 -0
- {localstack_core-4.6.1.dev74.dist-info → localstack_core-4.10.1.dev7.dist-info}/WHEEL +0 -0
- {localstack_core-4.6.1.dev74.dist-info → localstack_core-4.10.1.dev7.dist-info}/licenses/LICENSE.txt +0 -0
- {localstack_core-4.6.1.dev74.dist-info → localstack_core-4.10.1.dev7.dist-info}/top_level.txt +0 -0
|
@@ -10,7 +10,6 @@ import struct
|
|
|
10
10
|
import uuid
|
|
11
11
|
from collections import namedtuple
|
|
12
12
|
from dataclasses import dataclass
|
|
13
|
-
from typing import Dict, Optional, Tuple
|
|
14
13
|
|
|
15
14
|
from cryptography.exceptions import InvalidSignature, InvalidTag, UnsupportedAlgorithm
|
|
16
15
|
from cryptography.hazmat.backends import default_backend
|
|
@@ -91,9 +90,7 @@ KEY_ID_LEN = 36
|
|
|
91
90
|
# Moto uses IV_LEN of 12, as it is fine for GCM encryption mode, but we use CBC, so have to set it to 16.
|
|
92
91
|
IV_LEN = 16
|
|
93
92
|
TAG_LEN = 16
|
|
94
|
-
CIPHERTEXT_HEADER_FORMAT = ">{
|
|
95
|
-
key_id_len=KEY_ID_LEN, iv_len=IV_LEN, tag_len=TAG_LEN
|
|
96
|
-
)
|
|
93
|
+
CIPHERTEXT_HEADER_FORMAT = f">{KEY_ID_LEN}s{IV_LEN}s{TAG_LEN}s"
|
|
97
94
|
HEADER_LEN = KEY_ID_LEN + IV_LEN + TAG_LEN
|
|
98
95
|
Ciphertext = namedtuple("Ciphertext", ("key_id", "iv", "ciphertext", "tag"))
|
|
99
96
|
|
|
@@ -138,7 +135,7 @@ def deserialize_ciphertext_blob(ciphertext_blob: bytes) -> Ciphertext:
|
|
|
138
135
|
return Ciphertext(key_id=key_id.decode("utf-8"), iv=iv, ciphertext=ciphertext, tag=tag)
|
|
139
136
|
|
|
140
137
|
|
|
141
|
-
def _serialize_encryption_context(encryption_context:
|
|
138
|
+
def _serialize_encryption_context(encryption_context: EncryptionContextType | None) -> bytes:
|
|
142
139
|
if encryption_context:
|
|
143
140
|
aad = io.BytesIO()
|
|
144
141
|
for key, value in sorted(encryption_context.items(), key=lambda x: x[0]):
|
|
@@ -173,8 +170,8 @@ class KmsCryptoKey:
|
|
|
173
170
|
by AWS and is not used by AWS.
|
|
174
171
|
"""
|
|
175
172
|
|
|
176
|
-
public_key:
|
|
177
|
-
private_key:
|
|
173
|
+
public_key: bytes | None
|
|
174
|
+
private_key: bytes | None
|
|
178
175
|
key_material: bytes
|
|
179
176
|
key_spec: str
|
|
180
177
|
|
|
@@ -217,7 +214,7 @@ class KmsCryptoKey:
|
|
|
217
214
|
|
|
218
215
|
raise UnsupportedOperationException(f"KeySpec {key_spec} is not supported")
|
|
219
216
|
|
|
220
|
-
def __init__(self, key_spec: str, key_material:
|
|
217
|
+
def __init__(self, key_spec: str, key_material: bytes | None = None):
|
|
221
218
|
self.private_key = None
|
|
222
219
|
self.public_key = None
|
|
223
220
|
# Technically, key_material, being a symmetric encryption key, is only relevant for
|
|
@@ -251,7 +248,13 @@ class KmsCryptoKey:
|
|
|
251
248
|
self._serialize_key(key)
|
|
252
249
|
|
|
253
250
|
def load_key_material(self, material: bytes):
|
|
254
|
-
if self.key_spec
|
|
251
|
+
if self.key_spec in [
|
|
252
|
+
KeySpec.SYMMETRIC_DEFAULT,
|
|
253
|
+
KeySpec.HMAC_224,
|
|
254
|
+
KeySpec.HMAC_256,
|
|
255
|
+
KeySpec.HMAC_384,
|
|
256
|
+
KeySpec.HMAC_512,
|
|
257
|
+
]:
|
|
255
258
|
self.key_material = material
|
|
256
259
|
else:
|
|
257
260
|
key = crypto_serialization.load_der_private_key(material, password=None)
|
|
@@ -280,7 +283,7 @@ class KmsCryptoKey:
|
|
|
280
283
|
class KmsKey:
|
|
281
284
|
metadata: KeyMetadata
|
|
282
285
|
crypto_key: KmsCryptoKey
|
|
283
|
-
tags:
|
|
286
|
+
tags: dict[str, str]
|
|
284
287
|
policy: str
|
|
285
288
|
is_key_rotation_enabled: bool
|
|
286
289
|
rotation_period_in_days: int
|
|
@@ -752,7 +755,7 @@ class KmsGrant:
|
|
|
752
755
|
# keys. But, based on our understanding of AWS documentation for CreateGrant, ListGrants operations etc,
|
|
753
756
|
# AWS has some set of fields for grants like it has for keys. So we are going to call them `metadata` here for
|
|
754
757
|
# consistency.
|
|
755
|
-
metadata:
|
|
758
|
+
metadata: dict
|
|
756
759
|
# Tokens are not a part of metadata, as their use is more limited and specific than for the rest of the
|
|
757
760
|
# metadata: https://docs.aws.amazon.com/kms/latest/developerguide/grant-manage.html#using-grant-token
|
|
758
761
|
# Tokens are used to refer to a grant in a short period right after the grant gets created. Normally it might
|
|
@@ -797,7 +800,7 @@ class KmsGrant:
|
|
|
797
800
|
class KmsAlias:
|
|
798
801
|
# Like with grants (see comment for KmsGrant), there is no mention of some specific object modeling metadata
|
|
799
802
|
# for KMS aliases. But there is data that is some metadata, so we model it in a way similar to KeyMetadata for keys.
|
|
800
|
-
metadata:
|
|
803
|
+
metadata: dict
|
|
801
804
|
|
|
802
805
|
def __init__(
|
|
803
806
|
self,
|
|
@@ -827,25 +830,25 @@ class KeyImportState:
|
|
|
827
830
|
|
|
828
831
|
class KmsStore(BaseStore):
|
|
829
832
|
# maps key ids to keys
|
|
830
|
-
keys:
|
|
833
|
+
keys: dict[str, KmsKey] = LocalAttribute(default=dict)
|
|
831
834
|
|
|
832
835
|
# According to AWS documentation on grants https://docs.aws.amazon.com/kms/latest/APIReference/API_RetireGrant.html
|
|
833
836
|
# "Cross-account use: Yes. You can retire a grant on a KMS key in a different AWS account."
|
|
834
837
|
|
|
835
838
|
# maps grant ids to grants
|
|
836
|
-
grants:
|
|
839
|
+
grants: dict[str, KmsGrant] = LocalAttribute(default=dict)
|
|
837
840
|
|
|
838
841
|
# maps from (grant names (used for idempotency), key id) to grant ids
|
|
839
|
-
grant_names:
|
|
842
|
+
grant_names: dict[tuple[str, str], str] = LocalAttribute(default=dict)
|
|
840
843
|
|
|
841
844
|
# maps grant tokens to grant ids
|
|
842
|
-
grant_tokens:
|
|
845
|
+
grant_tokens: dict[str, str] = LocalAttribute(default=dict)
|
|
843
846
|
|
|
844
847
|
# maps key alias names to aliases
|
|
845
|
-
aliases:
|
|
848
|
+
aliases: dict[str, KmsAlias] = LocalAttribute(default=dict)
|
|
846
849
|
|
|
847
850
|
# maps import tokens to import data
|
|
848
|
-
imports:
|
|
851
|
+
imports: dict[str, KeyImportState] = LocalAttribute(default=dict)
|
|
849
852
|
|
|
850
853
|
|
|
851
854
|
kms_stores = AccountRegionBundle("kms", KmsStore)
|
|
@@ -3,7 +3,6 @@ import copy
|
|
|
3
3
|
import datetime
|
|
4
4
|
import logging
|
|
5
5
|
import os
|
|
6
|
-
from typing import Dict, Tuple
|
|
7
6
|
|
|
8
7
|
from cryptography.exceptions import InvalidTag
|
|
9
8
|
from cryptography.hazmat.backends import default_backend
|
|
@@ -86,6 +85,7 @@ from localstack.aws.api.kms import (
|
|
|
86
85
|
MacAlgorithmSpec,
|
|
87
86
|
MarkerType,
|
|
88
87
|
MultiRegionKey,
|
|
88
|
+
MultiRegionKeyType,
|
|
89
89
|
NotFoundException,
|
|
90
90
|
NullableBooleanType,
|
|
91
91
|
OriginType,
|
|
@@ -359,7 +359,7 @@ class KmsProvider(KmsApi, ServiceLifecycleHook):
|
|
|
359
359
|
return store.aliases.get(alias_name)
|
|
360
360
|
|
|
361
361
|
@staticmethod
|
|
362
|
-
def _parse_key_id(key_id_or_arn: str, context: RequestContext) ->
|
|
362
|
+
def _parse_key_id(key_id_or_arn: str, context: RequestContext) -> tuple[str, str, str]:
|
|
363
363
|
"""
|
|
364
364
|
Return locator attributes (account ID, region_name, key ID) of a given KMS key.
|
|
365
365
|
|
|
@@ -491,24 +491,32 @@ class KmsProvider(KmsApi, ServiceLifecycleHook):
|
|
|
491
491
|
self, context: RequestContext, request: ReplicateKeyRequest
|
|
492
492
|
) -> ReplicateKeyResponse:
|
|
493
493
|
account_id = context.account_id
|
|
494
|
-
|
|
495
|
-
key_id =
|
|
496
|
-
|
|
494
|
+
primary_key = self._get_kms_key(account_id, context.region, request.get("KeyId"))
|
|
495
|
+
key_id = primary_key.metadata.get("KeyId")
|
|
496
|
+
key_arn = primary_key.metadata.get("Arn")
|
|
497
|
+
if not primary_key.metadata.get("MultiRegion"):
|
|
497
498
|
raise UnsupportedOperationException(
|
|
498
499
|
f"Unable to replicate a non-MultiRegion key {key_id}"
|
|
499
500
|
)
|
|
500
501
|
replica_region = request.get("ReplicaRegion")
|
|
501
502
|
replicate_to_store = kms_stores[account_id][replica_region]
|
|
503
|
+
|
|
504
|
+
if (
|
|
505
|
+
primary_key.metadata.get("MultiRegionConfiguration", {}).get("MultiRegionKeyType")
|
|
506
|
+
!= MultiRegionKeyType.PRIMARY
|
|
507
|
+
):
|
|
508
|
+
raise UnsupportedOperationException(f"{key_arn} is not a multi-region primary key.")
|
|
509
|
+
|
|
502
510
|
if key_id in replicate_to_store.keys:
|
|
503
511
|
raise AlreadyExistsException(
|
|
504
512
|
f"Unable to replicate key {key_id} to region {replica_region}, as the key "
|
|
505
513
|
f"already exist there"
|
|
506
514
|
)
|
|
507
|
-
replica_key = copy.deepcopy(
|
|
515
|
+
replica_key = copy.deepcopy(primary_key)
|
|
508
516
|
replica_key.replicate_metadata(request, account_id, replica_region)
|
|
509
517
|
replicate_to_store.keys[key_id] = replica_key
|
|
510
518
|
|
|
511
|
-
self.update_primary_key_with_replica_keys(
|
|
519
|
+
self.update_primary_key_with_replica_keys(primary_key, replica_key, replica_region)
|
|
512
520
|
|
|
513
521
|
return ReplicateKeyResponse(ReplicaKeyMetadata=replica_key.metadata)
|
|
514
522
|
|
|
@@ -1408,9 +1416,7 @@ class KmsProvider(KmsApi, ServiceLifecycleHook):
|
|
|
1408
1416
|
if key.metadata["KeySpec"] != KeySpec.SYMMETRIC_DEFAULT:
|
|
1409
1417
|
raise UnsupportedOperationException()
|
|
1410
1418
|
if key.metadata["Origin"] == OriginType.EXTERNAL:
|
|
1411
|
-
raise
|
|
1412
|
-
f"{key.metadata['Arn']} origin is EXTERNAL which is not valid for this operation."
|
|
1413
|
-
)
|
|
1419
|
+
raise NotImplementedError("Rotation of imported keys is not supported yet.")
|
|
1414
1420
|
|
|
1415
1421
|
key.rotate_key_on_demand()
|
|
1416
1422
|
|
|
@@ -1542,7 +1548,7 @@ class KmsProvider(KmsApi, ServiceLifecycleHook):
|
|
|
1542
1548
|
"Member must have length less than or equal to 4096"
|
|
1543
1549
|
)
|
|
1544
1550
|
|
|
1545
|
-
def _validate_grant_request(self, data:
|
|
1551
|
+
def _validate_grant_request(self, data: dict):
|
|
1546
1552
|
if "KeyId" not in data or "GranteePrincipal" not in data or "Operations" not in data:
|
|
1547
1553
|
raise ValidationError("Grant ID, key ID and grantee principal must be specified")
|
|
1548
1554
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
4
|
from pathlib import Path
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import TypedDict
|
|
6
6
|
|
|
7
7
|
import localstack.services.cloudformation.provider_utils as util
|
|
8
8
|
from localstack.services.cloudformation.resource_provider import (
|
|
@@ -14,8 +14,8 @@ from localstack.services.cloudformation.resource_provider import (
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class KMSAliasProperties(TypedDict):
|
|
17
|
-
AliasName:
|
|
18
|
-
TargetKeyId:
|
|
17
|
+
AliasName: str | None
|
|
18
|
+
TargetKeyId: str | None
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
REPEATED_INVOCATION = "repeated_invocation"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional, Type
|
|
2
|
-
|
|
3
1
|
from localstack.services.cloudformation.resource_provider import (
|
|
4
2
|
CloudFormationResourceProviderPlugin,
|
|
5
3
|
ResourceProvider,
|
|
@@ -10,7 +8,7 @@ class KMSAliasProviderPlugin(CloudFormationResourceProviderPlugin):
|
|
|
10
8
|
name = "AWS::KMS::Alias"
|
|
11
9
|
|
|
12
10
|
def __init__(self):
|
|
13
|
-
self.factory:
|
|
11
|
+
self.factory: type[ResourceProvider] | None = None
|
|
14
12
|
|
|
15
13
|
def load(self):
|
|
16
14
|
from localstack.services.kms.resource_providers.aws_kms_alias import KMSAliasProvider
|
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
|
|
4
4
|
import json
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import
|
|
6
|
+
from typing import TypedDict
|
|
7
7
|
|
|
8
8
|
import localstack.services.cloudformation.provider_utils as util
|
|
9
9
|
from localstack.services.cloudformation.resource_provider import (
|
|
@@ -15,22 +15,22 @@ from localstack.services.cloudformation.resource_provider import (
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class KMSKeyProperties(TypedDict):
|
|
18
|
-
KeyPolicy:
|
|
19
|
-
Arn:
|
|
20
|
-
Description:
|
|
21
|
-
EnableKeyRotation:
|
|
22
|
-
Enabled:
|
|
23
|
-
KeyId:
|
|
24
|
-
KeySpec:
|
|
25
|
-
KeyUsage:
|
|
26
|
-
MultiRegion:
|
|
27
|
-
PendingWindowInDays:
|
|
28
|
-
Tags:
|
|
18
|
+
KeyPolicy: dict | str | None
|
|
19
|
+
Arn: str | None
|
|
20
|
+
Description: str | None
|
|
21
|
+
EnableKeyRotation: bool | None
|
|
22
|
+
Enabled: bool | None
|
|
23
|
+
KeyId: str | None
|
|
24
|
+
KeySpec: str | None
|
|
25
|
+
KeyUsage: str | None
|
|
26
|
+
MultiRegion: bool | None
|
|
27
|
+
PendingWindowInDays: int | None
|
|
28
|
+
Tags: list[Tag] | None
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class Tag(TypedDict):
|
|
32
|
-
Key:
|
|
33
|
-
Value:
|
|
32
|
+
Key: str | None
|
|
33
|
+
Value: str | None
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
REPEATED_INVOCATION = "repeated_invocation"
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import Optional, Type
|
|
2
|
-
|
|
3
1
|
from localstack.services.cloudformation.resource_provider import (
|
|
4
2
|
CloudFormationResourceProviderPlugin,
|
|
5
3
|
ResourceProvider,
|
|
@@ -10,7 +8,7 @@ class KMSKeyProviderPlugin(CloudFormationResourceProviderPlugin):
|
|
|
10
8
|
name = "AWS::KMS::Key"
|
|
11
9
|
|
|
12
10
|
def __init__(self):
|
|
13
|
-
self.factory:
|
|
11
|
+
self.factory: type[ResourceProvider] | None = None
|
|
14
12
|
|
|
15
13
|
def load(self):
|
|
16
14
|
from localstack.services.kms.resource_providers.aws_kms_key import KMSKeyProvider
|
localstack/services/kms/utils.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import re
|
|
2
|
-
from
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from typing import TypeVar
|
|
3
4
|
|
|
4
5
|
from localstack.aws.api.kms import DryRunOperationException, Tag, TagException
|
|
5
6
|
from localstack.services.kms.exceptions import ValidationException
|
|
@@ -8,7 +9,7 @@ from localstack.utils.aws.arns import ARN_PARTITION_REGEX
|
|
|
8
9
|
T = TypeVar("T")
|
|
9
10
|
|
|
10
11
|
KMS_KEY_ARN_PATTERN = re.compile(
|
|
11
|
-
rf"{ARN_PARTITION_REGEX}:kms:(?P<region_name>[^:]+):(?P<account_id>\d{{12}}):key
|
|
12
|
+
rf"{ARN_PARTITION_REGEX}:kms:(?P<region_name>[^:]+):(?P<account_id>\d{{12}}):((?=key/)key/|(?=alias/))(?P<key_id>[^:]+)$"
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
|
|
@@ -20,7 +21,7 @@ def get_hash_algorithm(signing_algorithm: str) -> str:
|
|
|
20
21
|
return "_".join(signing_algorithm.rsplit(sep="_", maxsplit=-2)[-2:])
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
def parse_key_arn(key_arn: str) ->
|
|
24
|
+
def parse_key_arn(key_arn: str) -> tuple[str, str, str]:
|
|
24
25
|
"""
|
|
25
26
|
Parse a valid KMS key arn into its constituents.
|
|
26
27
|
|
|
@@ -6,8 +6,9 @@ import datetime
|
|
|
6
6
|
import random
|
|
7
7
|
import re
|
|
8
8
|
import string
|
|
9
|
-
from typing import TYPE_CHECKING, Any
|
|
9
|
+
from typing import TYPE_CHECKING, Any
|
|
10
10
|
|
|
11
|
+
from localstack import config
|
|
11
12
|
from localstack.aws.api import CommonServiceException, RequestContext
|
|
12
13
|
from localstack.aws.api import lambda_ as api_spec
|
|
13
14
|
from localstack.aws.api.lambda_ import (
|
|
@@ -192,7 +193,7 @@ def map_csc(model: "CodeSigningConfig") -> api_spec.CodeSigningConfig:
|
|
|
192
193
|
)
|
|
193
194
|
|
|
194
195
|
|
|
195
|
-
def get_config_for_url(store: "LambdaStore", url_id: str) -> "
|
|
196
|
+
def get_config_for_url(store: "LambdaStore", url_id: str) -> "FunctionUrlConfig | None":
|
|
196
197
|
"""
|
|
197
198
|
Get a config object when resolving a URL
|
|
198
199
|
|
|
@@ -269,7 +270,7 @@ def function_locators_from_arn(arn: str) -> tuple[str | None, str | None, str |
|
|
|
269
270
|
return None, None, None, None
|
|
270
271
|
|
|
271
272
|
|
|
272
|
-
def get_account_and_region(function_arn_or_name: str, context: RequestContext) ->
|
|
273
|
+
def get_account_and_region(function_arn_or_name: str, context: RequestContext) -> tuple[str, str]:
|
|
273
274
|
"""
|
|
274
275
|
Takes a full ARN, partial ARN or a name. Returns account ID and region from ARN if available, else
|
|
275
276
|
falls back to context account ID and region.
|
|
@@ -345,11 +346,11 @@ def build_statement(
|
|
|
345
346
|
statement_id: str,
|
|
346
347
|
action: str,
|
|
347
348
|
principal: str,
|
|
348
|
-
source_arn:
|
|
349
|
-
source_account:
|
|
350
|
-
principal_org_id:
|
|
351
|
-
event_source_token:
|
|
352
|
-
auth_type:
|
|
349
|
+
source_arn: str | None = None,
|
|
350
|
+
source_account: str | None = None,
|
|
351
|
+
principal_org_id: str | None = None,
|
|
352
|
+
event_source_token: str | None = None,
|
|
353
|
+
auth_type: FunctionUrlAuthType | None = None,
|
|
353
354
|
) -> dict[str, Any]:
|
|
354
355
|
statement = {
|
|
355
356
|
"Sid": statement_id,
|
|
@@ -377,7 +378,7 @@ def build_statement(
|
|
|
377
378
|
Type="User",
|
|
378
379
|
)
|
|
379
380
|
|
|
380
|
-
condition =
|
|
381
|
+
condition = {}
|
|
381
382
|
if auth_type:
|
|
382
383
|
update = {"StringEquals": {"lambda:FunctionUrlAuthType": auth_type}}
|
|
383
384
|
condition = merge_recursive(condition, update)
|
|
@@ -425,7 +426,7 @@ def unqualified_lambda_arn(function_name: str, account: str, region: str):
|
|
|
425
426
|
|
|
426
427
|
|
|
427
428
|
def qualified_lambda_arn(
|
|
428
|
-
function_name: str, qualifier:
|
|
429
|
+
function_name: str, qualifier: str | None, account: str, region: str
|
|
429
430
|
) -> str:
|
|
430
431
|
"""
|
|
431
432
|
Generate a qualified lambda arn
|
|
@@ -440,7 +441,7 @@ def qualified_lambda_arn(
|
|
|
440
441
|
return f"{unqualified_lambda_arn(function_name=function_name, account=account, region=region)}:{qualifier}"
|
|
441
442
|
|
|
442
443
|
|
|
443
|
-
def lambda_arn(function_name: str, qualifier:
|
|
444
|
+
def lambda_arn(function_name: str, qualifier: str | None, account: str, region: str) -> str:
|
|
444
445
|
"""
|
|
445
446
|
Return the lambda arn for the given parameters, with a qualifier if supplied, without otherwise
|
|
446
447
|
|
|
@@ -637,7 +638,7 @@ def map_alias_out(alias: "VersionAlias", function: "Function") -> AliasConfigura
|
|
|
637
638
|
)
|
|
638
639
|
|
|
639
640
|
|
|
640
|
-
def validate_and_set_batch_size(service: str, batch_size:
|
|
641
|
+
def validate_and_set_batch_size(service: str, batch_size: int | None = None) -> int:
|
|
641
642
|
min_batch_size = 1
|
|
642
643
|
|
|
643
644
|
BATCH_SIZE_RANGES = {
|
|
@@ -665,7 +666,9 @@ def validate_and_set_batch_size(service: str, batch_size: Optional[int] = None)
|
|
|
665
666
|
def map_layer_out(layer_version: "LayerVersion") -> PublishLayerVersionResponse:
|
|
666
667
|
return PublishLayerVersionResponse(
|
|
667
668
|
Content=LayerVersionContentOutput(
|
|
668
|
-
Location=layer_version.code.generate_presigned_url(
|
|
669
|
+
Location=layer_version.code.generate_presigned_url(
|
|
670
|
+
endpoint_url=config.external_service_url()
|
|
671
|
+
),
|
|
669
672
|
CodeSha256=layer_version.code.code_sha256,
|
|
670
673
|
CodeSize=layer_version.code.code_size,
|
|
671
674
|
# SigningProfileVersionArn="", # same as in function configuration
|
|
@@ -690,7 +693,7 @@ def layer_version_arn(layer_name: str, account: str, region: str, version: str):
|
|
|
690
693
|
return f"arn:{get_partition(region)}:lambda:{region}:{account}:layer:{layer_name}:{version}"
|
|
691
694
|
|
|
692
695
|
|
|
693
|
-
def parse_layer_arn(layer_version_arn: str) ->
|
|
696
|
+
def parse_layer_arn(layer_version_arn: str) -> tuple[str, str, str, str]:
|
|
694
697
|
return LAYER_VERSION_ARN_PATTERN.match(layer_version_arn).group(
|
|
695
698
|
"region_name", "account_id", "layer_name", "layer_version"
|
|
696
699
|
)
|
|
@@ -715,12 +718,12 @@ def validate_layer_runtimes_and_architectures(
|
|
|
715
718
|
|
|
716
719
|
if compatible_runtimes and set(compatible_runtimes).difference(ALL_RUNTIMES):
|
|
717
720
|
constraint = f"Member must satisfy enum value set: {VALID_RUNTIMES}"
|
|
718
|
-
validation_msg = f"Value '[{', '.join(
|
|
721
|
+
validation_msg = f"Value '[{', '.join(list(compatible_runtimes))}]' at 'compatibleRuntimes' failed to satisfy constraint: {constraint}"
|
|
719
722
|
validations.append(validation_msg)
|
|
720
723
|
|
|
721
724
|
if compatible_architectures and set(compatible_architectures).difference(ARCHITECTURES):
|
|
722
725
|
constraint = "[Member must satisfy enum value set: [x86_64, arm64]]"
|
|
723
|
-
validation_msg = f"Value '[{', '.join(
|
|
726
|
+
validation_msg = f"Value '[{', '.join(list(compatible_architectures))}]' at 'compatibleArchitectures' failed to satisfy constraint: Member must satisfy constraint: {constraint}"
|
|
724
727
|
validations.append(validation_msg)
|
|
725
728
|
|
|
726
729
|
return validations
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import urllib.parse
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import TypedDict
|
|
3
3
|
|
|
4
4
|
from rolo import Request, route
|
|
5
5
|
|
|
@@ -14,7 +14,7 @@ from localstack.services.lambda_.runtimes import (
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class LambdaRuntimesResponse(TypedDict, total=False):
|
|
17
|
-
Runtimes:
|
|
17
|
+
Runtimes: list[Runtime]
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class LambdaCustomEndpoints:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from
|
|
1
|
+
from collections.abc import Callable
|
|
2
2
|
|
|
3
3
|
import botocore.config
|
|
4
4
|
|
|
@@ -18,6 +18,7 @@ from localstack.aws.api.pipes import (
|
|
|
18
18
|
PipeTargetParameters,
|
|
19
19
|
)
|
|
20
20
|
from localstack.services.lambda_ import hooks as lambda_hooks
|
|
21
|
+
from localstack.services.lambda_ import ldm
|
|
21
22
|
from localstack.services.lambda_.event_source_mapping.esm_event_processor import (
|
|
22
23
|
EsmEventProcessor,
|
|
23
24
|
)
|
|
@@ -37,10 +38,6 @@ from localstack.services.lambda_.event_source_mapping.pollers.sqs_poller import
|
|
|
37
38
|
SqsPoller,
|
|
38
39
|
)
|
|
39
40
|
from localstack.services.lambda_.event_source_mapping.senders.lambda_sender import LambdaSender
|
|
40
|
-
from localstack.services.lambda_.lambda_debug_mode.ldm import (
|
|
41
|
-
DEFAULT_LAMBDA_DEBUG_MODE_TIMEOUT_SECONDS,
|
|
42
|
-
LDM,
|
|
43
|
-
)
|
|
44
41
|
from localstack.utils.aws.arns import parse_arn
|
|
45
42
|
from localstack.utils.aws.client_types import ServicePrincipal
|
|
46
43
|
|
|
@@ -65,8 +62,8 @@ class EsmWorkerFactory:
|
|
|
65
62
|
# Sender (always Lambda)
|
|
66
63
|
function_arn = self.esm_config["FunctionArn"]
|
|
67
64
|
|
|
68
|
-
if
|
|
69
|
-
timeout_seconds =
|
|
65
|
+
if ldm.IS_LDM_ENABLED:
|
|
66
|
+
timeout_seconds = ldm.DEFAULT_LDM_TIMEOUT_SECONDS
|
|
70
67
|
else:
|
|
71
68
|
# 900s is the maximum amount of time a Lambda can run for.
|
|
72
69
|
lambda_max_timeout_seconds = 900
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from datetime import
|
|
2
|
+
from datetime import UTC, datetime
|
|
3
3
|
|
|
4
4
|
import botocore
|
|
5
5
|
from botocore.client import BaseClient
|
|
@@ -57,7 +57,7 @@ def get_standardized_service_name(service_name: str) -> str:
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
def get_current_time() -> datetime:
|
|
60
|
-
return datetime.now(tz=
|
|
60
|
+
return datetime.now(tz=UTC)
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
def get_datetime_from_timestamp(timestamp: float) -> datetime:
|
|
@@ -4,8 +4,8 @@ import threading
|
|
|
4
4
|
from abc import abstractmethod
|
|
5
5
|
from bisect import bisect_left
|
|
6
6
|
from collections import defaultdict
|
|
7
|
+
from collections.abc import Iterator
|
|
7
8
|
from datetime import datetime
|
|
8
|
-
from typing import Iterator
|
|
9
9
|
|
|
10
10
|
from botocore.client import BaseClient
|
|
11
11
|
from botocore.exceptions import ClientError
|
|
@@ -2,19 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
from localstack.runtime.hooks import hook_spec
|
|
4
4
|
|
|
5
|
+
HOOKS_LAMBDA_CREATE_FUNCTION_VERSION = "localstack.hooks.lambda_create_function_version"
|
|
6
|
+
HOOKS_LAMBDA_DELETE_FUNCTION_VERSION = "localstack.hooks.lambda_delete_function_version"
|
|
5
7
|
HOOKS_LAMBDA_START_DOCKER_EXECUTOR = "localstack.hooks.lambda_start_docker_executor"
|
|
6
8
|
HOOKS_LAMBDA_PREPARE_DOCKER_EXECUTOR = "localstack.hooks.lambda_prepare_docker_executors"
|
|
7
9
|
HOOKS_LAMBDA_INJECT_LAYER_FETCHER = "localstack.hooks.lambda_inject_layer_fetcher"
|
|
10
|
+
HOOKS_LAMBDA_INJECT_LDM_PROVISIONER = "localstack.hooks.lambda_inject_ldm_provisioner"
|
|
8
11
|
HOOKS_LAMBDA_PREBUILD_ENVIRONMENT_IMAGE = "localstack.hooks.lambda_prebuild_environment_image"
|
|
9
12
|
HOOKS_LAMBDA_CREATE_EVENT_SOURCE_POLLER = "localstack.hooks.lambda_create_event_source_poller"
|
|
10
13
|
HOOKS_LAMBDA_SET_EVENT_SOURCE_CONFIG_DEFAULTS = (
|
|
11
14
|
"localstack.hooks.lambda_set_event_source_config_defaults"
|
|
12
15
|
)
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
create_function_version = hook_spec(HOOKS_LAMBDA_CREATE_FUNCTION_VERSION)
|
|
18
|
+
delete_function_version = hook_spec(HOOKS_LAMBDA_DELETE_FUNCTION_VERSION)
|
|
15
19
|
start_docker_executor = hook_spec(HOOKS_LAMBDA_START_DOCKER_EXECUTOR)
|
|
16
20
|
prepare_docker_executor = hook_spec(HOOKS_LAMBDA_PREPARE_DOCKER_EXECUTOR)
|
|
17
21
|
inject_layer_fetcher = hook_spec(HOOKS_LAMBDA_INJECT_LAYER_FETCHER)
|
|
22
|
+
inject_ldm_provisioner = hook_spec(HOOKS_LAMBDA_INJECT_LDM_PROVISIONER)
|
|
18
23
|
prebuild_environment_image = hook_spec(HOOKS_LAMBDA_PREBUILD_ENVIRONMENT_IMAGE)
|
|
19
24
|
create_event_source_poller = hook_spec(HOOKS_LAMBDA_CREATE_EVENT_SOURCE_POLLER)
|
|
20
25
|
set_event_source_config_defaults = hook_spec(HOOKS_LAMBDA_SET_EVENT_SOURCE_CONFIG_DEFAULTS)
|
|
@@ -2,7 +2,6 @@ import contextlib
|
|
|
2
2
|
import logging
|
|
3
3
|
from collections import defaultdict
|
|
4
4
|
from concurrent.futures import Future, ThreadPoolExecutor
|
|
5
|
-
from typing import ContextManager
|
|
6
5
|
|
|
7
6
|
from localstack.services.lambda_.invocation.execution_environment import (
|
|
8
7
|
EnvironmentStartupTimeoutException,
|
|
@@ -44,7 +43,7 @@ class AssignmentService(OtherServiceEndpoint):
|
|
|
44
43
|
version_manager_id: str,
|
|
45
44
|
function_version: FunctionVersion,
|
|
46
45
|
provisioning_type: InitializationType,
|
|
47
|
-
) ->
|
|
46
|
+
) -> contextlib.AbstractContextManager[ExecutionEnvironment]:
|
|
48
47
|
applicable_envs = (
|
|
49
48
|
env
|
|
50
49
|
for env in self.environments[version_manager_id].values()
|
|
@@ -5,8 +5,9 @@ import shutil
|
|
|
5
5
|
import tempfile
|
|
6
6
|
import threading
|
|
7
7
|
from collections import defaultdict
|
|
8
|
+
from collections.abc import Callable
|
|
8
9
|
from pathlib import Path
|
|
9
|
-
from typing import
|
|
10
|
+
from typing import Literal
|
|
10
11
|
|
|
11
12
|
from localstack import config
|
|
12
13
|
from localstack.aws.api.lambda_ import Architecture, PackageType, Runtime
|
|
@@ -23,7 +24,6 @@ from localstack.services.lambda_.invocation.runtime_executor import (
|
|
|
23
24
|
LambdaRuntimeException,
|
|
24
25
|
RuntimeExecutor,
|
|
25
26
|
)
|
|
26
|
-
from localstack.services.lambda_.lambda_debug_mode.ldm import LDM_ENV_VAR_DEBUG_PORT
|
|
27
27
|
from localstack.services.lambda_.lambda_utils import HINT_LOG
|
|
28
28
|
from localstack.services.lambda_.networking import (
|
|
29
29
|
get_all_container_networks_for_lambda,
|
|
@@ -146,7 +146,7 @@ class RuntimeImageResolver:
|
|
|
146
146
|
def __init__(
|
|
147
147
|
self, default_resolve_fn: Callable[[Runtime], str] = get_default_image_for_runtime
|
|
148
148
|
):
|
|
149
|
-
self._mapping =
|
|
149
|
+
self._mapping = {}
|
|
150
150
|
self._default_resolve_fn = default_resolve_fn
|
|
151
151
|
|
|
152
152
|
def _resolve(self, runtime: Runtime, custom_image_mapping: str = "") -> str:
|
|
@@ -275,12 +275,12 @@ class LambdaContainerConfiguration(ContainerConfiguration):
|
|
|
275
275
|
|
|
276
276
|
|
|
277
277
|
class DockerRuntimeExecutor(RuntimeExecutor):
|
|
278
|
-
ip:
|
|
279
|
-
executor_endpoint:
|
|
278
|
+
ip: str | None
|
|
279
|
+
executor_endpoint: ExecutorEndpoint | None
|
|
280
280
|
container_name: str
|
|
281
281
|
|
|
282
282
|
def __init__(self, id: str, function_version: FunctionVersion) -> None:
|
|
283
|
-
super(
|
|
283
|
+
super().__init__(id=id, function_version=function_version)
|
|
284
284
|
self.ip = None
|
|
285
285
|
self.executor_endpoint = ExecutorEndpoint(self.id)
|
|
286
286
|
self.container_name = self._generate_container_name()
|
|
@@ -376,10 +376,6 @@ class DockerRuntimeExecutor(RuntimeExecutor):
|
|
|
376
376
|
container_config.ports = PortMappings()
|
|
377
377
|
container_config.ports.add(config.LAMBDA_INIT_DELVE_PORT, config.LAMBDA_INIT_DELVE_PORT)
|
|
378
378
|
|
|
379
|
-
if ldm_debug_port := env_vars.get(LDM_ENV_VAR_DEBUG_PORT):
|
|
380
|
-
ldm_debug_port = int(ldm_debug_port)
|
|
381
|
-
container_config.ports.add(ldm_debug_port, ldm_debug_port)
|
|
382
|
-
|
|
383
379
|
if (
|
|
384
380
|
self.function_version.config.layers
|
|
385
381
|
and not config.LAMBDA_PREBUILD_IMAGES
|
|
@@ -460,7 +456,7 @@ class DockerRuntimeExecutor(RuntimeExecutor):
|
|
|
460
456
|
def _get_networks_for_executor(self) -> list[str]:
|
|
461
457
|
return get_all_container_networks_for_lambda()
|
|
462
458
|
|
|
463
|
-
def invoke(self, payload:
|
|
459
|
+
def invoke(self, payload: dict[str, str]):
|
|
464
460
|
LOG.debug(
|
|
465
461
|
"Sending invoke-payload '%s' to executor '%s'",
|
|
466
462
|
truncate(json.dumps(payload), config.LAMBDA_TRUNCATE_STDOUT),
|
|
@@ -42,7 +42,7 @@ def get_sqs_client(function_version: FunctionVersion, client_config=None):
|
|
|
42
42
|
# TODO: remove once DLQ handling is refactored following the removal of the legacy lambda provider
|
|
43
43
|
class LegacyInvocationException(Exception):
|
|
44
44
|
def __init__(self, message, log_output=None, result=None):
|
|
45
|
-
super(
|
|
45
|
+
super().__init__(message)
|
|
46
46
|
self.log_output = log_output
|
|
47
47
|
self.result = result
|
|
48
48
|
|