Skip to content

Ministack: Free, open-source local AWS emulator - 60+ services, Terraform compatible, real databases. Free forever. MIT licensed.

release v1.5.25 (#2127)

Nahuel Nucerac7c009708e33
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1172b48b..5a70d459 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,33 +7,35 @@ Versioning follows [Semantic Versioning](https://semver.org/).
## [Unreleased]
+## [1.5.25] — 2026-10-10
+
### Added
- **CloudFormation — `AWS::IAM::User`** — templates with an IAM user now provision it with `Path`, `Groups`, `ManagedPolicyArns`, inline `Policies`, `LoginProfile`, `PermissionsBoundary` and `Tags`; every property updates in place except `UserName`, which replaces the user. `Ref` returns the user name and `Fn::GetAtt` returns `Arn`. IAM gains `PutUserPermissionsBoundary` and `DeleteUserPermissionsBoundary`, and `CreateUser` and `GetUser` carry the boundary. Reported by @gakuto-cw21.
- **DocumentDB** — a new service for the `docdb` API: `CreateDBCluster`, `CreateDBInstance`, `DescribeDBClusters`, `DescribeDBInstances`, `ModifyDBCluster`, `ModifyDBInstance`, `RebootDBInstance`, `StartDBCluster`, `StopDBCluster`, `FailoverDBCluster`, `DeleteDBCluster`, `DeleteDBInstance` and the tag operations. Each cluster runs a `documentdb-local` container serving the MongoDB protocol over TLS. Defaults follow AWS: engine `8.0.0`, port `27017`, the `default.docdb8.0` parameter group and `docdb.amazonaws.com` endpoints. The `docdb` client reaches it on the normal endpoint, and an unfiltered `DescribeDBClusters` or `DescribeDBInstances` lists RDS and DocumentDB together, as on AWS. Subnet and parameter groups are shared with RDS. CloudFormation provisions `AWS::DocDB::DBCluster`, `DBInstance`, `DBSubnetGroup` and `DBClusterParameterGroup`, and `AWS::SecretsManager::SecretTargetAttachment` accepts DocumentDB targets. Contributed by @xPTM1219.
- **CloudFormation — `AWS::Logs::MetricFilter`** — templates with a metric filter failed with `Unrecognized resource types`; the filter now provisions, updates in place and is replaced on a `FilterName` or `LogGroupName` change. Contributed by @iot-rocket.
- **DynamoDB — vector search** — `CreateTable` accepts `VectorIndexes`, `UpdateTable` takes `VectorIndexUpdates` (resource allocation, then backfilling, then `ACTIVE`), and `DescribeTable` reports them. `SearchVectors` scores with `COSINE`, `EUCLIDEAN` or `DOT_PRODUCT` at 32-bit float precision and filters on the `SearchSchema`. Writes are checked against each vector index, `INDEXES` capacity reports `VectorWriteRequestBytes` on single, batch and transactional writes, and a PartiQL `SELECT` or `Scan` on a vector index returns "Scan operation not supported on this index type". Backups record the indexes in `SourceTableFeatureDetails`, `RestoreTableFromBackup` and `RestoreTableToPointInTime` restore them or apply `VectorIndexOverride`, and `ImportTable` creates them from `TableCreationParameters`. Reported by @hicksy and the paritysuite.org project.
+- **S3 Tables — bucket and table configuration** — table bucket encryption, maintenance, policy, storage class and metrics; table encryption, maintenance, maintenance job status, policy and storage class; `RenameTable`; and `TagResource`, `UntagResource` and `ListTagsForResource`. Unset configurations return the documented defaults: SSE-S3, `STANDARD`, unreferenced file removal after 3 and 10 days, compaction at 512 MB with the `auto` strategy, and snapshot management keeping 1 snapshot for 120 hours.
+- **IoT — job and job execution events** — completed, canceled and deleted jobs and finished, removed or deleted executions publish to `$aws/events/job/...` and `$aws/events/jobExecution/...` when `UpdateEventConfigurations` enables them. Contributed by @iot-rocket.
+- **IoT — `UpdateJob`** — `PATCH /jobs/{jobId}` updates an `IN_PROGRESS` job's description, presigned URL, rollout, abort, timeout and retry configuration with AWS's checks; running executions keep their timeout. `CreateJob` refuses a bad timeout with the same message. Contributed by @iot-rocket.
+- **Signer — real signatures on the IoT platform** — when ACM holds the key of the profile's certificate, `StartSigningJob` on `AWSIoTDeviceManagement-SHA256-ECDSA` writes AWS's signed document instead of a JSON receipt, and an RSA key fails the job. Without a key the receipt stays and a warning is logged. Contributed by @iot-rocket.
### Fixed
- **ELBv2 — `http-header` rule conditions keep their `HttpHeaderConfig`** — the header name and values were dropped when a rule was created, modified or provisioned through CloudFormation, so `DescribeRules` returned an empty condition and requests never matched. Matching follows AWS: the header name and values compare case-insensitively, `*` and `?` are the only wildcards, and a request without the header does not match. Reported by @kinoh.
- **Firehose — dynamic partitioning and Parquet conversion on S3 delivery** — `PutRecord`, `PutRecordBatch` and Kinesis-sourced records ignored `DynamicPartitioningConfiguration` and `DataFormatConversionConfiguration`. The `Prefix` and `ErrorOutputPrefix` now evaluate `!{timestamp:...}`, `!{firehose:random-string}`, `!{firehose:error-output-type}`, `!{partitionKeyFromQuery:...}` (JQ `MetadataExtraction`) and `!{partitionKeyFromLambda:...}` (Lambda `metadata.partitionKeys`), with `yyyy/MM/dd/HH/` appended when the prefix has no timestamp. Records convert to Parquet against the Glue table schema with the configured compression and land as `<stream>-<version>-<timestamp>-<uuid>.parquet` or the `FileExtension`. Failed records go to the error prefix as AWS's error document under `processing-failed` or `format-conversion-failed`. Parquet output needs DuckDB (the full image); ORC is not supported. Reported by @mintel-hgli.
- **CloudWatch Logs — `DescribeMetricFilters` by metric** — `metricName` and `metricNamespace` now select the filters that publish that metric, `filterNamePrefix` applies only with `logGroupName`, and `DeleteLogGroup` removes the group's filters. Contributed by @iot-rocket.
-### Fixed
- **Cognito — `Username` is the `sub` in pools with `UsernameAttributes`** — `AdminCreateUser` and `SignUp` now use the `sub` as the `Username`, keep the email or phone number as an alias, and refuse a `Username` that is not a sign-in attribute, a differing email or phone attribute and a caller-supplied `sub`. Contributed by @iot-rocket.
-### Added
-- **IoT — job and job execution events** — completed, canceled and deleted jobs and finished, removed or deleted executions publish to `$aws/events/job/...` and `$aws/events/jobExecution/...` when `UpdateEventConfigurations` enables them. Contributed by @iot-rocket.
-- **IoT — `UpdateJob`** — `PATCH /jobs/{jobId}` updates an `IN_PROGRESS` job's description, presigned URL, rollout, abort, timeout and retry configuration with AWS's checks; running executions keep their timeout. `CreateJob` refuses a bad timeout with the same message. Contributed by @iot-rocket.
-- **Signer — real signatures on the IoT platform** — when ACM holds the key of the profile's certificate, `StartSigningJob` on `AWSIoTDeviceManagement-SHA256-ECDSA` writes AWS's signed document instead of a JSON receipt, and an RSA key fails the job. Without a key the receipt stays and a warning is logged. Contributed by @iot-rocket.
-### Fixed
-- **Error envelope Content-Types now match AWS per protocol** — real AWS picks an error's `Content-Type` from the service's protocol, and services disagree: `application/x-amz-json-1.1` for jsonVersion-1.1 services (Kinesis, KMS, Secrets Manager, Athena, Cognito, EventBridge, WAFv2, CloudWatch Logs) vs `1.0` (DynamoDB, Step Functions, SQS); `text/xml` for query services (IAM, SNS, RDS, CloudFormation) and `text/xml;charset=UTF-8` for EC2; `application/json` for rest-json (Lambda, AppSync, API Gateway) vs `application/x-amz-json-1.1` for SESv2; `text/xml` for rest-xml except S3's `application/xml`. Errors are now normalized at dispatch using the botocore service model plus wire-captured quirks. Evidence: real AWS wire captures diffed per probe (7/28 → 23/28 probes conforming).
-- **Unimplemented services no longer answered by S3** — a request whose SigV4 credential scope names a real AWS service MiniStack does not implement (e.g. Glacier, Pinpoint, Route53 Resolver) used to fall through to the S3 path catch-all and return `NoSuchBucket`. It now surfaces as `Unsupported service: <name>`. Evidence: same conformance run — `describe_vault`/`get_app` previously returned an S3 error body.
-- **CloudFormation error namespace** — `ErrorResponse` xmlns was `doc/2010-05-08/`; AWS emits `doc/2010-05-15/` (matches the botocore apiVersion).
-- **SESv2 error Content-Type** — errors now answer `application/x-amz-json-1.1`, matching the AWS capture (most rest-json services answer `application/json`; SESv2 does not).
-- **EC2 `DescribeInstances` validates ID format before existence** — a malformed `InstanceId` (e.g. `i-0000000000000000x`) now returns `InvalidInstanceID.Malformed`, matching the AWS capture; a well-formed unknown id still returns `InvalidInstanceID.NotFound`.
-- **ELBv2 `DescribeLoadBalancers` validates name length before existence** — a `Names` entry over 32 characters returns `ValidationError`, matching the AWS capture.
-- **WAFv2 `GetWebACL` validates the `Id` shape before existence** — a non-UUID or >36-char `Id` returns `ValidationException` listing the failed constraints, matching the AWS capture; a well-formed unknown id still returns `WAFNonexistentItemException`.
+- **Athena — S3 Tables, Glue table data and result shapes** — queries reach S3 Tables as `"s3tablescatalog/<bucket>".<namespace>.<table>` or through `QueryExecutionContext.Catalog`. Glue tables read every object under their `LOCATION` from the S3 store without `S3_PERSIST`, skipping files and folders that start with `_` or `.`; CSV columns map to the Glue schema by position with the SerDe delimiter and `skip.header.line.count`, and Avro tables are readable. `StartQueryExecution` without a result location returns `InvalidRequestException`, and `GetQueryResults` returns `NULL` as a `Datum` without `VarCharValue`.
+- **Athena — partitioned Glue tables and qualified columns** — partition columns take their Glue types instead of the types DuckDB inferred from the path, and `db.table.column` references resolve. Contributed by @mayuriphad. Reported by @mintel-hgli.
+- **Error responses use each protocol's `Content-Type`** — `application/x-amz-json-1.1` or `1.0` for JSON services by their `jsonVersion`, `text/xml` for query services (`text/xml;charset=UTF-8` for EC2), `application/json` for rest-json except SESv2 (`application/x-amz-json-1.1`), and `text/xml` for rest-xml except S3 (`application/xml`). Errors are normalized at dispatch from the botocore service model. Contributed by @pingedbrain.
+- **Unimplemented services no longer answered by S3** — a request signed for a service MiniStack does not implement (for example Glacier or Pinpoint) fell through to S3 and returned `NoSuchBucket`; it now returns `Unsupported service: <name>`. Contributed by @pingedbrain.
+- **CloudFormation — error namespace** — `ErrorResponse` uses `http://cloudformation.amazonaws.com/doc/2010-05-15/`, the botocore API version, instead of `2010-05-08`. Contributed by @pingedbrain.
+- **EC2 — `DescribeInstances` checks the ID format first** — a malformed `InstanceId` returns `InvalidInstanceID.Malformed`; a well-formed unknown ID still returns `InvalidInstanceID.NotFound`. Contributed by @pingedbrain.
+- **ELBv2 — `DescribeLoadBalancers` checks name length first** — a `Names` entry over 32 characters returns `ValidationError`. Contributed by @pingedbrain.
+- **WAFv2 — `GetWebACL` checks the `Id` first** — an `Id` that is not a UUID or is longer than 36 characters returns `ValidationException` listing the failed constraints; a well-formed unknown ID still returns `WAFNonexistentItemException`. Contributed by @pingedbrain.
+- **Docker images fall back to public mirrors** — when a Docker Hub pull fails, MiniStack retries from ECR Public and then `mirror.gcr.io` and tags the image with the requested name, so a Docker Hub rate limit no longer stops RDS, ElastiCache, ECS and the other container-backed services.
- **Step Functions — optimized DynamoDB error names** — conditional failures and other service errors now use the `DynamoDB.` prefix so exact `Catch` and `Retry` handlers match AWS. Contributed by @jayjanssen.
- **Step Functions — Lambda `GetFunction` SDK integration** — workflows can read function configuration, code metadata and tags through `aws-sdk:lambda:getFunction`, including qualified reads. Contributed by @jayjanssen.
-- **Secrets Manager — force delete of a secret scheduled for deletion** — `DeleteSecret` with `ForceDeleteWithoutRecovery` returned `InvalidRequestException` for a secret already scheduled for deletion. It now deletes the secret permanently. Reported by @fabio-andre-rodrigues.
+- **Secrets Manager — force delete of a secret scheduled for deletion** — `DeleteSecret` with `ForceDeleteWithoutRecovery` returned `InvalidRequestException` for a secret already scheduled for deletion. It now deletes the secret permanently. Contributed by @fabio-andre-rodrigues.
- **DynamoDB — `RestoreTableToPointInTime` keeps secondary indexes** — the restored table now carries the source table's GSIs and LSIs, or `GlobalSecondaryIndexOverride` / `LocalSecondaryIndexOverride` when given.
- **DynamoDB — item size limits per operation** — numbers are sized as base-100 digit pairs, so the 400 KB limit is exact to the byte. `UpdateItem` counts only the attributes it writes plus a cost per clause and answers "Item size to update has exceeded the maximum allowed size". PartiQL `INSERT` and `UPDATE` now enforce the limit, and an oversized transacted `Update` cancels the transaction. Reported by @hicksy and the paritysuite.org project.
- **DynamoDB — nesting depth and key length** — values nested beyond 32 levels return "Nesting Levels have exceeded supported limits: Attributes in the item have nested levels beyond supported limit", including in `UpdateItem` and `TransactWriteItems` expression values. Over-long keys are refused on reads too. Reported by @hicksy and the paritysuite.org project.
diff --git a/README.md b/README.md
index 03d59d74..e4b9f26b 100644
--- a/README.md
+++ b/README.md
@@ -628,8 +628,8 @@ MiniStack expands AWS SAM transforms (`Transform: AWS::Serverless-2016-10-31`) i
| **Aurora DSQL** | CreateCluster, GetCluster, UpdateCluster, DeleteCluster, ListClusters, PutClusterPolicy, GetClusterPolicy, DeleteClusterPolicy, CreateStream, GetStream, ListStreams, DeleteStream, GetVpcEndpointServiceName, TagResource, UntagResource, ListTagsForResource | `CreateCluster` spins up a real `postgres:16-alpine` Docker container fronted by a validating PG wire-protocol proxy that **fails like real DSQL** — rejects unsupported SQL (`serial`, extensions, temp tables, ...), accepts `CREATE INDEX ASYNC` + `sys.jobs`; endpoint is `localhost:<port>`; any password accepted |
| **ElastiCache** | CreateCacheCluster, DeleteCacheCluster, DescribeCacheClusters, ModifyCacheCluster, RebootCacheCluster, CreateReplicationGroup, DeleteReplicationGroup, DescribeReplicationGroups, ModifyReplicationGroup, IncreaseReplicaCount, DecreaseReplicaCount, CreateCacheSubnetGroup, DescribeCacheSubnetGroups, ModifyCacheSubnetGroup, DeleteCacheSubnetGroup, CreateCacheParameterGroup, DescribeCacheParameterGroups, ModifyCacheParameterGroup, ResetCacheParameterGroup, DeleteCacheParameterGroup, DescribeCacheParameters, DescribeCacheEngineVersions, CreateUser, DescribeUsers, DeleteUser, ModifyUser, CreateUserGroup, DescribeUserGroups, DeleteUserGroup, ModifyUserGroup, ListTagsForResource, AddTagsToResource, RemoveTagsFromResource, CreateSnapshot, DeleteSnapshot, DescribeSnapshots, CreateServerlessCache, DescribeServerlessCaches, ModifyServerlessCache, DeleteServerlessCache, DescribeEvents | `CreateCacheCluster` spins up a real Redis, Valkey, or Memcached Docker container (`Engine=redis`/`valkey`/`memcached`); a serverless cache gets a TLS-only, single-shard cluster-mode Valkey/Redis container whose certificate chains to the CA at `GET /_ministack/elasticache/ca.pem` |
| **Glue** | CreateDatabase, DeleteDatabase, GetDatabase, GetDatabases, UpdateDatabase, CreateTable, DeleteTable, GetTable, GetTables, UpdateTable, BatchDeleteTable, CreatePartition, DeletePartition, GetPartition, GetPartitions, BatchCreatePartition, BatchGetPartition, CreatePartitionIndex, GetPartitionIndexes, GetColumnStatisticsForTable, UpdateColumnStatisticsForTable, DeleteColumnStatisticsForTable, GetColumnStatisticsForPartition, UpdateColumnStatisticsForPartition, DeleteColumnStatisticsForPartition, CreateConnection, DeleteConnection, GetConnection, GetConnections, CreateCrawler, DeleteCrawler, GetCrawler, GetCrawlers, UpdateCrawler, StartCrawler, StopCrawler, GetCrawlerMetrics, CreateJob, DeleteJob, GetJob, GetJobs, UpdateJob, StartJobRun, GetJobRun, GetJobRuns, BatchStopJobRun, CreateTrigger, GetTrigger, DeleteTrigger, UpdateTrigger, StartTrigger, StopTrigger, ListTriggers, BatchGetTriggers, GetTriggers, CreateWorkflow, GetWorkflow, DeleteWorkflow, UpdateWorkflow, StartWorkflowRun, CreateUserDefinedFunction, UpdateUserDefinedFunction, DeleteUserDefinedFunction, GetUserDefinedFunction, GetUserDefinedFunctions, CreateSecurityConfiguration, DeleteSecurityConfiguration, GetSecurityConfiguration, GetSecurityConfigurations, CreateClassifier, GetClassifier, GetClassifiers, DeleteClassifier, TagResource, UntagResource, GetTags | Python shell jobs actually execute via subprocess; Spark jobs run on the official `amazon/aws-glue-libs` PySpark image (`GlueVersion: 4.0` / `3.0`) on MiniStack's Docker network; Glue-backed Iceberg REST catalog at `/iceberg` (signed with the `glue` credential scope, prefix `catalogs/{catalog}`) — read path for tables whose `metadata_location` parameter points at a metadata.json on MiniStack S3, e.g. DuckDB `ATTACH ... (TYPE iceberg, ENDPOINT 'localhost:4566/iceberg', AUTHORIZATION_TYPE 'sigv4')` with `USE_SSL=1` |
-| **S3 Tables** | CreateTableBucket, ListTableBuckets, GetTableBucket, DeleteTableBucket, CreateNamespace, ListNamespaces, GetNamespace, DeleteNamespace, CreateTable, ListTables, GetTable, DeleteTable, GetTableMetadataLocation, UpdateTableMetadataLocation | Iceberg-format tables; embedded Iceberg REST catalog at `/iceberg` so Spark jobs (`spark.sql.catalog.*.type=rest`) can create / load / commit without an external catalog, each catalog scoped to the table bucket ARN in its prefix and commits checked against their update requirements; data files in S3, metadata in memory |
-| **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, GetDatabase, ListDatabases, GetTableMetadata, ListTableMetadata, TagResource, UntagResource, ListTagsForResource | Real SQL via **DuckDB** when installed (`pip install duckdb`), otherwise returns mock results; databases and tables come from the Glue Data Catalog, and `CREATE EXTERNAL TABLE` / `DROP TABLE` change it; result pagination; column type metadata |
+| **S3 Tables** | CreateTableBucket, ListTableBuckets, GetTableBucket, DeleteTableBucket, CreateNamespace, ListNamespaces, GetNamespace, DeleteNamespace, CreateTable, ListTables, GetTable, DeleteTable, GetTableMetadataLocation, UpdateTableMetadataLocation, RenameTable, GetTableBucketEncryption, PutTableBucketEncryption, DeleteTableBucketEncryption, GetTableBucketMaintenanceConfiguration, PutTableBucketMaintenanceConfiguration, GetTableBucketPolicy, PutTableBucketPolicy, DeleteTableBucketPolicy, GetTableBucketStorageClass, PutTableBucketStorageClass, GetTableBucketMetricsConfiguration, PutTableBucketMetricsConfiguration, DeleteTableBucketMetricsConfiguration, GetTableEncryption, GetTableStorageClass, GetTableMaintenanceConfiguration, PutTableMaintenanceConfiguration, GetTableMaintenanceJobStatus, GetTablePolicy, PutTablePolicy, DeleteTablePolicy, TagResource, UntagResource, ListTagsForResource | Iceberg-format tables; unset encryption, storage class and maintenance return the documented defaults; embedded Iceberg REST catalog at `/iceberg` so Spark jobs (`spark.sql.catalog.*.type=rest`) can create / load / commit without an external catalog, each catalog scoped to the table bucket ARN in its prefix and commits checked against their update requirements; data files in S3, metadata in memory |
+| **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, GetDatabase, ListDatabases, GetTableMetadata, ListTableMetadata, TagResource, UntagResource, ListTagsForResource | Real SQL via **DuckDB** when installed (`pip install duckdb`), otherwise returns mock results; databases and tables come from the Glue Data Catalog, and `CREATE EXTERNAL TABLE` / `DROP TABLE` change it; S3 Tables are queryable as `"s3tablescatalog/<bucket>".<namespace>.<table>`; partitioned Glue tables keep their Glue partition types; 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`; `DeliveryStreamType=KinesisStreamAsSource` consumes records from the source Kinesis stream on `PutRecord` / `PutRecords` and forwards them to the configured S3 destination, honoring `Prefix` and `DeliveryStartTimestamp`; `ProcessingConfiguration.Processors[].Type=Lambda` invoked per-batch with the AWS-shape event (`{invocationId, deliveryStreamArn, region, records:[{recordId, approximateArrivalTimestamp, data}]}`) — `Ok` records ship the transformed data downstream, `Dropped`/`ProcessingFailed` are omitted, Lambda failures pass records through unchanged (best-effort per AWS); S3 prefixes evaluate timestamp, random-string, error-output-type and dynamic partition keys (JQ `MetadataExtraction` or Lambda `partitionKeys`); `DataFormatConversionConfiguration` writes Parquet from the Glue schema (DuckDB, full image) |
| **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, DescribeInstanceAttribute, DescribeInstanceTypes, DescribeVpcAttribute, TerminateInstances, StopInstances, StartInstances, RebootInstances, AssociateIamInstanceProfile, DescribeIamInstanceProfileAssociations, DisassociateIamInstanceProfile, ReplaceIamInstanceProfileAssociation, DescribeImages, RegisterImage, DeregisterImage, ModifyImageAttribute, DescribeImageAttribute, ResetImageAttribute, CreateSecurityGroup, DeleteSecurityGroup, DescribeSecurityGroups, AuthorizeSecurityGroupIngress, RevokeSecurityGroupIngress, AuthorizeSecurityGroupEgress, RevokeSecurityGroupEgress, DescribeSecurityGroupRules, CreateKeyPair, DeleteKeyPair, DescribeKeyPairs, ImportKeyPair, CreatePlacementGroup, DeletePlacementGroup, DescribePlacementGroups, CreateVpc, DeleteVpc, DescribeVpcs, ModifyVpcAttribute, CreateSubnet, DeleteSubnet, DescribeSubnets, ModifySubnetAttribute, CreateInternetGateway, DeleteInternetGateway, DescribeInternetGateways, AttachInternetGateway, DetachInternetGateway, CreateRouteTable, DeleteRouteTable, DescribeRouteTables, AssociateRouteTable, DisassociateRouteTable, ReplaceRouteTableAssociation, CreateRoute, ReplaceRoute, DeleteRoute, CreateNetworkInterface, DeleteNetworkInterface, DescribeNetworkInterfaces, AttachNetworkInterface, DetachNetworkInterface, CreateVpcEndpoint, DeleteVpcEndpoints, DescribeVpcEndpoints, ModifyVpcEndpoint, DescribePrefixLists, DescribeAvailabilityZones, AllocateAddress, ReleaseAddress, AssociateAddress, DisassociateAddress, DescribeAddresses, DescribeAddressesAttribute, 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, CreateManagedPrefixList, DescribeManagedPrefixLists, GetManagedPrefixListEntries, ModifyManagedPrefixList, DeleteManagedPrefixList, CreateVpnGateway, DescribeVpnGateways, AttachVpnGateway, DetachVpnGateway, DeleteVpnGateway, EnableVgwRoutePropagation, DisableVgwRoutePropagation, CreateCustomerGateway, DescribeCustomerGateways, DeleteCustomerGateway, DescribeInstanceCreditSpecifications, DescribeInstanceMaintenanceOptions, DescribeInstanceAutoRecoveryAttribute, ModifyInstanceMaintenanceOptions, DescribeInstanceTopology, DescribeSpotInstanceRequests, DescribeCapacityReservations, DescribeInstanceStatus, DescribeVpcClassicLink, DescribeVpcClassicLinkDnsSupport, CreateLaunchTemplate, CreateLaunchTemplateVersion, DescribeLaunchTemplates, DescribeLaunchTemplateVersions, ModifyLaunchTemplate, DeleteLaunchTemplate, CreateFleet, DescribeFleets | 133 actions; EC2 Fleet (`CreateFleet` / `DescribeFleets`) with `instant`-type synchronous launch and `maintain` / `request` async fulfillment, multi-config × multi-override round-robin capacity distribution, and `DefaultTargetCapacityType`-driven spot/on-demand selection — unblocks Karpenter / Cluster Autoscaler local validation; IAM instance profile association lifecycle is persisted (`Associate*`, `Describe*`, `Replace*`, `Disassociate*`) so Terraform `aws_instance.iam_instance_profile` round-trips without drift; `AuthorizeSecurityGroupIngress` is idempotent on duplicate rules (same behavior as egress; avoids Terraform re-apply failures); metadata-only instance records by default — `RegisterImage` with a container reference makes an AMI whose launches get a real box, so SSM Run Command returns a real exit code (see *Instances with a real box*); CreateVpc provisions per-VPC default route table, network ACL, and security group; cross-account AMI sharing via launch permissions (`ModifyImageAttribute` add/remove, `Group=all` makes the image public, `DescribeImages` shows shared images with the owner's `OwnerId`, `ExecutableUsers` honored, shared AMIs launch); full Terraform VPC module v6.6.0 compatible; VPN/Customer gateways, managed prefix lists, VPC endpoints with modify support; launch templates with versioning ($Latest/$Default) |
diff --git a/ministack/services/cloudformation/provisioners.py b/ministack/services/cloudformation/provisioners.py
index d53f45eb..72a00b7a 100644
--- a/ministack/services/cloudformation/provisioners.py
+++ b/ministack/services/cloudformation/provisioners.py
@@ -11491,7 +11491,7 @@ def _rds_cluster_param_group_delete(physical_id, props):
# ---------------------------------------------------------------------------
-# DocumentDB (AWS::DocDB::*): RDS clusters and instances with Engine docdb
+# DocumentDB (AWS::DocDB::*)
# ---------------------------------------------------------------------------
_DOCDB_CLUSTER_PROPS = (
@@ -11584,7 +11584,10 @@ def _docdb_instance_create(logical_id, props, stack_name):
**_ec_query({k: props[k] for k in _DOCDB_INSTANCE_PROPS if props.get(k) not in (None, "")}),
**_ec_query({"Tags": props.get("Tags") or []}),
}, "AWS::DocDB::DBInstance", "create")
- return db_id, _docdb_instance_attrs(_docdb._instances[db_id])
+ instance = _ec_wait_available(_docdb._instances, db_id, "DBInstanceStatus", "AWS::DocDB::DBInstance")
+ if instance.get("DBInstanceStatus") == "failed":
+ raise ValueError(f"AWS::DocDB::DBInstance {db_id} failed to start")
+ return db_id, _docdb_instance_attrs(instance)
def _docdb_instance_update(physical_id, old_props, new_props, stack_name, logical_id=None):
diff --git a/ministack/services/documentdb.py b/ministack/services/documentdb.py
index 4741b2e2..23f70707 100644
--- a/ministack/services/documentdb.py
+++ b/ministack/services/documentdb.py
@@ -19,7 +19,7 @@ from urllib.parse import parse_qs
from xml.sax.saxutils import escape as _esc
from ministack.core import container_reaper
-from ministack.core.concurrency import run_offloop
+from ministack.core.concurrency import run_offloop, spawn_background
from ministack.core.responses import (
AccountRegionScopedDict,
AccountScopedDict,
@@ -1015,20 +1015,40 @@ def _create_db_instance(params):
instance["TagList"] = req_tags
if cluster:
+ _register_instance_in_cluster(instance)
+ if _get_docker():
+ # AWS returns at once with "creating"; the image pull and container start run behind it.
+ instance["DBInstanceStatus"] = "creating"
+ spawn_background(_provision_instance, db_id, instance, cluster,
+ thread_name=f"ministack-docdb-create-{db_id}")
+ elif cluster:
_ensure_cluster_compute(cluster)
_attach_instance_to_shared_cluster(instance, cluster)
- _register_instance_in_cluster(instance)
- _log_readiness_async(
- cluster.get("_shared_internal_address") or "127.0.0.1",
- (cluster.get("_shared_endpoint") or {}).get("Port") or port,
- f"cluster {cluster['DBClusterIdentifier']}",
- )
- else:
- _start_instance_container(db_id, instance)
return _single_instance_response("CreateDBInstanceResponse", "CreateDBInstanceResult", instance)
+def _provision_instance(db_id, instance, cluster):
+ """Start a new instance's compute and publish its status once it accepts connections."""
+ if cluster:
+ _ensure_cluster_compute(cluster)
+ _attach_instance_to_shared_cluster(instance, cluster)
+ container_id = cluster.get("_shared_container_id")
+ host = cluster.get("_shared_internal_address") or "127.0.0.1"
+ port = cluster.get("_shared_internal_port") or cluster.get("_shared_host_port")
+ else:
+ _start_instance_container(db_id, instance)
+ container_id = instance.get("_docker_container_id")
+ host = instance.get("_internal_address") or "127.0.0.1"
+ port = instance.get("_internal_port") or instance.get("_host_port")
+ ok = bool(container_id) and _wait_for_port(host, int(port or 0))
+ if _instances.get(db_id) is not instance:
+ return
+ if cluster and ok:
+ cluster["_shared_container_ready"] = True
+ instance["DBInstanceStatus"] = "available" if ok else "failed"
+
+
def _ensure_cluster_compute(cluster):
"""Guarantee a running shared container behind a cluster before use."""
with _shared_container_lock:
@@ -1076,23 +1096,6 @@ def _start_instance_container(db_id, instance):
"_host_port": host_port,
"Endpoint": {"Address": ep_addr, "Port": ep_port, "HostedZoneId": "Z2R2ITUGPM61AM"},
})
- _log_readiness_async(
- internal_addr or "127.0.0.1", internal_port or host_port, f"instance {db_id}")
-
-
-def _log_readiness_async(host, port, label):
- """Spawn a daemon thread that waits for the port and logs readiness."""
- def _bg_wait(h=host, p=int(port or 0), lbl=label):
- if not p:
- return
- if _wait_for_port(h, p):
- logger.info("docdb: DocumentDB container for %s ready at %s:%s", lbl, h, p)
- else:
- logger.warning(
- "docdb: DocumentDB container for %s at %s:%s not ready after timeout",
- lbl, h, p)
-
- threading.Thread(target=_bg_wait, daemon=True).start()
def _delete_db_instance(params):
@@ -1474,32 +1477,42 @@ def _start_db_cluster(params):
f"<StartDBClusterResult><DBCluster>{_cluster_xml(cluster)}"
f"</DBCluster></StartDBClusterResult>")
- if had_compute:
- result = _restart_cluster_shared_container(cluster_id, cluster)
- if result.get("failed"):
- result = _start_cluster_shared_container(cluster_id, cluster, remove_stale=True)
- else:
- result = _start_cluster_shared_container(cluster_id, cluster, remove_stale=True)
+ # AWS returns at once with "starting"; the container restart runs behind it.
+ cluster["Status"] = "starting"
+ for member in members:
+ member["DBInstanceStatus"] = "starting"
+ spawn_background(_start_cluster_compute, cluster_id, cluster, members, had_compute,
+ thread_name=f"ministack-docdb-start-{cluster_id}")
+ return _xml(200, "StartDBClusterResponse",
+ f"<StartDBClusterResult><DBCluster>{_cluster_xml(cluster)}"
+ f"</DBCluster></StartDBClusterResult>")
- if not result.get("started") and result.get("failed"):
- # Compute did not come back; keep everything stopped so Start can retry.
- return _error(
- "InternalFailure", f"Failed to start compute for DB cluster {cluster_id}.", 500)
+def _start_cluster_compute(cluster_id, cluster, members, had_compute):
+ """Bring a started cluster's container back and publish the resulting status."""
+ with _shared_container_lock:
+ result = {"failed": True}
+ if had_compute:
+ result = _restart_cluster_shared_container(cluster_id, cluster)
+ if result.get("failed"):
+ result = _start_cluster_shared_container(cluster_id, cluster, remove_stale=True)
if result.get("started"):
- readiness_host = result.get("readiness_host") or "127.0.0.1"
readiness_port = result.get("readiness_port")
- ok = _wait_for_port(readiness_host, readiness_port) if readiness_port else True
+ ok = _wait_for_port(result.get("readiness_host") or "127.0.0.1",
+ readiness_port) if readiness_port else True
status = "available" if ok else "failed"
+ elif result.get("failed"):
+ # Compute did not come back; leave the cluster stopped so Start can retry.
+ logger.warning("docdb: failed to start compute for cluster %s", cluster_id)
+ status = "stopped"
else:
status = "available"
+ if _clusters.get(cluster_id) is not cluster:
+ return
cluster["_shared_container_ready"] = status == "available"
cluster["Status"] = status
for member in members:
member["DBInstanceStatus"] = status
- return _xml(200, "StartDBClusterResponse",
- f"<StartDBClusterResult><DBCluster>{_cluster_xml(cluster)}"
- f"</DBCluster></StartDBClusterResult>")
def _stop_db_cluster(params):
diff --git a/pyproject.toml b/pyproject.toml
index 5b5f663d..7b0d5ec3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ministack"
-version = "1.5.24"
+version = "1.5.25"
description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"
readme = "README.md"
license = { file = "LICENSE" }