Skip to content

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

Fix CFN AWS::Cognito::UserPool dropping LambdaConfig (#1158)

ryan-bennett4c45244a284e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05d94c36..b595f47d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,9 @@ Versioning follows [Semantic Versioning](https://semver.org/).
- **CloudWatch — `AWS::CloudWatch::Dashboard` CloudFormation support** — stacks containing CloudWatch dashboards no longer roll back with `Unsupported resource type`. Dashboard creation, in-place body updates, name replacement, `Ref`, and deletion now use the existing CloudWatch dashboard store. Fixes #1155.
- **Cognito — resource servers** (`CreateResourceServer`, `UpdateResourceServer`, `DescribeResourceServer`, `DeleteResourceServer`, `ListResourceServers`) plus `AWS::Cognito::UserPoolResourceServer` CloudFormation support. Previously every resource-server action returned `InvalidAction: Unknown Cognito IDP action`, and the CFN resource type failed the whole stack with `Unsupported resource type`, so any app pool defining custom OAuth scopes (`{identifier}/{scopeName}`, e.g. for `HttpJwtAuthorizer` `authorizationScopes` gating on API Gateway) couldn't deploy against MiniStack at all. Resource servers are keyed by their caller-supplied `Identifier` within a pool, matching real AWS, and `Ref` on the CFN resource returns that `Identifier`. Contributed by @ryan-bennett.
+### Fixed
+- **Cognito — `AWS::Cognito::UserPool` `LambdaConfig` dropped by CloudFormation** — the CFN provisioner built a pool's state without ever reading `LambdaConfig` from the template properties, so any Lambda trigger (PreTokenGeneration, PreSignUp, PostConfirmation, etc.) configured on a CFN-provisioned pool was silently never invoked, even though the identical raw `CreateUserPool` API call already honored it correctly. `LambdaConfig` is now copied onto the pool the same way the raw API does. Contributed by @ryan-bennett.
+
## [1.4.4] — 2026-07-22
### Added
diff --git a/ministack/services/cloudformation/provisioners.py b/ministack/services/cloudformation/provisioners.py
index 8e26124e..573bb3b6 100644
--- a/ministack/services/cloudformation/provisioners.py
+++ b/ministack/services/cloudformation/provisioners.py
@@ -2792,6 +2792,7 @@ def _cognito_user_pool_create(logical_id, props, stack_name):
"AllowAdminCreateUserOnly": False,
"UnusedAccountValidityDays": 7,
}),
+ "LambdaConfig": props.get("LambdaConfig", {}),
"Domain": None,
"_clients": {},
"_users": {},
diff --git a/tests/test_cfn.py b/tests/test_cfn.py
index b10ec050..65fa9154 100644
--- a/tests/test_cfn.py
+++ b/tests/test_cfn.py
@@ -1,3 +1,4 @@
+import base64
import io
import json
import os