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
fix: SQS queue URL respects MINISTACK_HOST and GATEWAY_PORT env vars (#7)
Nahuel Nucera948cc6416a48
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0c142dfd..a24b35df 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,14 @@ Versioning follows [Semantic Versioning](https://semver.org/).---+## [1.0.4] — 2026-03-26++### Fixed+- **SQS queue URL host/port**: `QueueUrl` values now read `MINISTACK_HOST` and `GATEWAY_PORT` env vars instead of hardcoding `localhost:4566` — fixes queue URLs when running behind a custom hostname or port+- 379 integration tests — all passing, including against Docker image++---+## [1.0.3] — 2026-03-25### Fixed@@ -95,11 +103,12 @@ Versioning follows [Semantic Versioning](https://semver.org/).### Roadmap UpdateThe following roadmap items from v0.1.0 are now **completed**:-- ✅ API Gateway (REST + HTTP APIs) — HTTP API v2 delivered-- ✅ SNS → SQS fan-out delivery-- ✅ DynamoDB transactions (TransactWriteItems, TransactGetItems)-- ✅ S3 multipart upload-- ✅ SQS FIFO queues+- API Gateway (HTTP API v2) — full control and data plane delivered+- SNS → SQS fan-out delivery+- DynamoDB transactions (TransactWriteItems, TransactGetItems)+- S3 multipart upload+- SQS FIFO queues+- Step Functions ASL interpreter (Pass, Task, Choice, Wait, Succeed, Fail, Parallel, Map; Retry/Catch; waitForTaskToken)---@@ -148,16 +157,11 @@ Initial public release. Built as a free, open-source alternative to LocalStack.## Roadmap-### [0.2.0] — Planned-- API Gateway (REST + HTTP APIs)-- SNS → SQS fan-out delivery-- DynamoDB transactions (TransactWriteItems, TransactGetItems)-- S3 multipart upload-- SQS FIFO queues--### [0.3.0] — Planned+### Planned+- API Gateway REST API (v1) — resource trees, methods, integration types, deployment stages- Cognito (user pools, sign-up/sign-in)-- Step Functions ASL interpreter (actually run state machines)- Route53 (hosted zones, record sets)- ACM (certificate management)- Firehose+- Virtual-hosted style S3 (`bucket.localhost:4566` routing)+diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 92fe0f7a..ce2cf8ac 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -145,12 +145,14 @@ pytest tests/ -v -k "test_myservice"High-value contributions right now:-- **API Gateway** — very commonly needed for local dev-- **Cognito** — user pools, sign-up/sign-in flows-- **SNS → SQS fan-out** — publish to a topic and have it deliver to subscribed queues-- **DynamoDB transactions** — `TransactWriteItems`, `TransactGetItems`-- **Step Functions execution** — actually interpret the state machine ASL definition-- **Route53** — basic hosted zones and record sets+- **API Gateway REST API (v1)** — resource trees, methods, integration types, deployment stages; HTTP API v2 is already implemented+- **Cognito** — user pools, sign-up/sign-in, token issuance+- **Route53** — hosted zones, record sets, health checks+- **ACM** — certificate provisioning and validation stubs+- **Firehose** — delivery streams to S3/Elasticsearch+- **More S3 operations** — object lock, replication configuration, website hosting+- **Virtual-hosted style S3** — `bucket.localhost:4566` routing in addition to path-style+- **Athena without DuckDB** — graceful degradation or lighter SQL engine option---diff --git a/README.md b/README.mdindex 5542f720..fc00dc69 100644--- a/README.md+++ b/README.md@@ -331,6 +331,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 || `LOG_LEVEL` | `INFO` | `DEBUG`, `INFO`, `WARNING`, `ERROR` || `S3_PERSIST` | `0` | Set `1` to persist S3 objects to disk || `S3_DATA_DIR` | `/tmp/localstack-data/s3` | S3 persistence directory |diff --git a/services/sqs.py b/services/sqs.pyindex aa8ad96c..f07cbaab 100644--- a/services/sqs.py+++ b/services/sqs.py@@ -22,6 +22,7 @@ Actions:"""import asyncio+import osimport timeimport jsonimport hashlib@@ -41,8 +42,8 @@ _queue_name_to_url: dict = {}ACCOUNT_ID = "000000000000"REGION = "us-east-1"-DEFAULT_HOST = "localhost"-DEFAULT_PORT = "4566"+DEFAULT_HOST = os.environ.get("MINISTACK_HOST", "localhost")+DEFAULT_PORT = os.environ.get("GATEWAY_PORT", "4566")_DEDUP_WINDOW_S = 300 # 5 minutesdiff --git a/tests/test_services.py b/tests/test_services.pyindex dbe78f6a..7c156d7a 100644--- a/tests/test_services.py+++ b/tests/test_services.py@@ -396,10 +396,15 @@ def test_sqs_get_queue_url(sqs):resp = sqs.get_queue_url(QueueName="intg-sqs-geturl")assert "intg-sqs-geturl" in resp["QueueUrl"]-def test_sqs_get_queue_url(sqs):- sqs.create_queue(QueueName="intg-sqs-geturl")- resp = sqs.get_queue_url(QueueName="intg-sqs-geturl")- assert "intg-sqs-geturl" in resp["QueueUrl"]++def test_sqs_queue_url_reflects_env_host(sqs):+ """QueueUrl host must come from MINISTACK_HOST env var, not hardcoded localhost."""+ import os+ expected_host = os.environ.get("MINISTACK_HOST", "localhost")+ resp = sqs.create_queue(QueueName="intg-sqs-urlhost")+ url = resp["QueueUrl"]+ assert expected_host in url+ assert "intg-sqs-urlhost" in urldef test_sqs_send_receive_delete(sqs):