Skip to content

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

fix multi stack (#1216)

Nahuel Nucera707c2626c6bc
diff --git a/ministack/services/bedrock_agentcore.py b/ministack/services/bedrock_agentcore.py
index 308db136..56240cc0 100644
--- a/ministack/services/bedrock_agentcore.py
+++ b/ministack/services/bedrock_agentcore.py
@@ -3,8 +3,11 @@
Covers the two AgentCore services, which both sign as ``bedrock-agentcore``:
* ``bedrock-agentcore-control`` (rest-json) — agent runtime + endpoint control
- plane: Create/Get/List/Update/Delete AgentRuntime and AgentRuntimeEndpoint,
- plus ListAgentRuntimeVersions.
+ plane: CreateAgentRuntime, GetAgentRuntime, ListAgentRuntimes,
+ UpdateAgentRuntime, DeleteAgentRuntime, ListAgentRuntimeVersions,
+ CreateAgentRuntimeEndpoint, GetAgentRuntimeEndpoint,
+ ListAgentRuntimeEndpoints, UpdateAgentRuntimeEndpoint,
+ DeleteAgentRuntimeEndpoint.
* ``bedrock-agentcore`` (rest-json) — data plane: InvokeAgentRuntime.
Deterministic and stateful: resources provision instantly (``READY``) and
diff --git a/ministack/services/cloudformation/engine.py b/ministack/services/cloudformation/engine.py
index 80641737..994c2ff8 100644
--- a/ministack/services/cloudformation/engine.py
+++ b/ministack/services/cloudformation/engine.py
@@ -423,6 +423,33 @@ def _resolve_refs(value, resources, params, conditions, mappings,
return export["Value"]
raise ValueError(f"Export '{export_name}' not found")
+ # --- Fn::GetStackOutput (aws-cdk-local cross-stack reference) ---
+ # Not an AWS intrinsic: aws-cdk-local rewrites CDK cross-stack references
+ # into this instead of Fn::ImportValue, and resolves it to a named output
+ # of another already-deployed stack (deploy order is dependency-sorted, so
+ # the producer stack's outputs are present by the time the consumer stack
+ # resolves this). Left unresolved, the dict reaches provisioners as e.g. a
+ # Lambda::Permission FunctionName and crashes with
+ # "'dict' object has no attribute 'startswith'".
+ if "Fn::GetStackOutput" in value:
+ from ministack.services.cloudformation import _stacks
+ spec = value["Fn::GetStackOutput"]
+ if isinstance(spec, dict):
+ target_stack = _resolve_refs(spec.get("StackName", ""), resources,
+ params, conditions, mappings,
+ stack_name, stack_id)
+ output_name = _resolve_refs(spec.get("OutputName", ""), resources,
+ params, conditions, mappings,
+ stack_name, stack_id)
+ stack = _stacks.get(str(target_stack))
+ if stack:
+ for o in stack.get("Outputs", []):
+ if o.get("OutputKey") == output_name:
+ return o.get("OutputValue", "")
+ raise ValueError(
+ f"Output '{output_name}' not found in stack '{target_stack}'")
+ return ""
+
# --- Fn::GetAZs ---
if "Fn::GetAZs" in value:
region = _resolve_refs(value["Fn::GetAZs"], resources, params,
diff --git a/ministack/services/s3.py b/ministack/services/s3.py
index b6253fcd..0496f639 100644
--- a/ministack/services/s3.py
+++ b/ministack/services/s3.py
@@ -1,7 +1,7 @@
"""
S3 Service Emulator – AWS-compatible.
Supports: CreateBucket, DeleteBucket, ListBuckets, HeadBucket,
- PutObject, GetObject, DeleteObject, HeadObject, CopyObject,
+ PutObject, GetObject, GetObjectAttributes, DeleteObject, HeadObject, CopyObject,
ListObjectsV1 (with Marker/NextMarker pagination),
ListObjectsV2 (with ContinuationToken pagination),
DeleteObjects (batch),