Skip to content

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

feat(cfn): add ListStackResources action (#211)

Christine Nguyen54afc0ba795f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e1e5a8c7..4110d598 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,13 @@ Versioning follows [Semantic Versioning](https://semver.org/).
---
+## [Unreleased]
+
+### Added
+- **CloudFormation `ListStackResources` action** — Serverless Framework calls `ListStackResources` during deploy to check provisioned resources. Without this action the deploy fails with `Unknown action: ListStackResources`. Response uses the correct AWS XML shape (`StackResourceSummaries` wrapper with `LastUpdatedTimestamp`). Accepts stack name or stack ID.
+
+---
+
## [1.1.58] — 2026-04-09
### Fixed
diff --git a/ministack/services/cloudformation/__init__.py b/ministack/services/cloudformation/__init__.py
index 8e4522a6..bf03d624 100644
--- a/ministack/services/cloudformation/__init__.py
+++ b/ministack/services/cloudformation/__init__.py
@@ -2,7 +2,7 @@
CloudFormation Service Emulator -- AWS-compatible.
Supports: CreateStack, UpdateStack, DeleteStack, DescribeStacks, ListStacks,
DescribeStackEvents, DescribeStackResource, DescribeStackResources,
- GetTemplate, ValidateTemplate, ListExports,
+ ListStackResources, GetTemplate, ValidateTemplate, ListExports,
CreateChangeSet, DescribeChangeSet, ExecuteChangeSet,
DeleteChangeSet, ListChangeSets,
GetTemplateSummary.
diff --git a/ministack/services/cloudformation/handlers.py b/ministack/services/cloudformation/handlers.py
index 09b8a097..6919b603 100644
--- a/ministack/services/cloudformation/handlers.py
+++ b/ministack/services/cloudformation/handlers.py
@@ -328,6 +328,43 @@ def _describe_stack_resources(params):
f"</DescribeStackResourcesResult>")
+# --- ListStackResources ---
+
+def _list_stack_resources(params):
+ from ministack.services.cloudformation import _stacks
+ stack_name = _p(params, "StackName")
+ if not stack_name:
+ return _error("ValidationError", "StackName is required")
+
+ stack = _stacks.get(stack_name)
+ if not stack:
+ for s in _stacks.values():
+ if s.get("StackId") == stack_name:
+ stack = s
+ break
+ if not stack:
+ return _error("ValidationError",
+ f"Stack [{stack_name}] does not exist")
+
+ resources = stack.get("_resources", {})
+ members = ""
+ for logical_id, res in resources.items():
+ members += (
+ "<member>"
+ f"<LogicalResourceId>{_esc(logical_id)}</LogicalResourceId>"
+ f"<PhysicalResourceId>{_esc(res.get('PhysicalResourceId', ''))}</PhysicalResourceId>"
+ f"<ResourceType>{_esc(res.get('ResourceType', ''))}</ResourceType>"
+ f"<ResourceStatus>{res.get('ResourceStatus', '')}</ResourceStatus>"
+ f"<LastUpdatedTimestamp>{res.get('Timestamp', '')}</LastUpdatedTimestamp>"
+ "</member>"
+ )
+
+ return _xml(200, "ListStackResourcesResponse",
+ f"<ListStackResourcesResult>"
+ f"<StackResourceSummaries>{members}</StackResourceSummaries>"
+ f"</ListStackResourcesResult>")
+
+
# --- GetTemplate ---
def _get_template(params):
@@ -595,6 +632,7 @@ _ACTION_HANDLERS = {
"DescribeStackEvents": _describe_stack_events,
"DescribeStackResource": _describe_stack_resource,
"DescribeStackResources": _describe_stack_resources,
+ "ListStackResources": _list_stack_resources,
"GetTemplate": _get_template,
"ValidateTemplate": _validate_template,
"ListExports": _list_exports,