Skip to content

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

Feat/ecs 47 actions v1.1.38 (#134)

Nahuel Nucera822396961b55
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 65236856..7de17062 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,18 @@ Versioning follows [Semantic Versioning](https://semver.org/).
---
+## [1.1.38] — 2026-04-05
+
+### Added
+- **ECS 19 new operations (47 total)** — `ListTaskDefinitionFamilies`, `DeleteTaskDefinitions`, `ListServicesByNamespace`, `PutAccountSettingDefault`, `DeleteAccountSetting`, `PutAttributes`, `DeleteAttributes`, `ListAttributes`, `UpdateCapacityProvider`, `DescribeServiceDeployments`, `ListServiceDeployments`, `DescribeServiceRevisions`, `SubmitTaskStateChange`, `SubmitContainerStateChange`, `SubmitAttachmentStateChanges`, `DiscoverPollEndpoint`, `UpdateTaskProtection`, `GetTaskProtection`. Full Terraform ECS coverage.
+- **SES SMTP relay via `SMTP_HOST`** — when set (e.g. `mailhog:1025`), SendEmail/SendRawEmail/SendTemplatedEmail/SendBulkTemplatedEmail deliver to an external SMTP server. Zero impact when unset. Contributed by @kjdev (#131)
+- **Docker socket documentation** — README quickstart now shows `-v /var/run/docker.sock` for RDS, ECS, and Lambda container features
+
+### Fixed
+- **API Gateway v2 `CreatedDate` returned as ISO8601 string** — was returning Unix timestamp (number), causing Terraform AWS Provider v5/v6 deserialization failure on `aws_apigatewayv2_api`. Reported by @hmarcuzzo (#132)
+
+---
+
## [1.1.37] — 2026-04-05
### Added
diff --git a/README.md b/README.md
index 46c9d9b0..e580e763 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,9 @@ ministack
# Option 2: Docker Hub
docker run -p 4566:4566 nahuelnucera/ministack
+# Option 2b: Docker Hub with real infrastructure (RDS, ECS, Lambda containers)
+docker run -p 4566:4566 -v /var/run/docker.sock:/var/run/docker.sock nahuelnucera/ministack
+
# Option 3: Clone and build
git clone https://github.com/Nahuel990/ministack
cd ministack
@@ -325,7 +328,7 @@ Unsupported resource types fail with `CREATE_FAILED` (or `ROLLBACK_COMPLETE` if
| Service | Operations | Notes |
|---------|-----------|-------|
-| **ECS** | CreateCluster, DeleteCluster, DescribeClusters, ListClusters, UpdateCluster, UpdateClusterSettings, RegisterTaskDefinition, DeregisterTaskDefinition, DescribeTaskDefinition, ListTaskDefinitions, CreateService, DeleteService, DescribeServices, UpdateService, ListServices, RunTask, StopTask, DescribeTasks, ListTasks, TagResource, UntagResource, ListTagsForResource, ExecuteCommand, ListAccountSettings, PutAccountSetting, CreateCapacityProvider, DeleteCapacityProvider, DescribeCapacityProviders, PutClusterCapacityProviders | `RunTask` starts real Docker containers via Docker socket |
+| **ECS** | CreateCluster, DeleteCluster, DescribeClusters, ListClusters, UpdateCluster, UpdateClusterSettings, PutClusterCapacityProviders, RegisterTaskDefinition, DeregisterTaskDefinition, DescribeTaskDefinition, ListTaskDefinitions, ListTaskDefinitionFamilies, DeleteTaskDefinitions, CreateService, DeleteService, DescribeServices, UpdateService, ListServices, ListServicesByNamespace, RunTask, StopTask, DescribeTasks, ListTasks, ExecuteCommand, UpdateTaskProtection, GetTaskProtection, CreateCapacityProvider, UpdateCapacityProvider, DeleteCapacityProvider, DescribeCapacityProviders, TagResource, UntagResource, ListTagsForResource, ListAccountSettings, PutAccountSetting, PutAccountSettingDefault, DeleteAccountSetting, PutAttributes, DeleteAttributes, ListAttributes, DescribeServiceDeployments, ListServiceDeployments, DescribeServiceRevisions, SubmitTaskStateChange, SubmitContainerStateChange, SubmitAttachmentStateChanges, DiscoverPollEndpoint | 47 actions; `RunTask` starts real Docker containers via Docker socket; full Terraform ECS coverage |
| **RDS** | CreateDBInstance, DeleteDBInstance, DescribeDBInstances, ModifyDBInstance, StartDBInstance, StopDBInstance, RebootDBInstance, CreateDBInstanceReadReplica, RestoreDBInstanceFromDBSnapshot, CreateDBCluster, DeleteDBCluster, DescribeDBClusters, ModifyDBCluster, StartDBCluster, StopDBCluster, CreateDBSnapshot, DeleteDBSnapshot, DescribeDBSnapshots, CreateDBClusterSnapshot, DescribeDBClusterSnapshots, DeleteDBClusterSnapshot, CreateDBSubnetGroup, DeleteDBSubnetGroup, DescribeDBSubnetGroups, ModifyDBSubnetGroup, CreateDBParameterGroup, DeleteDBParameterGroup, DescribeDBParameterGroups, DescribeDBParameters, ModifyDBParameterGroup, CreateDBClusterParameterGroup, DescribeDBClusterParameterGroups, DeleteDBClusterParameterGroup, DescribeDBClusterParameters, ModifyDBClusterParameterGroup, CreateOptionGroup, DeleteOptionGroup, DescribeOptionGroups, DescribeOptionGroupOptions, ListTagsForResource, AddTagsToResource, RemoveTagsFromResource, DescribeDBEngineVersions, DescribeOrderableDBInstanceOptions | `CreateDBInstance` spins up real Postgres/MySQL Docker container, returns actual `host:port` endpoint |
| **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, DescribeEvents | `CreateCacheCluster` spins up real Redis/Memcached Docker container |
| **Glue** | CreateDatabase, DeleteDatabase, GetDatabase, GetDatabases, UpdateDatabase, CreateTable, DeleteTable, GetTable, GetTables, UpdateTable, BatchDeleteTable, CreatePartition, DeletePartition, GetPartition, GetPartitions, BatchCreatePartition, BatchGetPartition, CreatePartitionIndex, GetPartitionIndexes, 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, CreateSecurityConfiguration, DeleteSecurityConfiguration, GetSecurityConfiguration, GetSecurityConfigurations, CreateClassifier, GetClassifier, GetClassifiers, DeleteClassifier, TagResource, UntagResource, GetTags | Python shell jobs actually execute via subprocess |
@@ -487,6 +490,7 @@ ecs.stop_task(cluster="dev", task=task_arn)
| `LAMBDA_DOCKER_NETWORK` | _(unset)_ | Docker network for Lambda containers. Set to your Docker Compose network name so Lambda can reach MiniStack |
| `SFN_MOCK_CONFIG` | _(unset)_ | Path to JSON file for Step Functions mock testing; compatible with AWS SFN Local format. Also accepts `LOCALSTACK_SFN_MOCK_CONFIG` |
| `ATHENA_ENGINE` | `auto` | SQL engine for Athena: `auto`, `duckdb`, `mock` |
+| `SMTP_HOST` | _(unset)_ | SMTP server for SES email relay (e.g. `mailhog:1025`). When set, SES SendEmail/SendRawEmail actually deliver mail. When unset, emails are stored in-memory only |
### Athena SQL Engines
diff --git a/ministack/services/apigateway.py b/ministack/services/apigateway.py
index b88f4304..64504505 100644
--- a/ministack/services/apigateway.py
+++ b/ministack/services/apigateway.py
@@ -415,7 +415,7 @@ def _create_api(data):
"name": data.get("name", "unnamed"),
"protocolType": data.get("protocolType", "HTTP"),
"apiEndpoint": f"http://{api_id}.execute-api.{_HOST}:{_PORT}",
- "createdDate": int(time.time()),
+ "createdDate": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
"routeSelectionExpression": data.get("routeSelectionExpression", "$request.method $request.path"),
"tags": data.get("tags", {}),
"corsConfiguration": data.get("corsConfiguration", {}),
@@ -570,7 +570,7 @@ def _create_stage(api_id, data):
stage = {
"stageName": stage_name,
"autoDeploy": data.get("autoDeploy", False),
- "createdDate": int(time.time()),
+ "createdDate": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
"lastUpdatedDate": int(time.time()),
"stageVariables": data.get("stageVariables", {}),
"description": data.get("description", ""),
@@ -619,7 +619,7 @@ def _create_deployment(api_id, data):
deployment = {
"deploymentId": deployment_id,
"deploymentStatus": "DEPLOYED",
- "createdDate": int(time.time()),
+ "createdDate": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
"description": data.get("description", ""),
}
_deployments.setdefault(api_id, {})[deployment_id] = deployment
diff --git a/ministack/services/ecs.py b/ministack/services/ecs.py
index d0bb3d86..bacb78a3 100644
--- a/ministack/services/ecs.py
+++ b/ministack/services/ecs.py
@@ -1,15 +1,24 @@
"""
ECS (Elastic Container Service) Emulator.
REST JSON API — X-Amz-Target header routing with path-based fallback.
-Supports: CreateCluster, DeleteCluster, DescribeClusters, ListClusters,
- UpdateCluster, UpdateClusterSettings,
- RegisterTaskDefinition, DeregisterTaskDefinition, DescribeTaskDefinition, ListTaskDefinitions,
- CreateService, DeleteService, DescribeServices, UpdateService, ListServices,
- RunTask, StopTask, DescribeTasks, ListTasks,
- TagResource, UntagResource, ListTagsForResource,
- ExecuteCommand, ListAccountSettings, PutAccountSetting,
- CreateCapacityProvider, DeleteCapacityProvider, DescribeCapacityProviders,
- PutClusterCapacityProviders.
+Supports 47 operations:
+ Clusters: CreateCluster, DeleteCluster, DescribeClusters, ListClusters,
+ UpdateCluster, UpdateClusterSettings, PutClusterCapacityProviders
+ Task Defs: RegisterTaskDefinition, DeregisterTaskDefinition, DescribeTaskDefinition,
+ ListTaskDefinitions, ListTaskDefinitionFamilies, DeleteTaskDefinitions
+ Services: CreateService, DeleteService, DescribeServices, UpdateService,
+ ListServices, ListServicesByNamespace
+ Tasks: RunTask, StopTask, DescribeTasks, ListTasks, ExecuteCommand,
+ UpdateTaskProtection, GetTaskProtection
+ Capacity: CreateCapacityProvider, UpdateCapacityProvider, DeleteCapacityProvider,
+ DescribeCapacityProviders
+ Tags: TagResource, UntagResource, ListTagsForResource
+ Account: ListAccountSettings, PutAccountSetting, PutAccountSettingDefault,
+ DeleteAccountSetting
+ Attributes: PutAttributes, DeleteAttributes, ListAttributes
+ Deployments: DescribeServiceDeployments, ListServiceDeployments, DescribeServiceRevisions
+ Agent: SubmitTaskStateChange, SubmitContainerStateChange,
+ SubmitAttachmentStateChanges, DiscoverPollEndpoint
Container execution: if Docker socket is available, RunTask actually runs containers.
"""
@@ -1237,6 +1246,168 @@ def _sanitize(obj):
return obj
+# ---------------------------------------------------------------------------
+# ListTaskDefinitionFamilies / DeleteTaskDefinitions
+# ---------------------------------------------------------------------------
+
+def _list_task_definition_families(data):
+ family_prefix = data.get("familyPrefix", "")
+ status_filter = data.get("status", "ACTIVE")
+ families = set()
+ for td in _task_defs.values():
+ if status_filter and td.get("status") != status_filter:
+ continue
+ fam = td.get("family", "")
+ if family_prefix and not fam.startswith(family_prefix):
+ continue
+ families.add(fam)
+ return json_response({"families": sorted(families)})
+
+
+def _delete_task_definitions(data):
+ arns = data.get("taskDefinitions", [])
+ failures = []
+ for arn in arns:
+ key = arn.split("/")[-1] if "/" in arn else arn
+ if key in _task_defs:
+ _task_defs[key]["status"] = "DELETE_IN_PROGRESS"
+ else:
+ failures.append({"arn": arn, "reason": "TASK_DEFINITION_NOT_FOUND"})
+ return json_response({"taskDefinitions": [_task_defs.get(a.split("/")[-1], {}) for a in arns if a.split("/")[-1] in _task_defs], "failures": failures})
+
+
+# ---------------------------------------------------------------------------
+# ListServicesByNamespace
+# ---------------------------------------------------------------------------
+
+def _list_services_by_namespace(data):
+ namespace = data.get("namespace", "")
+ items = []
+ for svc in _services.values():
+ if namespace and svc.get("_namespace", "") != namespace:
+ continue
+ items.append({"serviceArn": svc["serviceArn"], "clusterArn": svc.get("clusterArn", "")})
+ return json_response({"serviceArns": [s["serviceArn"] for s in items]})
+
+
+# ---------------------------------------------------------------------------
+# PutAccountSettingDefault / DeleteAccountSetting
+# ---------------------------------------------------------------------------
+
+def _put_account_setting_default(data):
+ name = data.get("name", "")
+ value = data.get("value", "")
+ _account_settings[name] = {"name": name, "value": value, "principalArn": f"arn:aws:iam::{os.environ.get('MINISTACK_ACCOUNT_ID', '000000000000')}:root"}
+ return json_response({"setting": _account_settings[name]})
+
+
+def _delete_account_setting(data):
+ name = data.get("name", "")
+ _account_settings.pop(name, None)
+ return json_response({"setting": {"name": name, "value": ""}})
+
+
+# ---------------------------------------------------------------------------
+# Attributes (PutAttributes / DeleteAttributes / ListAttributes)
+# ---------------------------------------------------------------------------
+
+_attributes: dict = {}
+
+def _put_attributes(data):
+ attrs = data.get("attributes", [])
+ for attr in attrs:
+ target_id = attr.get("targetId", "")
+ name = attr.get("name", "")
+ _attributes[f"{target_id}:{name}"] = attr
+ return json_response({"attributes": attrs})
+
+
+def _delete_attributes(data):
+ attrs = data.get("attributes", [])
+ for attr in attrs:
+ target_id = attr.get("targetId", "")
+ name = attr.get("name", "")
+ _attributes.pop(f"{target_id}:{name}", None)
+ return json_response({"attributes": attrs})
+
+
+def _list_attributes(data):
+ target_type = data.get("targetType", "")
+ attr_name = data.get("attributeName", "")
+ results = []
+ for attr in _attributes.values():
+ if target_type and attr.get("targetType", "") != target_type:
+ continue
+ if attr_name and attr.get("name", "") != attr_name:
+ continue
+ results.append(attr)
+ return json_response({"attributes": results})
+
+
+# ---------------------------------------------------------------------------
+# UpdateCapacityProvider
+# ---------------------------------------------------------------------------
+
+def _update_capacity_provider(data):
+ name = data.get("name", "")
+ cp = _capacity_providers.get(name)
+ if not cp:
+ return error_response_json("ClientException", f"Capacity provider {name} not found", 400)
+ auto_scaling = data.get("autoScalingGroupProvider")
+ if auto_scaling:
+ cp["autoScalingGroupProvider"].update(auto_scaling)
+ cp["updateStatus"] = "UPDATE_COMPLETE"
+ return json_response({"capacityProvider": cp})
+
+
+# ---------------------------------------------------------------------------
+# ServiceDeployments (stubs)
+# ---------------------------------------------------------------------------
+
+def _describe_service_deployments(data):
+ return json_response({"serviceDeployments": []})
+
+
+def _list_service_deployments(data):
+ return json_response({"serviceDeployments": []})
+
+
+def _describe_service_revisions(data):
+ return json_response({"serviceRevisions": []})
+
+
+# ---------------------------------------------------------------------------
+# Agent stubs
+# ---------------------------------------------------------------------------
+
+def _submit_task_state_change(data):
+ return json_response({"acknowledgment": "ACCEPT"})
+
+
+def _submit_container_state_change(data):
+ return json_response({"acknowledgment": "ACCEPT"})
+
+
+def _submit_attachment_state_changes(data):
+ return json_response({"acknowledgment": "ACCEPT"})
+
+
+def _discover_poll_endpoint(data):
+ return json_response({"endpoint": "http://localhost:4566", "telemetryEndpoint": "http://localhost:4566"})
+
+
+# ---------------------------------------------------------------------------
+# Task protection stubs
+# ---------------------------------------------------------------------------
+
+def _update_task_protection(data):
+ return json_response({"protectedTasks": [], "failures": []})
+
+
+def _get_task_protection(data):
+ return json_response({"protectedTasks": [], "failures": []})
+
+
# ---------------------------------------------------------------------------
# Action map (X-Amz-Target dispatch)
# ---------------------------------------------------------------------------
@@ -1271,6 +1442,24 @@ _ACTION_MAP = {
"DeleteCapacityProvider": _delete_capacity_provider,
"DescribeCapacityProviders": _describe_capacity_providers,
"PutClusterCapacityProviders": _put_cluster_capacity_providers,
+ "ListTaskDefinitionFamilies": _list_task_definition_families,
+ "DeleteTaskDefinitions": _delete_task_definitions,
+ "ListServicesByNamespace": _list_services_by_namespace,
+ "PutAccountSettingDefault": _put_account_setting_default,
+ "DeleteAccountSetting": _delete_account_setting,
+ "PutAttributes": _put_attributes,
+ "DeleteAttributes": _delete_attributes,
+ "ListAttributes": _list_attributes,
+ "UpdateCapacityProvider": _update_capacity_provider,
+ "DescribeServiceDeployments": _describe_service_deployments,
+ "ListServiceDeployments": _list_service_deployments,
+ "DescribeServiceRevisions": _describe_service_revisions,
+ "SubmitTaskStateChange": _submit_task_state_change,
+ "SubmitContainerStateChange": _submit_container_state_change,
+ "SubmitAttachmentStateChanges": _submit_attachment_state_changes,
+ "DiscoverPollEndpoint": _discover_poll_endpoint,
+ "UpdateTaskProtection": _update_task_protection,
+ "GetTaskProtection": _get_task_protection,
}
@@ -1293,3 +1482,4 @@ def reset():
_tags.clear()
_account_settings.clear()
_capacity_providers.clear()
+ _attributes.clear()
diff --git a/pyproject.toml b/pyproject.toml
index 0e93350b..3a901090 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ministack"
-version = "1.1.37"
+version = "1.1.38"
description = "Free, open-source local AWS emulator — drop-in LocalStack replacement"
readme = "README.md"
license = { file = "LICENSE" }