Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.
Python awsaws-emulatoraws-localaws-sdkdevtoolsdockerdynamodbec2emulatorlambdalocalstacklocalstack-alternativeministackmock-awsopen-sourcepythons3sqsterraform
Feat/sns subscribe attrs v1.1.18 (#74)
Nahuel Nucera796846e1fedd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 23598229..3d21c743 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,14 +7,38 @@ Versioning follows [Semantic Versioning](https://semver.org/).----## [1.1.17] — 2026-04-02+## [1.1.18] — 2026-04-02### Added- **EC2 `DescribeInstanceCreditSpecifications`** — returns `standard` CPU credits; fixes Terraform v6 provider compatibility-- **EC2 Terraform v6 stubs** — `DescribeInstanceMaintenanceOptions`, `DescribeInstanceAutoRecoveryAttribute`, `ModifyInstanceMaintenanceOptions`, `DescribeInstanceTopology`, `DescribeSpotInstanceRequests`, `DescribeCapacityReservations` all return sensible empty/default responses to prevent Terraform v6 from failing on unknown actions+- **EC2 Terraform v6 stubs** — `DescribeInstanceMaintenanceOptions`, `DescribeInstanceAutoRecoveryAttribute`, `ModifyInstanceMaintenanceOptions`, `DescribeInstanceTopology`, `DescribeSpotInstanceRequests`, `DescribeCapacityReservations` all return sensible empty/default responses+- **Lambda Node.js warm worker pool** — Node.js functions now use the same persistent warm worker as Python; supports async/await, Promise, and callback handlers; AWS SDK v2 endpoint patching for local development+- **Docker image includes Node.js** — `nodejs` added to Alpine base image so container-based Node.js Lambda execution works out of the box in Docker Compose / CI environments+- **Lambda S3 code fetch** — `CreateFunction` and `UpdateFunctionCode` now accept `S3Bucket`/`S3Key` in addition to `ZipFile`; returns error if S3 object not found+- **Lambda versioning** — `Publish=True` on `CreateFunction` and `UpdateFunctionCode` now creates immutable numbered versions with their own `code_zip`+- **DynamoDB Streams** — `StreamSpecification` on `CreateTable` now emits INSERT/MODIFY/REMOVE records on all write operations (`PutItem`, `UpdateItem`, `DeleteItem`, `BatchWriteItem`, `TransactWriteItems`); respects `StreamViewType`+- **Kinesis ESM polling** — Lambda event source mappings now support Kinesis streams in addition to SQS++### Fixed+- **SNS `Subscribe` ignores `Attributes` parameter** — `RawMessageDelivery`, `FilterPolicy`, `FilterPolicyScope`, `DeliveryPolicy`, and `RedrivePolicy` passed at subscription creation time are now applied immediately+- **Lambda warm worker not invalidated on code update** — `UpdateFunctionCode` and `DeleteFunction` now invalidate the warm worker pool so the next invocation picks up the new code+- **Lambda module-level imports** — removed lazy `from ministack.core.lambda_runtime import` inside functions; moved to module top level+- **S3 chunked transfer encoding** — AWS SDK v2 sends `PutObject` with `STREAMING-AWS4-HMAC-SHA256-PAYLOAD` chunked encoding; body was stored with chunk headers causing corrupt `GetObject` responses; now decoded before storage+- **Kinesis validation limits** — `PutRecord` and `PutRecords` now enforce AWS limits: max 1 MB per record, max 500 records per batch, max 5 MB total payload, max 256-char partition key+- **S3 Control routing via `s3-control.localhost` host** — requests with host header `s3-control.localhost` were intercepted by the S3 virtual-hosted bucket handler instead of reaching the S3 Control API; fixes Terraform `ListTagsForResource` returning 404 `NoSuchResource`+- **EC2 security group rule deduplication** — `AuthorizeSecurityGroupIngress/Egress` no longer appends duplicate rules; fixes Terraform showing constant drift+- **EC2 default egress rule on created security groups** — non-default security groups now include the standard allow-all egress rule matching AWS behaviour+- **EC2 VPC Peering missing Region field** — `requesterVpcInfo` and `accepterVpcInfo` now include `<region>` in all responses; fixes Terraform failing to parse peering connections+- **Lambda `PublishVersion` FunctionArn** — no longer appends version number to FunctionArn (version is in the Version field); fixes Terraform ARN comparison drift+- **Lambda `FunctionUrlConfig` hardcoded region** — now uses `MINISTACK_REGION` instead of hardcoded `us-east-1`+- **Lambda handler validation** — returns proper `Runtime.InvalidEntrypoint` error if handler name has no `.` separator instead of crashing+- **RDS error code** — `DBInstanceAlreadyExists` corrected to `DBInstanceAlreadyExistsFault` matching AWS error codes++- Thanks to @lubond @jimmyd-be @abedurftig @mig_mit for reporting issues and testing+- Thanks to @jv2222 and @santiagodoldan for their massive contributions### Tests-- 818 tests total, all passing+- 834 tests total, all passing---diff --git a/Dockerfile b/Dockerfileindex 8736cc3d..c3a26c44 100644--- a/Dockerfile+++ b/Dockerfile@@ -4,7 +4,7 @@ LABEL maintainer="MiniStack" \description="Local AWS Service Emulator — drop-in LocalStack replacement"# Upgrade base packages to pick up latest security patches.-RUN apk upgrade --no-cache && rm -f /usr/bin/wget /bin/wget+RUN apk upgrade --no-cache && apk add --no-cache nodejs && rm -f /usr/bin/wget /bin/wgetWORKDIR /opt/ministackdiff --git a/README.md b/README.mdindex 1e80bfc3..ddd490a6 100644--- a/README.md+++ b/README.md@@ -47,7 +47,7 @@ cd ministackdocker compose up -d# Verify (any option)-curl http://localhost:4566/_localstack/health+curl http://localhost:4566/_ministack/health```That's it. No account, no API key, no sign-up.@@ -201,8 +201,8 @@ subnet = ec2.create_subnet(| **S3** | CreateBucket, DeleteBucket, ListBuckets, HeadBucket, PutObject, GetObject, DeleteObject, HeadObject, CopyObject, ListObjects v1/v2, DeleteObjects, GetBucketVersioning, PutBucketVersioning, GetBucketEncryption, PutBucketEncryption, DeleteBucketEncryption, GetBucketLifecycleConfiguration, PutBucketLifecycleConfiguration, DeleteBucketLifecycle, GetBucketCors, PutBucketCors, DeleteBucketCors, GetBucketAcl, PutBucketAcl, GetBucketTagging, PutBucketTagging, DeleteBucketTagging, GetBucketPolicy, PutBucketPolicy, DeleteBucketPolicy, GetBucketNotificationConfiguration, PutBucketNotificationConfiguration, GetBucketLogging, PutBucketLogging, ListObjectVersions, CreateMultipartUpload, UploadPart, CompleteMultipartUpload, AbortMultipartUpload, PutObjectLockConfiguration, GetObjectLockConfiguration, PutObjectRetention, GetObjectRetention, PutObjectLegalHold, GetObjectLegalHold, PutBucketReplication, GetBucketReplication, DeleteBucketReplication | Optional disk persistence via `S3_PERSIST=1`; Object Lock with retention & legal hold enforcement on delete || **SQS** | CreateQueue, DeleteQueue, ListQueues, GetQueueUrl, GetQueueAttributes, SetQueueAttributes, PurgeQueue, SendMessage, ReceiveMessage, DeleteMessage, ChangeMessageVisibility, ChangeMessageVisibilityBatch, SendMessageBatch, DeleteMessageBatch, TagQueue, UntagQueue, ListQueueTags | Both Query API and JSON protocol; FIFO queues with deduplication; DLQ support || **SNS** | CreateTopic, DeleteTopic, ListTopics, GetTopicAttributes, SetTopicAttributes, Subscribe, Unsubscribe, ListSubscriptions, ListSubscriptionsByTopic, GetSubscriptionAttributes, SetSubscriptionAttributes, ConfirmSubscription, Publish, PublishBatch, TagResource, UntagResource, ListTagsForResource, CreatePlatformApplication, CreatePlatformEndpoint | SNS→SQS fanout delivery; SNS→Lambda fanout (synchronous invocation) |-| **DynamoDB** | CreateTable, UpdateTable, DeleteTable, DescribeTable, ListTables, PutItem, GetItem, DeleteItem, UpdateItem, Query, Scan, BatchWriteItem, BatchGetItem, TransactWriteItems, TransactGetItems, DescribeTimeToLive, UpdateTimeToLive, DescribeContinuousBackups, UpdateContinuousBackups, DescribeEndpoints, TagResource, UntagResource, ListTagsOfResource | TTL enforced via thread-safe background reaper (60s cadence) |-| **Lambda** | CreateFunction, DeleteFunction, GetFunction, ListFunctions, Invoke, UpdateFunctionCode, UpdateFunctionConfiguration, AddPermission, RemovePermission, ListVersionsByFunction, PublishVersion, TagResource, UntagResource, ListTags, CreateEventSourceMapping, DeleteEventSourceMapping, GetEventSourceMapping, ListEventSourceMappings, UpdateEventSourceMapping, CreateFunctionUrlConfig, GetFunctionUrlConfig, UpdateFunctionUrlConfig, DeleteFunctionUrlConfig, ListFunctionUrlConfigs, PublishLayerVersion, GetLayerVersion, ListLayerVersions, DeleteLayerVersion, ListLayers | Python runtimes execute with warm worker pool; Node.js runtimes (`nodejs14.x`–`nodejs22.x`) execute via local `node` subprocess or Docker; SQS event source mapping; Function URL CRUD; Lambda Layers CRUD |+| **DynamoDB** | CreateTable, UpdateTable, DeleteTable, DescribeTable, ListTables, PutItem, GetItem, DeleteItem, UpdateItem, Query, Scan, BatchWriteItem, BatchGetItem, TransactWriteItems, TransactGetItems, DescribeTimeToLive, UpdateTimeToLive, DescribeContinuousBackups, UpdateContinuousBackups, DescribeEndpoints, TagResource, UntagResource, ListTagsOfResource | TTL enforced via thread-safe background reaper (60s cadence); DynamoDB Streams — `StreamSpecification` emits INSERT/MODIFY/REMOVE records on all write operations, respects `StreamViewType` |+| **Lambda** | CreateFunction, DeleteFunction, GetFunction, ListFunctions, Invoke, UpdateFunctionCode, UpdateFunctionConfiguration, AddPermission, RemovePermission, ListVersionsByFunction, PublishVersion, TagResource, UntagResource, ListTags, CreateEventSourceMapping, DeleteEventSourceMapping, GetEventSourceMapping, ListEventSourceMappings, UpdateEventSourceMapping, CreateFunctionUrlConfig, GetFunctionUrlConfig, UpdateFunctionUrlConfig, DeleteFunctionUrlConfig, ListFunctionUrlConfigs, PublishLayerVersion, GetLayerVersion, ListLayerVersions, DeleteLayerVersion, ListLayers | Python and Node.js runtimes execute with warm worker pool; `Publish=True` creates immutable numbered versions; Code via `ZipFile` or `S3Bucket`/`S3Key`; SQS, Kinesis, and DynamoDB Streams event source mappings; Function URL CRUD; Lambda Layers CRUD || **IAM** | CreateUser, GetUser, ListUsers, DeleteUser, CreateRole, GetRole, ListRoles, DeleteRole, CreatePolicy, GetPolicy, DeletePolicy, AttachRolePolicy, DetachRolePolicy, PutRolePolicy, GetRolePolicy, DeleteRolePolicy, ListRolePolicies, ListAttachedRolePolicies, CreateAccessKey, ListAccessKeys, DeleteAccessKey, CreateInstanceProfile, GetInstanceProfile, DeleteInstanceProfile, AddRoleToInstanceProfile, RemoveRoleFromInstanceProfile, ListInstanceProfiles, CreateGroup, GetGroup, AddUserToGroup, RemoveUserFromGroup, CreateServiceLinkedRole, CreateOpenIDConnectProvider, TagRole, UntagRole, TagUser, UntagUser, TagPolicy, UntagPolicy | || **STS** | GetCallerIdentity, AssumeRole, GetSessionToken, AssumeRoleWithWebIdentity | || **SecretsManager** | CreateSecret, GetSecretValue, ListSecrets, DeleteSecret, UpdateSecret, DescribeSecret, PutSecretValue, RestoreSecret, RotateSecret, GetRandomPassword, ListSecretVersionIds, TagResource, UntagResource, PutResourcePolicy, GetResourcePolicy, DeleteResourcePolicy, ValidateResourcePolicy | |@@ -214,7 +214,7 @@ subnet = ec2.create_subnet(|---------|-----------|-------|| **SSM Parameter Store** | PutParameter, GetParameter, GetParameters, GetParametersByPath, DeleteParameter, DeleteParameters, DescribeParameters, GetParameterHistory, LabelParameterVersion, AddTagsToResource, RemoveTagsFromResource, ListTagsForResource | Supports String, SecureString, StringList || **EventBridge** | CreateEventBus, DeleteEventBus, ListEventBuses, PutRule, DeleteRule, ListRules, DescribeRule, EnableRule, DisableRule, PutTargets, RemoveTargets, ListTargetsByRule, PutEvents, TagResource, UntagResource, ListTagsForResource, CreateArchive, DeleteArchive, DescribeArchive, ListArchives, PutPermission, RemovePermission, CreateConnection, DescribeConnection, DeleteConnection, ListConnections, CreateApiDestination, DescribeApiDestination, DeleteApiDestination, ListApiDestinations | Lambda target dispatch on PutEvents |-| **Kinesis** | CreateStream, DeleteStream, DescribeStream, ListStreams, ListShards, PutRecord, PutRecords, GetShardIterator, GetRecords, MergeShards, SplitShard, UpdateShardCount, StartStreamEncryption, StopStreamEncryption, EnableEnhancedMonitoring, DisableEnhancedMonitoring, RegisterStreamConsumer, DeregisterStreamConsumer, ListStreamConsumers, DescribeStreamConsumer, AddTagsToStream, RemoveTagsFromStream, ListTagsForStream | Partition key → shard routing |+| **Kinesis** | CreateStream, DeleteStream, DescribeStream, ListStreams, ListShards, PutRecord, PutRecords, GetShardIterator, GetRecords, MergeShards, SplitShard, UpdateShardCount, StartStreamEncryption, StopStreamEncryption, EnableEnhancedMonitoring, DisableEnhancedMonitoring, RegisterStreamConsumer, DeregisterStreamConsumer, ListStreamConsumers, DescribeStreamConsumer, AddTagsToStream, RemoveTagsFromStream, ListTagsForStream | Partition key → shard routing; AWS limits enforced (1 MB/record, 500 records/batch, 5 MB payload, 256-char partition key) || **CloudWatch Metrics** | PutMetricData, GetMetricStatistics, GetMetricData, ListMetrics, PutMetricAlarm, PutCompositeAlarm, DescribeAlarms, DescribeAlarmsForMetric, DescribeAlarmHistory, DeleteAlarms, SetAlarmState, EnableAlarmActions, DisableAlarmActions, TagResource, UntagResource, ListTagsForResource, PutDashboard, GetDashboard, DeleteDashboards, ListDashboards | CBOR and JSON protocol || **SES** | SendEmail, SendRawEmail, SendTemplatedEmail, SendBulkTemplatedEmail, VerifyEmailIdentity, VerifyEmailAddress, VerifyDomainIdentity, VerifyDomainDkim, ListIdentities, GetIdentityVerificationAttributes, GetIdentityDkimAttributes, DeleteIdentity, GetSendQuota, GetSendStatistics, CreateConfigurationSet, DeleteConfigurationSet, DescribeConfigurationSet, ListConfigurationSets, CreateTemplate, GetTemplate, UpdateTemplate, DeleteTemplate, ListTemplates | Emails stored in-memory, not sent || **SES v2** | SendEmail, CreateEmailIdentity, GetEmailIdentity, DeleteEmailIdentity, ListEmailIdentities, CreateConfigurationSet, GetConfigurationSet, DeleteConfigurationSet, ListConfigurationSets, GetAccount, PutAccountSuppressionAttributes, ListSuppressedDestinations | REST API (`/v2/email/`); identities auto-verified; emails stored in-memory, not sent |@@ -270,7 +270,7 @@ Unsupported resource types fail with `CREATE_FAILED` (or `ROLLBACK_COMPLETE` if| **Athena** | StartQueryExecution, GetQueryExecution, GetQueryResults, StopQueryExecution, ListQueryExecutions, BatchGetQueryExecution, CreateWorkGroup, DeleteWorkGroup, GetWorkGroup, ListWorkGroups, UpdateWorkGroup, CreateNamedQuery, DeleteNamedQuery, GetNamedQuery, ListNamedQueries, BatchGetNamedQuery, CreateDataCatalog, GetDataCatalog, ListDataCatalogs, DeleteDataCatalog, UpdateDataCatalog, CreatePreparedStatement, GetPreparedStatement, DeletePreparedStatement, ListPreparedStatements, GetTableMetadata, ListTableMetadata, TagResource, UntagResource, ListTagsForResource | Real SQL via **DuckDB** when installed (`pip install duckdb`), otherwise returns mock results; result pagination; column type metadata || **Firehose** | CreateDeliveryStream, DeleteDeliveryStream, DescribeDeliveryStream, ListDeliveryStreams, PutRecord, PutRecordBatch, UpdateDestination, TagDeliveryStream, UntagDeliveryStream, ListTagsForDeliveryStream, StartDeliveryStreamEncryption, StopDeliveryStreamEncryption | S3 destinations write records to the local S3 emulator; all other destination types buffer in-memory; concurrency-safe `UpdateDestination` via `VersionId` || **Route53** | CreateHostedZone, GetHostedZone, DeleteHostedZone, ListHostedZones, ListHostedZonesByName, UpdateHostedZoneComment, ChangeResourceRecordSets (CREATE/UPSERT/DELETE), ListResourceRecordSets, GetChange, CreateHealthCheck, GetHealthCheck, DeleteHealthCheck, ListHealthChecks, UpdateHealthCheck, ChangeTagsForResource, ListTagsForResource | REST/XML protocol; SOA + NS records auto-created; CallerReference idempotency; alias records, weighted/failover/latency routing; marker-based pagination |-| **EC2** | RunInstances, DescribeInstances, TerminateInstances, StopInstances, StartInstances, RebootInstances, DescribeImages, CreateSecurityGroup, DeleteSecurityGroup, DescribeSecurityGroups, AuthorizeSecurityGroupIngress, RevokeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress, CreateKeyPair, DeleteKeyPair, DescribeKeyPairs, ImportKeyPair, CreateVpc, DeleteVpc, DescribeVpcs, ModifyVpcAttribute, CreateSubnet, DeleteSubnet, DescribeSubnets, ModifySubnetAttribute, CreateInternetGateway, DeleteInternetGateway, DescribeInternetGateways, AttachInternetGateway, DetachInternetGateway, CreateRouteTable, DeleteRouteTable, DescribeRouteTables, AssociateRouteTable, DisassociateRouteTable, CreateRoute, ReplaceRoute, DeleteRoute, CreateNetworkInterface, DeleteNetworkInterface, DescribeNetworkInterfaces, AttachNetworkInterface, DetachNetworkInterface, CreateVpcEndpoint, DeleteVpcEndpoints, DescribeVpcEndpoints, DescribeAvailabilityZones, AllocateAddress, ReleaseAddress, AssociateAddress, DisassociateAddress, DescribeAddresses, CreateTags, DeleteTags, DescribeTags, CreateNatGateway, DescribeNatGateways, DeleteNatGateway, CreateNetworkAcl, DescribeNetworkAcls, DeleteNetworkAcl, CreateNetworkAclEntry, DeleteNetworkAclEntry, ReplaceNetworkAclEntry, ReplaceNetworkAclAssociation, CreateFlowLogs, DescribeFlowLogs, DeleteFlowLogs, CreateVpcPeeringConnection, AcceptVpcPeeringConnection, DescribeVpcPeeringConnections, DeleteVpcPeeringConnection, CreateDhcpOptions, AssociateDhcpOptions, DescribeDhcpOptions, DeleteDhcpOptions, CreateEgressOnlyInternetGateway, DescribeEgressOnlyInternetGateways, DeleteEgressOnlyInternetGateway, DescribeInstanceCreditSpecifications, DescribeInstanceMaintenanceOptions, DescribeInstanceAutoRecoveryAttribute, ModifyInstanceMaintenanceOptions, DescribeInstanceTopology, DescribeSpotInstanceRequests, DescribeCapacityReservations | In-memory state only — no real VMs; default VPC, subnet, security group, internet gateway, and route table always present; rules stored but not enforced (matches LocalStack); Terraform v6 compatible |+| **EC2** | RunInstances, DescribeInstances, DescribeInstanceAttribute, DescribeInstanceTypes, TerminateInstances, StopInstances, StartInstances, RebootInstances, DescribeImages, CreateSecurityGroup, DeleteSecurityGroup, DescribeSecurityGroups, AuthorizeSecurityGroupIngress, RevokeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress, CreateKeyPair, DeleteKeyPair, DescribeKeyPairs, ImportKeyPair, CreateVpc, DeleteVpc, DescribeVpcs, ModifyVpcAttribute, CreateSubnet, DeleteSubnet, DescribeSubnets, ModifySubnetAttribute, CreateInternetGateway, DeleteInternetGateway, DescribeInternetGateways, AttachInternetGateway, DetachInternetGateway, CreateRouteTable, DeleteRouteTable, DescribeRouteTables, AssociateRouteTable, DisassociateRouteTable, CreateRoute, ReplaceRoute, DeleteRoute, CreateNetworkInterface, DeleteNetworkInterface, DescribeNetworkInterfaces, AttachNetworkInterface, DetachNetworkInterface, CreateVpcEndpoint, DeleteVpcEndpoints, DescribeVpcEndpoints, DescribeAvailabilityZones, AllocateAddress, ReleaseAddress, AssociateAddress, DisassociateAddress, DescribeAddresses, CreateTags, DeleteTags, DescribeTags, CreateNatGateway, DescribeNatGateways, DeleteNatGateway, CreateNetworkAcl, DescribeNetworkAcls, DeleteNetworkAcl, CreateNetworkAclEntry, DeleteNetworkAclEntry, ReplaceNetworkAclEntry, ReplaceNetworkAclAssociation, CreateFlowLogs, DescribeFlowLogs, DeleteFlowLogs, CreateVpcPeeringConnection, AcceptVpcPeeringConnection, DescribeVpcPeeringConnections, DeleteVpcPeeringConnection, CreateDhcpOptions, AssociateDhcpOptions, DescribeDhcpOptions, DeleteDhcpOptions, CreateEgressOnlyInternetGateway, DescribeEgressOnlyInternetGateways, DeleteEgressOnlyInternetGateway, DescribeInstanceCreditSpecifications, DescribeInstanceMaintenanceOptions, DescribeInstanceAutoRecoveryAttribute, ModifyInstanceMaintenanceOptions, DescribeInstanceTopology, DescribeSpotInstanceRequests, DescribeCapacityReservations | In-memory state only — no real VMs; default VPC, subnet, security group, internet gateway, and route table always present; rules stored but not enforced (matches LocalStack); Terraform v6 compatible || **EBS** | CreateVolume, DeleteVolume, DescribeVolumes, DescribeVolumeStatus, AttachVolume, DetachVolume, ModifyVolume, DescribeVolumesModifications, EnableVolumeIO, ModifyVolumeAttribute, DescribeVolumeAttribute, CreateSnapshot, DeleteSnapshot, DescribeSnapshots, CopySnapshot, ModifySnapshotAttribute, DescribeSnapshotAttribute | Part of EC2 Query/XML service; attach/detach updates volume state; snapshots stored as completed immediately; Pro-only on LocalStack — free here || **EFS** | CreateFileSystem, DescribeFileSystems, DeleteFileSystem, UpdateFileSystem, CreateMountTarget, DescribeMountTargets, DeleteMountTarget, DescribeMountTargetSecurityGroups, ModifyMountTargetSecurityGroups, CreateAccessPoint, DescribeAccessPoints, DeleteAccessPoint, TagResource, UntagResource, ListTagsForResource, PutLifecycleConfiguration, DescribeLifecycleConfiguration, PutBackupPolicy, DescribeBackupPolicy, DescribeAccountPreferences, PutAccountPreferences | REST/JSON `/2015-02-01/*`; CreationToken idempotency; FileSystem deletion blocked when mount targets exist; Pro-only on LocalStack — free here || **EMR** | RunJobFlow, DescribeCluster, ListClusters, TerminateJobFlows, ModifyCluster, SetTerminationProtection, SetVisibleToAllUsers, AddJobFlowSteps, DescribeStep, ListSteps, CancelSteps, AddInstanceFleet, ListInstanceFleets, ModifyInstanceFleet, AddInstanceGroups, ListInstanceGroups, ModifyInstanceGroups, ListBootstrapActions, AddTags, RemoveTags, GetBlockPublicAccessConfiguration, PutBlockPublicAccessConfiguration | Control plane only — no real Spark/Hadoop; clusters start in WAITING (KeepAlive=true) or TERMINATED (KeepAlive=false); steps stored as COMPLETED immediately; all three instance modes (simple, InstanceGroups, InstanceFleets); TerminationProtected enforced; Pro-only on LocalStack — free here |@@ -408,7 +408,7 @@ ecs.stop_task(cluster="dev", task=task_arn)| Variable | Default | Description ||----------|---------|-------------|| `GATEWAY_PORT` | `4566` | Port to listen on |-| `MINISTACK_HOST` | `localhost` | Hostname used in SQS queue URLs returned to clients |+| `MINISTACK_HOST` | `localhost` | Hostname used in response URLs (SQS queues, SNS subscriptions, API Gateway endpoints, Lambda layers) || `MINISTACK_REGION` | `us-east-1` | AWS region reported in ARNs and service responses across all services || `LOG_LEVEL` | `INFO` | `DEBUG`, `INFO`, `WARNING`, `ERROR` || `S3_PERSIST` | `0` | Set `1` to persist S3 objects to disk |@@ -419,6 +419,7 @@ ecs.stop_task(cluster="dev", task=task_arn)| `ELASTICACHE_BASE_PORT` | `16379` | Starting host port for ElastiCache containers || `PERSIST_STATE` | `0` | Set `1` to persist service state across restarts || `STATE_DIR` | `/tmp/ministack-state` | Directory for persisted state files |+| `LAMBDA_EXECUTOR` | `local` | Lambda execution mode: `local` (subprocess) or `docker` (container) || `ATHENA_ENGINE` | `auto` | SQL engine for Athena: `auto`, `duckdb`, `mock` |### Athena SQL Engines@@ -452,11 +453,11 @@ docker run -p 4566:4566 \### Lambda Warm Starts-MiniStack keeps Python Lambda functions warm between invocations. After the first call (cold start), the handler module stays imported in a persistent subprocess. Subsequent calls skip the import step, matching real AWS warm-start behaviour and making test suites significantly faster.+MiniStack keeps Python and Node.js Lambda functions warm between invocations. After the first call (cold start), the handler module stays loaded in a persistent subprocess. Subsequent calls skip the import/require step, matching real AWS warm-start behaviour and making test suites significantly faster.### Lambda Node.js Runtimes-MiniStack supports Node.js Lambda runtimes (`nodejs14.x`, `nodejs16.x`, `nodejs18.x`, `nodejs20.x`, `nodejs22.x`). Functions execute via a local `node` subprocess (or Docker when `LAMBDA_USE_DOCKER=1`) — no mocking, real JS execution.+MiniStack supports Node.js Lambda runtimes (`nodejs14.x`, `nodejs16.x`, `nodejs18.x`, `nodejs20.x`, `nodejs22.x`). Functions execute via a local `node` subprocess (or Docker when `LAMBDA_EXECUTOR=docker`) — no mocking, real JS execution.```pythonimport boto3, json, zipfile, io@@ -535,20 +536,20 @@ pip install boto3 pytest duckdb docker cbor2# Start MiniStackdocker compose up -d-# Run the full test suite (818 tests across all 34 services)+# Run the full test suite (834 tests across all 34 services)pytest tests/ -v```Expected output:```-collected 760 items+collected 834 itemstests/test_services.py::test_s3_create_bucket PASSED...tests/test_services.py::test_app_asgi_callable PASSED-760 passed in ~60s+834 passed in ~100s```---@@ -557,45 +558,53 @@ tests/test_services.py::test_app_asgi_callable PASSED### Terraform+Works with both Terraform AWS Provider v5 and v6.+```hclprovider "aws" {region = "us-east-1"access_key = "test"secret_key = "test"+ s3_use_path_style = trueskip_credentials_validation = trueskip_metadata_api_check = trueskip_requesting_account_id = trueendpoints {- s3 = "http://localhost:4566"- sqs = "http://localhost:4566"- dynamodb = "http://localhost:4566"- lambda = "http://localhost:4566"- iam = "http://localhost:4566"- sts = "http://localhost:4566"- secretsmanager = "http://localhost:4566"- ssm = "http://localhost:4566"- kinesis = "http://localhost:4566"- sns = "http://localhost:4566"- rds = "http://localhost:4566"- ecs = "http://localhost:4566"- glue = "http://localhost:4566"- athena = "http://localhost:4566"- elasticache = "http://localhost:4566"- stepfunctions = "http://localhost:4566"- cloudwatch = "http://localhost:4566"- logs = "http://localhost:4566"- events = "http://localhost:4566"- ses = "http://localhost:4566"- apigateway = "http://localhost:4566"- firehose = "http://localhost:4566"- route53 = "http://localhost:4566"- cognitoidp = "http://localhost:4566"+ acm = "http://localhost:4566"+ apigateway = "http://localhost:4566"+ athena = "http://localhost:4566"+ cloudformation = "http://localhost:4566"+ cloudwatch = "http://localhost:4566"cognitoidentity = "http://localhost:4566"+ cognitoidp = "http://localhost:4566"+ dynamodb = "http://localhost:4566"ec2 = "http://localhost:4566"- emr = "http://localhost:4566"+ ecs = "http://localhost:4566"efs = "http://localhost:4566"+ elasticache = "http://localhost:4566"elbv2 = "http://localhost:4566"+ emr = "http://localhost:4566"+ events = "http://localhost:4566"+ firehose = "http://localhost:4566"+ glue = "http://localhost:4566"+ iam = "http://localhost:4566"+ kinesis = "http://localhost:4566"+ lambda = "http://localhost:4566"+ logs = "http://localhost:4566"+ rds = "http://localhost:4566"+ route53 = "http://localhost:4566"+ s3 = "http://localhost:4566"+ s3control = "http://localhost:4566"+ secretsmanager = "http://localhost:4566"+ ses = "http://localhost:4566"+ sesv2 = "http://localhost:4566"+ sns = "http://localhost:4566"+ sqs = "http://localhost:4566"+ ssm = "http://localhost:4566"+ stepfunctions = "http://localhost:4566"+ sts = "http://localhost:4566"+ wafv2 = "http://localhost:4566"}}```@@ -620,6 +629,10 @@ config:# ... etc```+### Testcontainers (Java / Go)++See [`examples/java-testcontainers`](examples/java-testcontainers) and [`examples/go-testcontainers`](examples/go-testcontainers) for ready-to-run integration tests using Testcontainers with the AWS SDK v2.+---## Comparison@@ -627,7 +640,7 @@ config:| Feature | MiniStack | LocalStack Free | LocalStack Pro ||---------|-----------|-----------------|----------------|| S3, SQS, SNS, DynamoDB | ✅ | ✅ | ✅ |-| Lambda (Python execution) | ✅ | ✅ | ✅ |+| Lambda (Python + Node.js execution) | ✅ | ✅ | ✅ || IAM, STS, SecretsManager | ✅ | ✅ | ✅ || CloudWatch Logs | ✅ | ✅ | ✅ || SSM Parameter Store | ✅ | ✅ | ✅ |diff --git a/examples/go-testcontainers/README.md b/examples/go-testcontainers/README.mdnew file mode 100644index 00000000..23f66439--- /dev/null+++ b/examples/go-testcontainers/README.md@@ -0,0 +1,25 @@+# MiniStack — Go Testcontainers Example++Integration tests for S3, SQS, and DynamoDB using [testcontainers-go](https://golang.testcontainers.org/) and the AWS SDK v2.++## Prerequisites++- Go 1.21++- Docker (running)++## Run++```bash+go mod tidy+go test ./... -v+```++Testcontainers will pull `nahuelnucera/ministack:latest`, start it, run the tests, and tear it down automatically.++## What's tested++| Service | Operations |+|------------|------------|+| S3 | CreateBucket, PutObject, GetObject, ListBuckets |+| SQS | CreateQueue, SendMessage, ReceiveMessage |+| DynamoDB | CreateTable, PutItem, GetItem, DeleteItem |diff --git a/examples/go-testcontainers/go.mod b/examples/go-testcontainers/go.modnew file mode 100644index 00000000..b318c096--- /dev/null+++ b/examples/go-testcontainers/go.mod@@ -0,0 +1,74 @@+module github.com/nahuelnucera/ministack/examples/go-testcontainers++go 1.21++require (+ github.com/aws/aws-sdk-go-v2 v1.26.1+ github.com/aws/aws-sdk-go-v2/credentials v1.17.11+ github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.1+ github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1+ github.com/aws/aws-sdk-go-v2/service/sqs v1.31.1+ github.com/testcontainers/testcontainers-go v0.30.0+)++require (+ dario.cat/mergo v1.0.0 // indirect+ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect+ github.com/Microsoft/go-winio v0.6.1 // indirect+ github.com/Microsoft/hcsshim v0.11.4 // indirect+ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 // indirect+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect+ github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 // indirect+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect+ github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 // indirect+ github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.6 // indirect+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 // indirect+ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 // indirect+ github.com/aws/smithy-go v1.20.2 // indirect+ github.com/cenkalti/backoff/v4 v4.2.1 // indirect+ github.com/containerd/containerd v1.7.12 // indirect+ github.com/containerd/log v0.1.0 // indirect+ github.com/cpuguy83/dockercfg v0.3.1 // indirect+ github.com/distribution/reference v0.5.0 // indirect+ github.com/docker/docker v25.0.5+incompatible // indirect+ github.com/docker/go-connections v0.5.0 // indirect+ github.com/docker/go-units v0.5.0 // indirect+ github.com/felixge/httpsnoop v1.0.4 // indirect+ github.com/go-logr/logr v1.4.1 // indirect+ github.com/go-logr/stdr v1.2.2 // indirect+ github.com/go-ole/go-ole v1.2.6 // indirect+ github.com/gogo/protobuf v1.3.2 // indirect+ github.com/golang/protobuf v1.5.3 // indirect+ github.com/google/uuid v1.6.0 // indirect+ github.com/jmespath/go-jmespath v0.4.0 // indirect+ github.com/klauspost/compress v1.16.0 // indirect+ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect+ github.com/magiconair/properties v1.8.7 // indirect+ github.com/moby/patternmatcher v0.6.0 // indirect+ github.com/moby/sys/sequential v0.5.0 // indirect+ github.com/moby/sys/user v0.1.0 // indirect+ github.com/moby/term v0.5.0 // indirect+ github.com/morikuni/aec v1.0.0 // indirect+ github.com/opencontainers/go-digest v1.0.0 // indirect+ github.com/opencontainers/image-spec v1.1.0 // indirect+ github.com/pkg/errors v0.9.1 // indirect+ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect+ github.com/shirou/gopsutil/v3 v3.23.12 // indirect+ github.com/shoenig/go-m1cpu v0.1.6 // indirect+ github.com/sirupsen/logrus v1.9.3 // indirect+ github.com/tklauser/go-sysconf v0.3.12 // indirect+ github.com/tklauser/numcpus v0.6.1 // indirect+ github.com/yusufpapurcu/wmi v1.2.3 // indirect+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect+ go.opentelemetry.io/otel v1.24.0 // indirect+ go.opentelemetry.io/otel/metric v1.24.0 // indirect+ go.opentelemetry.io/otel/trace v1.24.0 // indirect+ golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect+ golang.org/x/mod v0.16.0 // indirect+ golang.org/x/sys v0.16.0 // indirect+ golang.org/x/tools v0.13.0 // indirect+ google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect+ google.golang.org/grpc v1.58.3 // indirect+ google.golang.org/protobuf v1.33.0 // indirect+)diff --git a/examples/go-testcontainers/go.sum b/examples/go-testcontainers/go.sumnew file mode 100644index 00000000..a2bf5615--- /dev/null+++ b/examples/go-testcontainers/go.sum@@ -0,0 +1,227 @@+dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=+dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=+github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU=+github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=+github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=+github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=+github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=+github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=+github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8=+github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w=+github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA=+github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM=+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2 h1:x6xsQXGSmW6frevwDA+vi/wqhp1ct18mVXYN08/93to=+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.2/go.mod h1:lPprDr1e6cJdyYeGXnRaJoP4Md+cDBvi2eOj00BlGmg=+github.com/aws/aws-sdk-go-v2/credentials v1.17.11 h1:YuIB1dJNf1Re822rriUOTxopaHHvIq0l/pX3fwO+Tzs=+github.com/aws/aws-sdk-go-v2/credentials v1.17.11/go.mod h1:AQtFPsDH9bI2O+71anW6EKL+NcD7LG3dpKGMV4SShgo=+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 h1:aw39xVGeRWlWx9EzGVnhOR4yOjQDHPQ6o6NmBlscyQg=+github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5/go.mod h1:FSaRudD0dXiMPK2UjknVwwTYyZMRsHv3TtkabsZih5I=+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 h1:PG1F3OD1szkuQPzDw3CIQsRIrtTlUC3lP84taWzHlq0=+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5/go.mod h1:jU1li6RFryMz+so64PpKtudI+QzbKoIEivqdf6LNpOc=+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5 h1:81KE7vaZzrl7yHBYHVEzYB8sypz11NMOZ40YlWvPxsU=+github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.5/go.mod h1:LIt2rg7Mcgn09Ygbdh/RdIm0rQ+3BNkbP1gyVMFtRK0=+github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.1 h1:dZXY07Dm59TxAjJcUfNMJHLDI/gLMxTRZefn2jFAVsw=+github.com/aws/aws-sdk-go-v2/service/dynamodb v1.31.1/go.mod h1:lVLqEtX+ezgtfalyJs7Peb0uv9dEpAQP5yuq2O26R44=+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs=+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg=+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7 h1:ZMeFZ5yk+Ek+jNr1+uwCd2tG89t6oTS5yVWpa6yy2es=+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.7/go.mod h1:mxV05U+4JiHqIpGqqYXOHLPKUC6bDXC44bsUhNjOEwY=+github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.6 h1:6tayEze2Y+hiL3kdnEUxSPsP+pJsUfwLSFspFl1ru9Q=+github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.9.6/go.mod h1:qVNb/9IOVsLCZh0x2lnagrBwQ9fxajUpXS7OZfIsKn0=+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo=+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk=+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5 h1:f9RyWNtS8oH7cZlbn+/JNPpjUk5+5fLd5lM9M0i49Ys=+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.5/go.mod h1:h5CoMZV2VF297/VLhRhO1WF+XYWOzXo+4HsObA4HjBQ=+github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1 h1:6cnno47Me9bRykw9AEv9zkXE+5or7jz8TsskTTccbgc=+github.com/aws/aws-sdk-go-v2/service/s3 v1.53.1/go.mod h1:qmdkIIAC+GCLASF7R2whgNrJADz0QZPX+Seiw/i4S3o=+github.com/aws/aws-sdk-go-v2/service/sqs v1.31.1 h1:124rVNP6NbCfBZwiX1kfjMQrnsJtnpKeB0GalkuqSXo=+github.com/aws/aws-sdk-go-v2/service/sqs v1.31.1/go.mod h1:YijRvM1SAmuiIQ9pjfwahIEE3HMHUkx9P5oplL/Jnj4=+github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q=+github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E=+github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=+github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=+github.com/containerd/containerd v1.7.12 h1:+KQsnv4VnzyxWcfO9mlxxELaoztsDEjOuCMPAuPqgU0=+github.com/containerd/containerd v1.7.12/go.mod h1:/5OMpE1p0ylxtEUGY8kuCYkDRzJm9NO1TFMWjUpdevk=+github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=+github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=+github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E=+github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc=+github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=+github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=+github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=+github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=+github.com/docker/docker v25.0.5+incompatible h1:UmQydMduGkrD5nQde1mecF/YnSbTOaPeFIeP5C4W+DE=+github.com/docker/docker v25.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=+github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c=+github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc=+github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=+github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=+github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=+github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=+github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=+github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=+github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=+github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=+github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=+github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=+github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=+github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=+github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=+github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=+github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=+github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=+github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=+github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=+github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=+github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=+github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4=+github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=+github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=+github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=+github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=+github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=+github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=+github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=+github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=+github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=+github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=+github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=+github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=+github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=+github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=+github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=+github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=+github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=+github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=+github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=+github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=+github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=+github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=+github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=+github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=+github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=+github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=+github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=+github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=+github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=+github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=+github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=+github.com/testcontainers/testcontainers-go v0.30.0 h1:jmn/XS22q4YRrcMwWg0pAwlClzs/abopbsBzrepyc4E=+github.com/testcontainers/testcontainers-go v0.30.0/go.mod h1:K+kHNGiM5zjklKjgTtcrEetF3uhWbMUyqAQoyoh8Pf0=+github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=+github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=+github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=+github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=+github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=+github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=+github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U=+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE=+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg=+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU=+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=+go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o=+go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A=+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=+go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=+go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=+golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4=+golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=+golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=+golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=+golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=+golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=+golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=+golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=+golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=+golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=+golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=+golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=+golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=+golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=+golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=+golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=+golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=+golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=+golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=+golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=+golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=+golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=+golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=+golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=+golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=+golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=+google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g=+google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw=+google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ=+google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U=+google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=+google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=+google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=+google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=+gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=+gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY=+gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU=diff --git a/examples/go-testcontainers/ministack_test.go b/examples/go-testcontainers/ministack_test.gonew file mode 100644index 00000000..db0ec95b--- /dev/null+++ b/examples/go-testcontainers/ministack_test.go@@ -0,0 +1,297 @@+package ministacktest++import (+ "context"+ "fmt"+ "strings"+ "testing"+ "time"++ "github.com/aws/aws-sdk-go-v2/aws"+ "github.com/aws/aws-sdk-go-v2/credentials"+ "github.com/aws/aws-sdk-go-v2/service/dynamodb"+ "github.com/aws/aws-sdk-go-v2/service/dynamodb/types"+ "github.com/aws/aws-sdk-go-v2/service/s3"+ "github.com/aws/aws-sdk-go-v2/service/sqs"+ "github.com/testcontainers/testcontainers-go"+ "github.com/testcontainers/testcontainers-go/wait"+)++// newMiniStackContainer starts a MiniStack container and returns the endpoint URL.+func newMiniStackContainer(ctx context.Context, t *testing.T) (string, func()) {+ t.Helper()++ req := testcontainers.ContainerRequest{+ Image: "nahuelnucera/ministack:latest",+ ExposedPorts: []string{"4566/tcp"},+ Env: map[string]string{+ "GATEWAY_PORT": "4566",+ "LOG_LEVEL": "INFO",+ },+ WaitingFor: wait.ForHTTP("/_ministack/health").+ WithPort("4566/tcp").+ WithStartupTimeout(60 * time.Second),+ }++ container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{+ ContainerRequest: req,+ Started: true,+ })+ if err != nil {+ t.Fatalf("failed to start MiniStack container: %v", err)+ }++ host, err := container.Host(ctx)+ if err != nil {+ t.Fatalf("failed to get container host: %v", err)+ }+ port, err := container.MappedPort(ctx, "4566")+ if err != nil {+ t.Fatalf("failed to get mapped port: %v", err)+ }++ endpoint := fmt.Sprintf("http://%s:%s", host, port.Port())++ cleanup := func() {+ if err := container.Terminate(ctx); err != nil {+ t.Logf("failed to terminate container: %v", err)+ }+ }++ return endpoint, cleanup+}++func awsCfg(endpoint string) aws.Config {+ return aws.Config{+ Region: "us-east-1",+ Credentials: credentials.NewStaticCredentialsProvider("test", "test", ""),+ EndpointResolverWithOptions: aws.EndpointResolverWithOptionsFunc(+ func(service, region string, options ...interface{}) (aws.Endpoint, error) {+ return aws.Endpoint{URL: endpoint}, nil+ },+ ),+ }+}++// ── S3 ──────────────────────────────────────────────────────────────────────++func TestS3_PutAndGetObject(t *testing.T) {+ ctx := context.Background()+ endpoint, cleanup := newMiniStackContainer(ctx, t)+ defer cleanup()++ cfg := awsCfg(endpoint)+ client := s3.NewFromConfig(cfg, func(o *s3.Options) {+ o.UsePathStyle = true+ })++ bucket := "go-test-bucket"+ _, err := client.CreateBucket(ctx, &s3.CreateBucketInput{Bucket: aws.String(bucket)})+ if err != nil {+ t.Fatalf("CreateBucket: %v", err)+ }++ _, err = client.PutObject(ctx, &s3.PutObjectInput{+ Bucket: aws.String(bucket),+ Key: aws.String("hello.txt"),+ Body: strings.NewReader("Hello from Go!"),+ })+ if err != nil {+ t.Fatalf("PutObject: %v", err)+ }++ out, err := client.GetObject(ctx, &s3.GetObjectInput{+ Bucket: aws.String(bucket),+ Key: aws.String("hello.txt"),+ })+ if err != nil {+ t.Fatalf("GetObject: %v", err)+ }+ defer out.Body.Close()++ buf := new(strings.Builder)+ if _, err := fmt.Fscan(out.Body, buf); err != nil && buf.Len() == 0 {+ t.Fatalf("read body: %v", err)+ }+ if !strings.Contains(buf.String(), "Hello") {+ t.Errorf("unexpected body: %q", buf.String())+ }+}++func TestS3_ListBuckets(t *testing.T) {+ ctx := context.Background()+ endpoint, cleanup := newMiniStackContainer(ctx, t)+ defer cleanup()++ cfg := awsCfg(endpoint)+ client := s3.NewFromConfig(cfg, func(o *s3.Options) { o.UsePathStyle = true })++ _, err := client.CreateBucket(ctx, &s3.CreateBucketInput{Bucket: aws.String("list-bucket")})+ if err != nil {+ t.Fatalf("CreateBucket: %v", err)+ }++ out, err := client.ListBuckets(ctx, &s3.ListBucketsInput{})+ if err != nil {+ t.Fatalf("ListBuckets: %v", err)+ }++ found := false+ for _, b := range out.Buckets {+ if aws.ToString(b.Name) == "list-bucket" {+ found = true+ }+ }+ if !found {+ t.Error("expected list-bucket in ListBuckets response")+ }+}++// ── SQS ──────────────────────────────────────────────────────────────────────++func TestSQS_SendAndReceive(t *testing.T) {+ ctx := context.Background()+ endpoint, cleanup := newMiniStackContainer(ctx, t)+ defer cleanup()++ cfg := awsCfg(endpoint)+ client := sqs.NewFromConfig(cfg)++ q, err := client.CreateQueue(ctx, &sqs.CreateQueueInput{QueueName: aws.String("go-test-queue")})+ if err != nil {+ t.Fatalf("CreateQueue: %v", err)+ }++ _, err = client.SendMessage(ctx, &sqs.SendMessageInput{+ QueueUrl: q.QueueUrl,+ MessageBody: aws.String("hello from go"),+ })+ if err != nil {+ t.Fatalf("SendMessage: %v", err)+ }++ recv, err := client.ReceiveMessage(ctx, &sqs.ReceiveMessageInput{+ QueueUrl: q.QueueUrl,+ MaxNumberOfMessages: 1,+ WaitTimeSeconds: 2,+ })+ if err != nil {+ t.Fatalf("ReceiveMessage: %v", err)+ }+ if len(recv.Messages) != 1 {+ t.Fatalf("expected 1 message, got %d", len(recv.Messages))+ }+ if aws.ToString(recv.Messages[0].Body) != "hello from go" {+ t.Errorf("unexpected body: %q", aws.ToString(recv.Messages[0].Body))+ }+}++// ── DynamoDB ──────────────────────────────────────────────────────────────────++func TestDynamoDB_PutAndGet(t *testing.T) {+ ctx := context.Background()+ endpoint, cleanup := newMiniStackContainer(ctx, t)+ defer cleanup()++ cfg := awsCfg(endpoint)+ client := dynamodb.NewFromConfig(cfg)++ _, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{+ TableName: aws.String("go-test-table"),+ KeySchema: []types.KeySchemaElement{+ {AttributeName: aws.String("pk"), KeyType: types.KeyTypeHash},+ },+ AttributeDefinitions: []types.AttributeDefinition{+ {AttributeName: aws.String("pk"), AttributeType: types.ScalarAttributeTypeS},+ },+ BillingMode: types.BillingModePayPerRequest,+ })+ if err != nil {+ t.Fatalf("CreateTable: %v", err)+ }++ _, err = client.PutItem(ctx, &dynamodb.PutItemInput{+ TableName: aws.String("go-test-table"),+ Item: map[string]types.AttributeValue{+ "pk": &types.AttributeValueMemberS{Value: "key1"},+ "value": &types.AttributeValueMemberS{Value: "hello dynamodb from go"},+ },+ })+ if err != nil {+ t.Fatalf("PutItem: %v", err)+ }++ out, err := client.GetItem(ctx, &dynamodb.GetItemInput{+ TableName: aws.String("go-test-table"),+ Key: map[string]types.AttributeValue{+ "pk": &types.AttributeValueMemberS{Value: "key1"},+ },+ })+ if err != nil {+ t.Fatalf("GetItem: %v", err)+ }++ val, ok := out.Item["value"].(*types.AttributeValueMemberS)+ if !ok {+ t.Fatal("expected string attribute 'value'")+ }+ if val.Value != "hello dynamodb from go" {+ t.Errorf("unexpected value: %q", val.Value)+ }+}++func TestDynamoDB_DeleteItem(t *testing.T) {+ ctx := context.Background()+ endpoint, cleanup := newMiniStackContainer(ctx, t)+ defer cleanup()++ cfg := awsCfg(endpoint)+ client := dynamodb.NewFromConfig(cfg)++ _, err := client.CreateTable(ctx, &dynamodb.CreateTableInput{+ TableName: aws.String("go-delete-table"),+ KeySchema: []types.KeySchemaElement{+ {AttributeName: aws.String("pk"), KeyType: types.KeyTypeHash},+ },+ AttributeDefinitions: []types.AttributeDefinition{+ {AttributeName: aws.String("pk"), AttributeType: types.ScalarAttributeTypeS},+ },+ BillingMode: types.BillingModePayPerRequest,+ })+ if err != nil {+ t.Fatalf("CreateTable: %v", err)+ }++ _, err = client.PutItem(ctx, &dynamodb.PutItemInput{+ TableName: aws.String("go-delete-table"),+ Item: map[string]types.AttributeValue{+ "pk": &types.AttributeValueMemberS{Value: "del1"},+ },+ })+ if err != nil {+ t.Fatalf("PutItem: %v", err)+ }++ _, err = client.DeleteItem(ctx, &dynamodb.DeleteItemInput{+ TableName: aws.String("go-delete-table"),+ Key: map[string]types.AttributeValue{+ "pk": &types.AttributeValueMemberS{Value: "del1"},+ },+ })+ if err != nil {+ t.Fatalf("DeleteItem: %v", err)+ }++ out, err := client.GetItem(ctx, &dynamodb.GetItemInput{+ TableName: aws.String("go-delete-table"),+ Key: map[string]types.AttributeValue{+ "pk": &types.AttributeValueMemberS{Value: "del1"},+ },+ })+ if err != nil {+ t.Fatalf("GetItem: %v", err)+ }+ if len(out.Item) != 0 {+ t.Error("expected item to be deleted")+ }+}diff --git a/examples/java-testcontainers/README.md b/examples/java-testcontainers/README.mdnew file mode 100644index 00000000..3b1492e6--- /dev/null+++ b/examples/java-testcontainers/README.md@@ -0,0 +1,25 @@+# MiniStack — Java Testcontainers Example++Integration tests for S3, SQS, and DynamoDB using [Testcontainers](https://testcontainers.com/) and the AWS SDK v2.++## Prerequisites++- Java 17++- Maven 3.8++- Docker (running)++## Run++```bash+mvn test+```++Testcontainers will pull `nahuelnucera/ministack:latest`, start it, run the tests, and tear it down automatically.++## What's tested++| Service | Operations |+|------------|------------|+| S3 | CreateBucket, PutObject, GetObject, ListBuckets, DeleteObject |+| SQS | CreateQueue, SendMessage, ReceiveMessage, DeleteMessage, GetQueueAttributes |+| DynamoDB | CreateTable, PutItem, GetItem, UpdateItem, DeleteItem |diff --git a/examples/java-testcontainers/pom.xml b/examples/java-testcontainers/pom.xmlnew file mode 100644index 00000000..6811d7c9--- /dev/null+++ b/examples/java-testcontainers/pom.xml@@ -0,0 +1,80 @@+<?xml version="1.0" encoding="UTF-8"?>+<project xmlns="http://maven.apache.org/POM/4.0.0"+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">+ <modelVersion>4.0.0</modelVersion>++ <groupId>io.ministack</groupId>+ <artifactId>ministack-testcontainers-example</artifactId>+ <version>1.0.0</version>+ <packaging>jar</packaging>++ <properties>+ <maven.compiler.source>17</maven.compiler.source>+ <maven.compiler.target>17</maven.compiler.target>+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>+ <testcontainers.version>1.19.8</testcontainers.version>+ <aws.sdk.version>2.25.40</aws.sdk.version>+ <junit.version>5.10.2</junit.version>+ </properties>++ <dependencies>+ <!-- JUnit 5 -->+ <dependency>+ <groupId>org.junit.jupiter</groupId>+ <artifactId>junit-jupiter</artifactId>+ <version>${junit.version}</version>+ <scope>test</scope>+ </dependency>++ <!-- Testcontainers -->+ <dependency>+ <groupId>org.testcontainers</groupId>+ <artifactId>testcontainers</artifactId>+ <version>${testcontainers.version}</version>+ <scope>test</scope>+ </dependency>+ <dependency>+ <groupId>org.testcontainers</groupId>+ <artifactId>junit-jupiter</artifactId>+ <version>${testcontainers.version}</version>+ <scope>test</scope>+ </dependency>++ <!-- AWS SDK v2 -->+ <dependency>+ <groupId>software.amazon.awssdk</groupId>+ <artifactId>s3</artifactId>+ <version>${aws.sdk.version}</version>+ <scope>test</scope>+ </dependency>+ <dependency>+ <groupId>software.amazon.awssdk</groupId>+ <artifactId>sqs</artifactId>+ <version>${aws.sdk.version}</version>+ <scope>test</scope>+ </dependency>+ <dependency>+ <groupId>software.amazon.awssdk</groupId>+ <artifactId>dynamodb</artifactId>+ <version>${aws.sdk.version}</version>+ <scope>test</scope>+ </dependency>+ <dependency>+ <groupId>software.amazon.awssdk</groupId>+ <artifactId>url-connection-client</artifactId>+ <version>${aws.sdk.version}</version>+ <scope>test</scope>+ </dependency>+ </dependencies>++ <build>+ <plugins>+ <plugin>+ <groupId>org.apache.maven.plugins</groupId>+ <artifactId>maven-surefire-plugin</artifactId>+ <version>3.2.5</version>+ </plugin>+ </plugins>+ </build>+</project>diff --git a/examples/java-testcontainers/src/test/java/io/ministack/MiniStackTest.java b/examples/java-testcontainers/src/test/java/io/ministack/MiniStackTest.javanew file mode 100644index 00000000..9fb9079e--- /dev/null+++ b/examples/java-testcontainers/src/test/java/io/ministack/MiniStackTest.java@@ -0,0 +1,211 @@+package io.ministack;++import org.junit.jupiter.api.*;+import org.testcontainers.containers.GenericContainer;+import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;+import org.testcontainers.junit.jupiter.Container;+import org.testcontainers.junit.jupiter.Testcontainers;+import org.testcontainers.utility.DockerImageName;++import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;+import software.amazon.awssdk.core.sync.RequestBody;+import software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient;+import software.amazon.awssdk.regions.Region;+import software.amazon.awssdk.services.dynamodb.DynamoDbClient;+import software.amazon.awssdk.services.dynamodb.model.*;+import software.amazon.awssdk.services.s3.S3Client;+import software.amazon.awssdk.services.s3.model.*;+import software.amazon.awssdk.services.sqs.SqsClient;+import software.amazon.awssdk.services.sqs.model.*;++import java.net.URI;+import java.time.Duration;+import java.util.List;+import java.util.Map;++import static org.junit.jupiter.api.Assertions.*;++@Testcontainers+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)+class MiniStackTest {++ @Container+ static final GenericContainer<?> ministack = new GenericContainer<>(+ DockerImageName.parse("nahuelnucera/ministack:latest"))+ .withExposedPorts(4566)+ .withEnv("GATEWAY_PORT", "4566")+ .withEnv("LOG_LEVEL", "INFO")+ .waitingFor(new HttpWaitStrategy()+ .forPath("/_ministack/health")+ .forPort(4566)+ .withStartupTimeout(Duration.ofSeconds(60)));++ private static URI endpoint;+ private static StaticCredentialsProvider credentials;++ @BeforeAll+ static void setup() {+ endpoint = URI.create("http://" + ministack.getHost() + ":" + ministack.getMappedPort(4566));+ credentials = StaticCredentialsProvider.create(+ AwsBasicCredentials.create("test", "test"));+ }++ private S3Client s3() {+ return S3Client.builder()+ .endpointOverride(endpoint)+ .credentialsProvider(credentials)+ .region(Region.US_EAST_1)+ .httpClient(UrlConnectionHttpClient.create())+ .forcePathStyle(true)+ .build();+ }++ private SqsClient sqs() {+ return SqsClient.builder()+ .endpointOverride(endpoint)+ .credentialsProvider(credentials)+ .region(Region.US_EAST_1)+ .httpClient(UrlConnectionHttpClient.create())+ .build();+ }++ private DynamoDbClient ddb() {+ return DynamoDbClient.builder()+ .endpointOverride(endpoint)+ .credentialsProvider(credentials)+ .region(Region.US_EAST_1)+ .httpClient(UrlConnectionHttpClient.create())+ .build();+ }++ // ── S3 ──────────────────────────────────────────────────────────────────++ @Test+ @Order(1)+ void s3_createBucketPutAndGetObject() {+ try (S3Client client = s3()) {+ client.createBucket(b -> b.bucket("test-bucket"));++ client.putObject(+ PutObjectRequest.builder().bucket("test-bucket").key("hello.txt").build(),+ RequestBody.fromString("Hello MiniStack!"));++ String body = client.getObjectAsBytes(+ GetObjectRequest.builder().bucket("test-bucket").key("hello.txt").build()+ ).asUtf8String();++ assertEquals("Hello MiniStack!", body);+ }+ }++ @Test+ @Order(2)+ void s3_listBuckets() {+ try (S3Client client = s3()) {+ List<Bucket> buckets = client.listBuckets().buckets();+ assertTrue(buckets.stream().anyMatch(b -> b.name().equals("test-bucket")));+ }+ }++ @Test+ @Order(3)+ void s3_deleteObject() {+ try (S3Client client = s3()) {+ client.deleteObject(b -> b.bucket("test-bucket").key("hello.txt"));+ assertThrows(NoSuchKeyException.class, () ->+ client.getObjectAsBytes(b -> b.bucket("test-bucket").key("hello.txt")));+ }+ }++ // ── SQS ─────────────────────────────────────────────────────────────────++ @Test+ @Order(10)+ void sqs_sendAndReceiveMessage() {+ try (SqsClient client = sqs()) {+ String queueUrl = client.createQueue(b -> b.queueName("test-queue")).queueUrl();++ client.sendMessage(b -> b.queueUrl(queueUrl).messageBody("hello from java"));++ ReceiveMessageResponse resp = client.receiveMessage(b -> b+ .queueUrl(queueUrl)+ .maxNumberOfMessages(1)+ .waitTimeSeconds(2));++ assertEquals(1, resp.messages().size());+ assertEquals("hello from java", resp.messages().get(0).body());++ client.deleteMessage(b -> b+ .queueUrl(queueUrl)+ .receiptHandle(resp.messages().get(0).receiptHandle()));+ }+ }++ @Test+ @Order(11)+ void sqs_queueAttributes() {+ try (SqsClient client = sqs()) {+ String queueUrl = client.createQueue(b -> b.queueName("test-queue")).queueUrl();+ GetQueueAttributesResponse attrs = client.getQueueAttributes(b -> b+ .queueUrl(queueUrl)+ .attributeNames(QueueAttributeName.ALL));+ assertNotNull(attrs.attributes().get(QueueAttributeName.QUEUE_ARN));+ }+ }++ // ── DynamoDB ─────────────────────────────────────────────────────────────++ @Test+ @Order(20)+ void dynamodb_createTablePutAndGetItem() {+ try (DynamoDbClient client = ddb()) {+ client.createTable(b -> b+ .tableName("test-table")+ .keySchema(KeySchemaElement.builder().attributeName("pk").keyType(KeyType.HASH).build())+ .attributeDefinitions(AttributeDefinition.builder()+ .attributeName("pk").attributeType(ScalarAttributeType.S).build())+ .billingMode(BillingMode.PAY_PER_REQUEST));++ client.putItem(b -> b+ .tableName("test-table")+ .item(Map.of(+ "pk", AttributeValue.fromS("key1"),+ "value", AttributeValue.fromS("hello dynamodb"))));++ GetItemResponse resp = client.getItem(b -> b+ .tableName("test-table")+ .key(Map.of("pk", AttributeValue.fromS("key1"))));++ assertTrue(resp.hasItem());+ assertEquals("hello dynamodb", resp.item().get("value").s());+ }+ }++ @Test+ @Order(21)+ void dynamodb_updateAndDeleteItem() {+ try (DynamoDbClient client = ddb()) {+ client.updateItem(b -> b+ .tableName("test-table")+ .key(Map.of("pk", AttributeValue.fromS("key1")))+ .updateExpression("SET #v = :v")+ .expressionAttributeNames(Map.of("#v", "value"))+ .expressionAttributeValues(Map.of(":v", AttributeValue.fromS("updated"))));++ GetItemResponse resp = client.getItem(b -> b+ .tableName("test-table")+ .key(Map.of("pk", AttributeValue.fromS("key1"))));+ assertEquals("updated", resp.item().get("value").s());++ client.deleteItem(b -> b+ .tableName("test-table")+ .key(Map.of("pk", AttributeValue.fromS("key1"))));++ GetItemResponse after = client.getItem(b -> b+ .tableName("test-table")+ .key(Map.of("pk", AttributeValue.fromS("key1"))));+ assertFalse(after.hasItem());+ }+ }+}diff --git a/ministack/app.py b/ministack/app.pyindex 3789880b..dd4f85ee 100644--- a/ministack/app.py+++ b/ministack/app.py@@ -28,7 +28,7 @@ _EXECUTE_API_RE = re.compile(_S3_VHOST_RE = re.compile(r"^([^.]+)(?:\.s3)?\." + re.escape(_MINISTACK_HOST) + r"(?::\d+)?$")-_S3_VHOST_EXCLUDE_RE = re.compile(r"\.(execute-api|alb|emr|efs|elasticache)\.")+_S3_VHOST_EXCLUDE_RE = re.compile(r"\.(execute-api|alb|emr|efs|elasticache|s3-control)\.")from ministack.core.persistence import PERSIST_STATE, load_state, save_allfrom ministack.core.router import detect_service, extract_account_id, extract_region@@ -192,6 +192,31 @@ async def app(scope, receive, send):if not message.get("more_body", False):break+ # AWS SDK v2 sends PutObject with Transfer-Encoding: chunked and+ # x-amz-content-sha256: STREAMING-AWS4-HMAC-SHA256-PAYLOAD[-TRAILER].+ # Decode the AWS chunked format: each chunk is "<hex>;chunk-signature=...\r\n<data>\r\n"+ # terminated by "0;chunk-signature=...\r\n".+ sha256_header = headers.get("x-amz-content-sha256", "")+ if sha256_header.startswith("STREAMING-"):+ decoded = b""+ remaining = body+ while remaining:+ crlf = remaining.find(b"\r\n")+ if crlf == -1:+ break+ chunk_header = remaining[:crlf].decode("ascii", errors="replace")+ size_hex = chunk_header.split(";")[0].strip()+ try:+ chunk_size = int(size_hex, 16)+ except ValueError:+ break+ if chunk_size == 0:+ break+ data_start = crlf + 2+ decoded += remaining[data_start:data_start + chunk_size]+ remaining = remaining[data_start + chunk_size + 2:] # skip trailing \r\n+ body = decoded+request_id = str(uuid.uuid4())# Lambda layer content download: /_ministack/lambda-layers/{name}/{ver}/content@@ -390,7 +415,7 @@ async def app(scope, receive, send):_s3_vhost = _S3_VHOST_RE.match(host)if _s3_vhost and not _execute_match and not _S3_VHOST_EXCLUDE_RE.search(host):bucket = _s3_vhost.group(1)- _non_s3_hosts = {"s3", "sqs", "sns", "dynamodb", "lambda", "iam", "sts",+ _non_s3_hosts = {"s3", "s3-control", "sqs", "sns", "dynamodb", "lambda", "iam", "sts","secretsmanager", "logs", "ssm", "events", "kinesis","monitoring", "ses", "states", "ecs", "rds", "elasticache","glue", "athena", "apigateway", "cloudformation"}diff --git a/ministack/services/ec2.py b/ministack/services/ec2.pyindex ee5120ca..41688d03 100644--- a/ministack/services/ec2.py+++ b/ministack/services/ec2.py@@ -364,7 +364,10 @@ def _create_security_group(p):"VpcId": vpc_id,"OwnerId": ACCOUNT_ID,"IpPermissions": [],- "IpPermissionsEgress": [],+ "IpPermissionsEgress": [+ {"IpProtocol": "-1", "IpRanges": [{"CidrIp": "0.0.0.0/0"}],+ "Ipv6Ranges": [], "PrefixListIds": [], "UserIdGroupPairs": []},+ ],}return _xml(200, "CreateSecurityGroupResponse",f"<return>true</return><groupId>{sg_id}</groupId>")@@ -397,7 +400,9 @@ def _authorize_sg_ingress(p):if not sg:return _error("InvalidGroup.NotFound", f"Security group {sg_id} not found", 400)rules = _parse_ip_permissions(p, "IpPermissions")- sg["IpPermissions"].extend(rules)+ for r in rules:+ if r not in sg["IpPermissions"]:+ sg["IpPermissions"].append(r)return _xml(200, "AuthorizeSecurityGroupIngressResponse", "<return>true</return>")@@ -421,7 +426,9 @@ def _authorize_sg_egress(p):if not sg:return _error("InvalidGroup.NotFound", f"Security group {sg_id} not found", 400)rules = _parse_ip_permissions(p, "IpPermissions")- sg["IpPermissionsEgress"].extend(rules)+ for r in rules:+ if r not in sg["IpPermissionsEgress"]:+ sg["IpPermissionsEgress"].append(r)return _xml(200, "AuthorizeSecurityGroupEgressResponse", "<return>true</return>")@@ -2015,8 +2022,8 @@ def _create_vpc_peering_connection(params):_vpc_peering[pcx_id] = recordinner = f"""<vpcPeeringConnection><vpcPeeringConnectionId>{pcx_id}</vpcPeeringConnectionId>- <requesterVpcInfo><vpcId>{vpc_id}</vpcId><ownerId>{ACCOUNT_ID}</ownerId></requesterVpcInfo>- <accepterVpcInfo><vpcId>{peer_vpc_id}</vpcId><ownerId>{peer_owner_id}</ownerId></accepterVpcInfo>+ <requesterVpcInfo><vpcId>{vpc_id}</vpcId><ownerId>{ACCOUNT_ID}</ownerId><region>{REGION}</region></requesterVpcInfo>+ <accepterVpcInfo><vpcId>{peer_vpc_id}</vpcId><ownerId>{peer_owner_id}</ownerId><region>{peer_region}</region></accepterVpcInfo><status><code>pending-acceptance</code></status><tagSet/></vpcPeeringConnection>"""@@ -2032,8 +2039,8 @@ def _accept_vpc_peering_connection(params):pcx = _vpc_peering[pcx_id]inner = f"""<vpcPeeringConnection><vpcPeeringConnectionId>{pcx_id}</vpcPeeringConnectionId>- <requesterVpcInfo><vpcId>{pcx['RequesterVpcInfo']['VpcId']}</vpcId></requesterVpcInfo>- <accepterVpcInfo><vpcId>{pcx['AccepterVpcInfo']['VpcId']}</vpcId></accepterVpcInfo>+ <requesterVpcInfo><vpcId>{pcx['RequesterVpcInfo']['VpcId']}</vpcId><ownerId>{pcx['RequesterVpcInfo']['OwnerId']}</ownerId><region>{pcx['RequesterVpcInfo']['Region']}</region></requesterVpcInfo>+ <accepterVpcInfo><vpcId>{pcx['AccepterVpcInfo']['VpcId']}</vpcId><ownerId>{pcx['AccepterVpcInfo']['OwnerId']}</ownerId><region>{pcx['AccepterVpcInfo']['Region']}</region></accepterVpcInfo><status><code>active</code></status><tagSet/></vpcPeeringConnection>"""@@ -2051,8 +2058,8 @@ def _describe_vpc_peering_connections(params):continueitems += f"""<item><vpcPeeringConnectionId>{pcx['VpcPeeringConnectionId']}</vpcPeeringConnectionId>- <requesterVpcInfo><vpcId>{pcx['RequesterVpcInfo']['VpcId']}</vpcId><ownerId>{pcx['RequesterVpcInfo']['OwnerId']}</ownerId></requesterVpcInfo>- <accepterVpcInfo><vpcId>{pcx['AccepterVpcInfo']['VpcId']}</vpcId><ownerId>{pcx['AccepterVpcInfo']['OwnerId']}</ownerId></accepterVpcInfo>+ <requesterVpcInfo><vpcId>{pcx['RequesterVpcInfo']['VpcId']}</vpcId><ownerId>{pcx['RequesterVpcInfo']['OwnerId']}</ownerId><region>{pcx['RequesterVpcInfo']['Region']}</region></requesterVpcInfo>+ <accepterVpcInfo><vpcId>{pcx['AccepterVpcInfo']['VpcId']}</vpcId><ownerId>{pcx['AccepterVpcInfo']['OwnerId']}</ownerId><region>{pcx['AccepterVpcInfo']['Region']}</region></accepterVpcInfo><status><code>{pcx['Status']['Code']}</code><message>{pcx['Status']['Message']}</message></status><tagSet/></item>"""diff --git a/ministack/services/kinesis.py b/ministack/services/kinesis.pyindex 0c72214c..aa5c6780 100644--- a/ministack/services/kinesis.py+++ b/ministack/services/kinesis.py@@ -315,6 +315,19 @@ def _put_record(data):explicit_hash = data.get("ExplicitHashKey")if not partition_key:return error_response_json("ValidationException", "PartitionKey is required", 400)+ if len(partition_key) > 256:+ return error_response_json("ValidationException",+ "1 validation error detected: Value at 'partitionKey' failed to satisfy constraint: "+ "Member must have length less than or equal to 256", 400)+ if record_data:+ try:+ raw = base64.b64decode(record_data)+ except Exception:+ raw = record_data.encode() if isinstance(record_data, str) else record_data+ if len(raw) > 1_048_576:+ return error_response_json("ValidationException",+ "1 validation error detected: Value at 'data' failed to satisfy constraint: "+ "Member must have length less than or equal to 1048576", 400)hash_int = int(explicit_hash) if explicit_hash else _partition_key_to_hash(partition_key)shard_id = _route_to_shard(hash_int, stream)@@ -342,8 +355,35 @@ def _put_records(data):_expire_records(stream)+ records = data.get("Records", [])+ if len(records) > 500:+ return error_response_json("ValidationException",+ "1 validation error detected: Value at 'records' failed to satisfy constraint: "+ "Member must have length less than or equal to 500", 400)+ total_size = 0+ for rec in records:+ pk = rec.get("PartitionKey", "")+ rd = rec.get("Data", "")+ if len(pk) > 256:+ return error_response_json("ValidationException",+ "1 validation error detected: Value at 'partitionKey' failed to satisfy constraint: "+ "Member must have length less than or equal to 256", 400)+ try:+ raw = base64.b64decode(rd) if rd else b""+ except Exception:+ raw = rd.encode() if isinstance(rd, str) else rd+ rec_size = len(raw) + len(pk.encode())+ if len(raw) > 1_048_576:+ return error_response_json("ValidationException",+ "1 validation error detected: Value at 'data' failed to satisfy constraint: "+ "Member must have length less than or equal to 1048576", 400)+ total_size += rec_size+ if total_size > 5_242_880:+ return error_response_json("ValidationException",+ "Records total payload size exceeds 5 MB limit", 400)+results = []- for rec in data.get("Records", []):+ for rec in records:pk = rec.get("PartitionKey", "")rd = rec.get("Data", "")eh = rec.get("ExplicitHashKey")diff --git a/ministack/services/lambda_svc.py b/ministack/services/lambda_svc.pyindex 45afeddf..7d56eb69 100644--- a/ministack/services/lambda_svc.py+++ b/ministack/services/lambda_svc.py@@ -42,6 +42,7 @@ from typing import Anyfrom urllib.parse import unquotefrom ministack.core.responses import error_response_json, json_response, new_uuid+from ministack.core.lambda_runtime import get_or_create_worker, invalidate_workerlogger = logging.getLogger("lambda")@@ -718,6 +719,7 @@ def _delete_function(name: str, query_params: dict):_functions[name]["versions"].pop(qualifier, None)else:del _functions[name]+ invalidate_worker(name)return 204, {}, b""@@ -734,6 +736,12 @@ def _update_code(name: str, data: dict):code_zip = base64.b64decode(data["ZipFile"])elif "S3Bucket" in data and "S3Key" in data:code_zip = _fetch_code_from_s3(data["S3Bucket"], data["S3Key"])+ if code_zip is None:+ return error_response_json(+ "InvalidParameterValueException",+ f"Failed to fetch code from s3://{data['S3Bucket']}/{data['S3Key']}",+ 400,+ )if code_zip:func["code_zip"] = code_zipfunc["config"]["CodeSize"] = len(code_zip)@@ -744,6 +752,9 @@ def _update_code(name: str, data: dict):func["config"]["LastUpdateStatus"] = "Successful"func["config"]["RevisionId"] = new_uuid()+ # Invalidate warm worker so next invocation picks up the new code+ invalidate_worker(name)+if data.get("Publish"):ver_num = func["next_version"]func["next_version"] = ver_num + 1@@ -972,6 +983,8 @@ def _execute_function_docker(func: dict, event: dict) -> dict:lzf.extractall(layer_dir)layers_dirs.append(layer_dir)+ if "." not in handler:+ return {"body": {"errorMessage": f"Invalid handler format: {handler}", "errorType": "Runtime.InvalidEntrypoint"}, "error": True}module_name, func_name = handler.rsplit(".", 1)# Build volume mounts@@ -1104,8 +1117,6 @@ def _execute_function(func: dict, event: dict) -> dict:def _execute_function_warm(func: dict, event: dict) -> dict:"""Execute a Lambda function using the warm worker pool (Python + Node.js)."""- from ministack.core.lambda_runtime import get_or_create_worker-config = func.get("config") or funccode_zip = func.get("code_zip")if not code_zip:@@ -1180,6 +1191,8 @@ def _execute_function_local(func: dict, event: dict) -> dict:lzf.extractall(layer_dir)layers_dirs.append(layer_dir)+ if "." not in handler:+ return {"body": {"errorMessage": f"Invalid handler format: {handler}", "errorType": "Runtime.InvalidEntrypoint"}, "error": True}module_name, func_name = handler.rsplit(".", 1)if is_node:@@ -1322,7 +1335,7 @@ def _publish_version(name: str, data: dict):ver_config = copy.deepcopy(func["config"])ver_config["Version"] = str(ver_num)- ver_config["FunctionArn"] = f"{_func_arn(name)}:{ver_num}"+ ver_config["FunctionArn"] = _func_arn(name)ver_config["RevisionId"] = new_uuid()if data.get("Description"):ver_config["Description"] = data["Description"]@@ -2204,6 +2217,7 @@ def _delete_esm(esm_id: str):_kinesis_positions: dict = {}# Per-ESM DynamoDB stream tracking: esm_uuid -> {shard_id: position}_dynamodb_stream_positions: dict = {}+_dynamodb_stream_positions_lock = threading.Lock()def _ensure_poller():@@ -2418,14 +2432,15 @@ def _poll_dynamodb_streams():continueesm_id = esm["UUID"]- if esm_id not in _dynamodb_stream_positions:- starting = esm.get("StartingPosition", "LATEST")- if starting == "TRIM_HORIZON":- _dynamodb_stream_positions[esm_id] = 0- else:- _dynamodb_stream_positions[esm_id] = len(table_records)+ with _dynamodb_stream_positions_lock:+ if esm_id not in _dynamodb_stream_positions:+ starting = esm.get("StartingPosition", "LATEST")+ if starting == "TRIM_HORIZON":+ _dynamodb_stream_positions[esm_id] = 0+ else:+ _dynamodb_stream_positions[esm_id] = len(table_records)+ pos = _dynamodb_stream_positions[esm_id]- pos = _dynamodb_stream_positions[esm_id]batch_size = esm.get("BatchSize", 100)batch = table_records[pos:pos + batch_size]if not batch:@@ -2444,7 +2459,8 @@ def _poll_dynamodb_streams():func_name, table_name, err_type, err_msg, result.get("log", ""),)else:- _dynamodb_stream_positions[esm_id] = pos + len(batch)+ with _dynamodb_stream_positions_lock:+ _dynamodb_stream_positions[esm_id] = pos + len(batch)esm["LastProcessingResult"] = f"OK - {len(batch)} records"logger.info("ESM: Lambda %s processed %d DynamoDB stream records from %s",@@ -2470,7 +2486,7 @@ def _create_function_url_config(func_name: str, data: dict, qualifier: str | Non"ResourceConflictException", f"Function URL config already exists for {func_name}", 409)cfg = {- "FunctionUrl": f"https://{new_uuid()}.lambda-url.us-east-1.on.aws/",+ "FunctionUrl": f"https://{new_uuid()}.lambda-url.{REGION}.on.aws/","FunctionArn": _func_arn(func_name),"AuthType": data.get("AuthType", "NONE"),"Cors": data.get("Cors", {}),diff --git a/ministack/services/rds.py b/ministack/services/rds.pyindex 60d9c5bf..3f77be25 100644--- a/ministack/services/rds.py+++ b/ministack/services/rds.py@@ -99,7 +99,7 @@ def _create_db_instance(p):if not db_id:return _error("MissingParameter", "DBInstanceIdentifier is required", 400)if db_id in _instances:- return _error("DBInstanceAlreadyExists", f"DB instance {db_id} already exists", 400)+ return _error("DBInstanceAlreadyExistsFault", f"DB instance {db_id} already exists", 400)engine = _p(p, "Engine") or "postgres"engine_version = _p(p, "EngineVersion") or _default_engine_version(engine)@@ -407,7 +407,7 @@ def _create_read_replica(p):if not source:return _error("DBInstanceNotFound", f"DBInstance {source_id} not found.", 404)if replica_id in _instances:- return _error("DBInstanceAlreadyExists", f"DBInstance {replica_id} already exists.", 400)+ return _error("DBInstanceAlreadyExistsFault", f"DBInstance {replica_id} already exists.", 400)arn = f"arn:aws:rds:{REGION}:{ACCOUNT_ID}:db:{replica_id}"replica = dict(source)@@ -448,7 +448,7 @@ def _restore_from_snapshot(p):snap_id = _p(p, "DBSnapshotIdentifier")if db_id in _instances:- return _error("DBInstanceAlreadyExists", f"DBInstance {db_id} already exists.", 400)+ return _error("DBInstanceAlreadyExistsFault", f"DBInstance {db_id} already exists.", 400)snap = _snapshots.get(snap_id)if not snap:diff --git a/ministack/services/sns.py b/ministack/services/sns.pyindex 50f06bdb..56bf4e84 100644--- a/ministack/services/sns.py+++ b/ministack/services/sns.py@@ -219,11 +219,14 @@ def _subscribe(params):},}+ allowed_attrs = {"DeliveryPolicy", "FilterPolicy", "FilterPolicyScope",+ "RawMessageDelivery", "RedrivePolicy"}i = 1while _p(params, f"Attributes.entry.{i}.key"):key = _p(params, f"Attributes.entry.{i}.key")val = _p(params, f"Attributes.entry.{i}.value")- sub["attributes"][key] = val+ if key in allowed_attrs:+ sub["attributes"][key] = val or ""i += 1topic["subscriptions"].append(sub)diff --git a/pyproject.toml b/pyproject.tomlindex f575733c..06b702be 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"[project]name = "ministack"-version = "1.1.17"+version = "1.1.18"description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"readme = "README.md"license = { file = "LICENSE" }diff --git a/tests/test_services.py b/tests/test_services.pyindex a974cb07..1cac4a86 100644--- a/tests/test_services.py+++ b/tests/test_services.py@@ -80,6 +80,36 @@ def test_s3_put_object_no_bucket(s3):assert exc.value.response["Error"]["Code"] == "NoSuchBucket"+def test_s3_put_get_json_chunked(s3):+ """AWS SDK v2 sends PutObject with chunked Transfer-Encoding — body must be decoded cleanly."""+ import urllib.request, urllib.parse, json as _json+ bucket = "intg-s3-chunked"+ s3.create_bucket(Bucket=bucket)++ payload = _json.dumps({"hello": "world", "number": 42})+ # Simulate AWS chunked encoding: one chunk + terminator+ chunk_body = payload.encode()+ chunk_size = f"{len(chunk_body):x}".encode()+ fake_sig = b"abc123"+ chunked = (+ chunk_size + b";chunk-signature=" + fake_sig + b"\r\n" ++ chunk_body + b"\r\n" ++ b"0;chunk-signature=" + fake_sig + b"\r\n\r\n"+ )+ endpoint = "http://localhost:4566/" + bucket + "/test.json"+ req = urllib.request.Request(endpoint, data=chunked, method="PUT", headers={+ "x-amz-content-sha256": "STREAMING-AWS4-HMAC-SHA256-PAYLOAD",+ "Content-Type": "application/json",+ "Authorization": "AWS4-HMAC-SHA256 Credential=test/20240101/us-east-1/s3/aws4_request, SignedHeaders=host, Signature=fake",+ })+ with urllib.request.urlopen(req) as r:+ assert r.status == 200++ resp = s3.get_object(Bucket=bucket, Key="test.json")+ body = resp["Body"].read().decode()+ assert _json.loads(body) == {"hello": "world", "number": 42}++def test_s3_head_object(s3):s3.create_bucket(Bucket="intg-s3-headobj")s3.put_object(@@ -351,6 +381,31 @@ def test_s3_control_list_tags_for_resource(s3):assert tags.get("name") == "ministack-test"+def test_s3_control_list_tags_via_s3_control_host(s3):+ """S3 Control requests via s3-control.localhost host must not be intercepted by S3 vhost."""+ import urllib.request, urllib.parse+ bkt = "intg-s3control-host"+ s3.create_bucket(Bucket=bkt)+ s3.put_bucket_tagging(+ Bucket=bkt,+ Tagging={"TagSet": [{"Key": "env", "Value": "test"}]},+ )+ arn = urllib.parse.quote(f"arn:aws:s3:::{bkt}", safe="")+ req = urllib.request.Request(+ f"http://localhost:4566/v20180820/tags/{arn}",+ method="GET",+ headers={+ "x-amz-account-id": "000000000000",+ "Host": "s3-control.localhost:4566",+ },+ )+ with urllib.request.urlopen(req) as r:+ assert r.status == 200+ body = r.read().decode()+ assert "env" in body+ assert "test" in body++def test_s3_bucket_policy(s3):bkt = "intg-s3-policy"s3.create_bucket(Bucket=bkt)@@ -1265,21 +1320,31 @@ def test_sns_subscription_attributes(sns):assert resp["Attributes"]["RawMessageDelivery"] == "true"-def test_sns_subscribe_with_attributes(sns):- arn = sns.create_topic(Name="intg-sns-subwithattr")["TopicArn"]+def test_sns_subscribe_with_raw_message_delivery(sns):+ arn = sns.create_topic(Name="intg-sns-sub-raw")["TopicArn"]sub = sns.subscribe(TopicArn=arn,- Protocol="sqs",- Endpoint="arn:aws:sqs:us-east-1:000000000000:intg-sns-subwithattr-q",- Attributes={- "RawMessageDelivery": "true",- "FilterPolicy": json.dumps({"event": ["OrderCreated"]}),- },+ Protocol="email",+ Endpoint="[email protected]",+ Attributes={"RawMessageDelivery": "true"},)sub_arn = sub["SubscriptionArn"]- resp = sns.get_subscription_attributes(SubscriptionArn=sub_arn)- assert resp["Attributes"]["RawMessageDelivery"] == "true"- assert json.loads(resp["Attributes"]["FilterPolicy"]) == {"event": ["OrderCreated"]}+ attrs = sns.get_subscription_attributes(SubscriptionArn=sub_arn)["Attributes"]+ assert attrs["RawMessageDelivery"] == "true"+++def test_sns_subscribe_with_filter_policy(sns):+ arn = sns.create_topic(Name="intg-sns-sub-filter")["TopicArn"]+ filter_policy = json.dumps({"event": ["MyEvent"]})+ sub = sns.subscribe(+ TopicArn=arn,+ Protocol="email",+ Endpoint="[email protected]",+ Attributes={"FilterPolicy": filter_policy},+ )+ sub_arn = sub["SubscriptionArn"]+ attrs = sns.get_subscription_attributes(SubscriptionArn=sub_arn)["Attributes"]+ assert attrs["FilterPolicy"] == filter_policydef test_sns_sqs_fanout_raw_message_delivery(sns, sqs):@@ -6093,6 +6158,182 @@ def test_lambda_nodejs_update_code(lam):assert payload["body"] == "v2"+# ========== Lambda — S3 code fetch ==========++def test_lambda_create_from_s3(lam, s3):+ bucket = "lambda-code-bucket"+ s3.create_bucket(Bucket=bucket)+ buf = io.BytesIO()+ with zipfile.ZipFile(buf, "w") as zf:+ zf.writestr("index.py", "def handler(event, context): return {'s3': True}")+ s3.put_object(Bucket=bucket, Key="fn.zip", Body=buf.getvalue())++ lam.create_function(+ FunctionName="lam-s3-code",+ Runtime="python3.11",+ Role=_LAMBDA_ROLE,+ Handler="index.handler",+ Code={"S3Bucket": bucket, "S3Key": "fn.zip"},+ )+ resp = lam.invoke(FunctionName="lam-s3-code", Payload=b"{}")+ assert resp["StatusCode"] == 200+ assert json.loads(resp["Payload"].read())["s3"] is True+++def test_lambda_update_code_from_s3(lam, s3):+ bucket = "lambda-code-bucket"+ buf = io.BytesIO()+ with zipfile.ZipFile(buf, "w") as zf:+ zf.writestr("index.py", "def handler(event, context): return {'v': 's3v2'}")+ s3.put_object(Bucket=bucket, Key="fn-v2.zip", Body=buf.getvalue())++ lam.update_function_code(+ FunctionName="lam-s3-code",+ S3Bucket=bucket,+ S3Key="fn-v2.zip",+ )+ resp = lam.invoke(FunctionName="lam-s3-code", Payload=b"{}")+ assert json.loads(resp["Payload"].read())["v"] == "s3v2"+++def test_lambda_update_code_s3_missing_returns_error(lam):+ from botocore.exceptions import ClientError+ with pytest.raises(ClientError) as exc:+ lam.update_function_code(+ FunctionName="lam-s3-code",+ S3Bucket="lambda-code-bucket",+ S3Key="does-not-exist.zip",+ )+ assert exc.value.response["Error"]["Code"] == "InvalidParameterValueException"+++# ========== Lambda — versioning ==========++def test_lambda_publish_version(lam):+ code = "def handler(event, context): return {'ver': 1}"+ lam.create_function(+ FunctionName="lam-versioned",+ Runtime="python3.11",+ Role=_LAMBDA_ROLE,+ Handler="index.handler",+ Code={"ZipFile": _make_zip(code)},+ Publish=True,+ )+ resp = lam.list_versions_by_function(FunctionName="lam-versioned")+ versions = [v["Version"] for v in resp["Versions"]]+ assert "$LATEST" in versions+ assert any(v != "$LATEST" for v in versions)+++def test_lambda_update_code_publish_version(lam):+ # Ensure function exists (may have been cleaned up)+ try:+ lam.get_function(FunctionName="lam-versioned")+ except Exception:+ lam.create_function(+ FunctionName="lam-versioned",+ Runtime="python3.11",+ Role=_LAMBDA_ROLE,+ Handler="index.handler",+ Code={"ZipFile": _make_zip("def handler(event, context): return {'ver': 1}")},+ Publish=True,+ )+ v2 = "def handler(event, context): return {'ver': 2}"+ lam.update_function_code(+ FunctionName="lam-versioned",+ ZipFile=_make_zip(v2),+ Publish=True,+ )+ resp = lam.list_versions_by_function(FunctionName="lam-versioned")+ versions = [v["Version"] for v in resp["Versions"] if v["Version"] != "$LATEST"]+ assert len(versions) >= 1+++# ========== Lambda — Node.js promise and callback handlers ==========++def test_lambda_nodejs_promise_handler(lam):+ code = (+ "exports.handler = (event) => Promise.resolve({ promise: true, val: event.x });"+ )+ lam.create_function(+ FunctionName="lam-node-promise",+ Runtime="nodejs20.x",+ Role=_LAMBDA_ROLE,+ Handler="index.handler",+ Code={"ZipFile": _make_zip_js(code, "index.js")},+ )+ resp = lam.invoke(FunctionName="lam-node-promise", Payload=json.dumps({"x": 42}))+ payload = json.loads(resp["Payload"].read())+ assert payload["promise"] is True+ assert payload["val"] == 42+++def test_lambda_nodejs_callback_handler(lam):+ code = (+ "exports.handler = (event, context, cb) => cb(null, { cb: true, val: event.y });"+ )+ lam.create_function(+ FunctionName="lam-node-cb",+ Runtime="nodejs20.x",+ Role=_LAMBDA_ROLE,+ Handler="index.handler",+ Code={"ZipFile": _make_zip_js(code, "index.js")},+ )+ resp = lam.invoke(FunctionName="lam-node-cb", Payload=json.dumps({"y": 7}))+ payload = json.loads(resp["Payload"].read())+ assert payload["cb"] is True+ assert payload["val"] == 7+++# ========== Lambda — DynamoDB Streams ESM ==========++def test_lambda_dynamodb_stream_esm(lam, ddb):+ # Create table with streams enabled+ ddb.create_table(+ TableName="stream-test-table",+ KeySchema=[{"AttributeName": "pk", "KeyType": "HASH"}],+ AttributeDefinitions=[{"AttributeName": "pk", "AttributeType": "S"}],+ BillingMode="PAY_PER_REQUEST",+ StreamSpecification={"StreamEnabled": True, "StreamViewType": "NEW_AND_OLD_IMAGES"},+ )+ stream_arn = ddb.describe_table(TableName="stream-test-table")["Table"]["LatestStreamArn"]++ # Create Lambda that captures stream records+ code = "def handler(event, context): return len(event['Records'])"+ lam.create_function(+ FunctionName="lam-ddb-stream",+ Runtime="python3.11",+ Role=_LAMBDA_ROLE,+ Handler="index.handler",+ Code={"ZipFile": _make_zip(code)},+ )++ esm = lam.create_event_source_mapping(+ FunctionName="lam-ddb-stream",+ EventSourceArn=stream_arn,+ StartingPosition="TRIM_HORIZON",+ BatchSize=10,+ )+ assert esm["EventSourceArn"] == stream_arn+ assert esm["FunctionArn"].endswith("lam-ddb-stream")++ # Verify ESM is registered and retrievable+ esm_resp = lam.get_event_source_mapping(UUID=esm["UUID"])+ assert esm_resp["EventSourceArn"] == stream_arn+ assert esm_resp["StartingPosition"] == "TRIM_HORIZON"++ # Write items — stream should capture them+ ddb.put_item(TableName="stream-test-table", Item={"pk": {"S": "k1"}, "val": {"S": "v1"}})+ ddb.put_item(TableName="stream-test-table", Item={"pk": {"S": "k2"}, "val": {"S": "v2"}})+ ddb.delete_item(TableName="stream-test-table", Key={"pk": {"S": "k1"}})++ # Verify table still has expected state+ scan = ddb.scan(TableName="stream-test-table")+ pks = [item["pk"]["S"] for item in scan["Items"]]+ assert "k2" in pks+ assert "k1" not in pks++# ========== API Gateway execute-api data plane ==========@@ -11528,6 +11769,44 @@ def test_kinesis_stream_encryption(kin):assert desc2["EncryptionType"] == "NONE"+# ── Kinesis validation limits ────────────────────────────────────────────────++def test_kinesis_put_record_oversized(kin):+ kin.create_stream(StreamName="kin-limits", ShardCount=1)+ from botocore.exceptions import ClientError+ with pytest.raises(ClientError) as exc:+ kin.put_record(StreamName="kin-limits", Data=b"x" * (1024 * 1024 + 1), PartitionKey="pk")+ assert "1048576" in str(exc.value)+++def test_kinesis_put_record_partition_key_too_long(kin):+ from botocore.exceptions import ClientError+ with pytest.raises(ClientError) as exc:+ kin.put_record(StreamName="kin-limits", Data=b"ok", PartitionKey="k" * 257)+ assert "256" in str(exc.value)+++def test_kinesis_put_records_batch_over_500(kin):+ from botocore.exceptions import ClientError+ with pytest.raises(ClientError) as exc:+ kin.put_records(+ StreamName="kin-limits",+ Records=[{"Data": b"x", "PartitionKey": "pk"} for _ in range(501)],+ )+ assert "500" in str(exc.value)+++def test_kinesis_put_records_total_payload_over_5mb(kin):+ from botocore.exceptions import ClientError+ # 6 records of ~1MB each = ~6MB > 5MB limit+ with pytest.raises(ClientError) as exc:+ kin.put_records(+ StreamName="kin-limits",+ Records=[{"Data": b"x" * (1024 * 1024), "PartitionKey": "pk"} for _ in range(6)],+ )+ assert "5 MB" in str(exc.value)++# ---------------------------------------------------------------------------# STEP FUNCTIONS — edge cases# ---------------------------------------------------------------------------