cdk-factory 0.8.0__tar.gz → 0.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cdk-factory might be problematic. Click here for more details.
- cdk_factory-0.8.1/GEEK_CAFE_FIX.md +241 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/PKG-INFO +1 -1
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/examples/separate-api-gateway/api-gateway-stack.json +1 -3
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/pyproject.toml +1 -1
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/enhanced_ssm_config.py +3 -1
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/api_gateway/api_gateway_stack.py +20 -1
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/api_gateway_integration_utility.py +7 -0
- cdk_factory-0.8.1/src/cdk_factory/version.py +1 -0
- cdk_factory-0.8.0/src/cdk_factory/version.py +0 -1
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/.gitignore +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/.windsurfrules +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/LICENSE +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/README.md +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/archive/README.md +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/archive/migrate_to_enhanced_ssm.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/examples/separate-api-gateway/README.md +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/examples/separate-api-gateway/config.json +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/examples/separate-api-gateway/lambda-stack.json +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/mypy.ini +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/publish_to_pypi.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/publish_to_pypi.sh +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/pysetup.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/pysetup.sh +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/requirements.dev.txt +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/requirements.tests.txt +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/requirements.txt +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/run-checks.sh +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/run-tests-clean-venv.sh +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/run-tests.sh +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/app.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/builds/README.md +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/cdk.json +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/commands/command_loader.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/base_config.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/cdk_config.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/deployment.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/deployment_wave.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/devops.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/enhanced_base_config.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/management.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/pipeline.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/pipeline_stage.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/_resources.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/api_gateway.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/apigateway_route_config.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/auto_scaling.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/cloudfront.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/cloudwatch_widget.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/code_artifact.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/code_artifact_login.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/code_repository.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/cognito.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/docker.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/dynamodb.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/ecr.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/exisiting.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/lambda_function.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/lambda_layers.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/lambda_triggers.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/load_balancer.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/rds.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/resource_mapping.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/resource_naming.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/resource_types.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/route53.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/route53_hosted_zone.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/rum.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/s3.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/security_group.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/security_group_full_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/sqs.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/vpc.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/workload.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/cloudfront/cloudfront_distribution_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/ecr/ecr_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/lambdas/lambda_function_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/lambdas/lambda_function_docker_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/lambdas/lambda_function_role_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/lambdas/policies/policy_docs.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/lambdas/policies/policy_statements.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/s3_buckets/s3_bucket_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_destination_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_source_construct.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/sqs/policies/sqs_policies.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/interfaces/enhanced_ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/interfaces/istack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/interfaces/live_ssm_resolver.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/interfaces/ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/lambdas/health_handler.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/pipeline/pipeline_factory.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/pipeline/security/policies.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/pipeline/security/roles.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/pipeline/stage.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack/istack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack/stack_factory.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack/stack_module_loader.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack/stack_module_registry.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack/stack_modules.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/auto_scaling/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/aws_lambdas/lambda_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/buckets/README.md +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/buckets/bucket_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/code_artifact/code_artifact_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/cognito/cognito_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/dynamodb/dynamodb_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/ecr/README.md +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/ecr/ecr_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/load_balancer/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/load_balancer/load_balancer_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/rds/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/rds/rds_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/route53/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/route53/route53_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/rum/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/rum/rum_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/security_group/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/security_group/security_group_full_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/security_group/security_group_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/simple_queue_service/sqs_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/stack_base.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/vpc/__init__.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/vpc/vpc_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/websites/static_website_stack.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stages/websites/static_website_stage.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/commandline_args.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/configuration_loader.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/docker_utilities.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/environment_services.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/file_operations.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/git_utilities.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/json_loading_utility.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/lambda_function_utilities.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/os_execute.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utils/api_gateway_utilities.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/workload/workload_factory.py +0 -0
- {cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/handlers/test/handler.py +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Fix for geek-cafe Cognito Error
|
|
2
|
+
|
|
3
|
+
## The Problem
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
ValueError: User pool ID is required for API Gateway authorizer.
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Your API Gateway stack can't find the Cognito User Pool because the new separated pattern requires **SSM imports** instead of environment variables.
|
|
10
|
+
|
|
11
|
+
## Quick Fix
|
|
12
|
+
|
|
13
|
+
In your `/Users/eric.wilson/Projects/geek-cafe/geek-cafe-web/geek-cafe-lambdas/cdk` config:
|
|
14
|
+
|
|
15
|
+
### Option 1: Add SSM Import (Recommended)
|
|
16
|
+
|
|
17
|
+
**api-gateway-stack.json:**
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"name": "geek-cafe-prod-api-gateway",
|
|
21
|
+
"module": "api_gateway_stack",
|
|
22
|
+
"api_gateway": {
|
|
23
|
+
"name": "geek-cafe-prod-api",
|
|
24
|
+
"api_type": "REST",
|
|
25
|
+
"stage_name": "prod",
|
|
26
|
+
"ssm": {
|
|
27
|
+
"enabled": true,
|
|
28
|
+
"auto_export": true,
|
|
29
|
+
"workload": "geek-cafe",
|
|
30
|
+
"environment": "prod",
|
|
31
|
+
"imports": {
|
|
32
|
+
"workload": "geek-cafe",
|
|
33
|
+
"environment": "prod",
|
|
34
|
+
"user_pool_arn": "auto" // ✅ ADD THIS - imports from Cognito stack
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"cognito_authorizer": {
|
|
38
|
+
"authorizer_name": "geek-cafe-cognito-authorizer"
|
|
39
|
+
},
|
|
40
|
+
"routes": [...]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This assumes your Cognito stack is configured to export:
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"name": "geek-cafe-prod-cognito",
|
|
49
|
+
"module": "cognito_stack",
|
|
50
|
+
"ssm": {
|
|
51
|
+
"enabled": true,
|
|
52
|
+
"auto_export": true, // ✅ Must be enabled
|
|
53
|
+
"workload": "geek-cafe",
|
|
54
|
+
"environment": "prod"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Option 2: Use Explicit SSM Path
|
|
60
|
+
|
|
61
|
+
If auto-discovery doesn't work, find the exact SSM parameter:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Find the parameter
|
|
65
|
+
aws ssm get-parameters-by-path --path "/geek-cafe/prod/cognito" --recursive
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then use the explicit path:
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"api_gateway": {
|
|
72
|
+
"ssm": {
|
|
73
|
+
"imports": {
|
|
74
|
+
"user_pool_arn": "/geek-cafe/prod/cognito/user-pool/user-pool-arn"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Option 3: Direct ARN (Quick Temporary Fix)
|
|
82
|
+
|
|
83
|
+
If you just need to deploy NOW and fix properly later:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"api_gateway": {
|
|
88
|
+
"cognito_authorizer": {
|
|
89
|
+
"authorizer_name": "geek-cafe-authorizer",
|
|
90
|
+
"user_pool_arn": "arn:aws:cognito-idp:us-east-1:ACCOUNT_ID:userpool/us-east-1_XXXXX"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Get the ARN from AWS Console → Cognito → User Pools → geek-cafe-prod → ARN
|
|
97
|
+
|
|
98
|
+
## Deployment Order
|
|
99
|
+
|
|
100
|
+
With the new pattern, deploy in this order:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# 1. Deploy Cognito (if separate stack)
|
|
104
|
+
cdk deploy geek-cafe-prod-cognito
|
|
105
|
+
|
|
106
|
+
# 2. Deploy Lambdas
|
|
107
|
+
cdk deploy geek-cafe-prod-lambdas
|
|
108
|
+
|
|
109
|
+
# 3. Deploy API Gateway (imports from both above)
|
|
110
|
+
cdk deploy geek-cafe-prod-api-gateway
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Or set up a pipeline with stages:
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"pipeline": {
|
|
117
|
+
"stages": [
|
|
118
|
+
{"name": "infrastructure", "stacks": ["cognito-stack"]},
|
|
119
|
+
{"name": "lambdas", "stacks": ["lambda-stack"]},
|
|
120
|
+
{"name": "api-gateway", "stacks": ["api-gateway-stack"]}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Verify SSM Parameters Exist
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Check what Cognito exported
|
|
130
|
+
aws ssm get-parameter --name "/geek-cafe/prod/cognito/user-pool/user-pool-arn"
|
|
131
|
+
|
|
132
|
+
# Check what Lambda exported
|
|
133
|
+
aws ssm get-parameters-by-path --path "/geek-cafe/prod/lambda" --recursive
|
|
134
|
+
|
|
135
|
+
# Check what API Gateway exported
|
|
136
|
+
aws ssm get-parameters-by-path --path "/geek-cafe/prod/api-gateway" --recursive
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Complete Example Config
|
|
140
|
+
|
|
141
|
+
**cognito-stack.json:**
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"name": "geek-cafe-prod-cognito",
|
|
145
|
+
"module": "cognito_stack",
|
|
146
|
+
"ssm": {
|
|
147
|
+
"enabled": true,
|
|
148
|
+
"auto_export": true,
|
|
149
|
+
"workload": "geek-cafe",
|
|
150
|
+
"environment": "prod"
|
|
151
|
+
},
|
|
152
|
+
"cognito": {
|
|
153
|
+
"user_pool_name": "geek-cafe-prod",
|
|
154
|
+
"exists": false
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**lambda-stack.json:**
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"name": "geek-cafe-prod-lambdas",
|
|
163
|
+
"module": "lambda_stack",
|
|
164
|
+
"ssm": {
|
|
165
|
+
"enabled": true,
|
|
166
|
+
"workload": "geek-cafe",
|
|
167
|
+
"environment": "prod"
|
|
168
|
+
},
|
|
169
|
+
"resources": [
|
|
170
|
+
{
|
|
171
|
+
"name": "geek-cafe-prod-get-cafes",
|
|
172
|
+
"src": "./src/handlers/cafes",
|
|
173
|
+
"handler": "get_cafes.lambda_handler"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**api-gateway-stack.json:**
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"name": "geek-cafe-prod-api-gateway",
|
|
183
|
+
"module": "api_gateway_stack",
|
|
184
|
+
"api_gateway": {
|
|
185
|
+
"name": "geek-cafe-prod-api",
|
|
186
|
+
"api_type": "REST",
|
|
187
|
+
"stage_name": "prod",
|
|
188
|
+
"ssm": {
|
|
189
|
+
"enabled": true,
|
|
190
|
+
"auto_export": true,
|
|
191
|
+
"workload": "geek-cafe",
|
|
192
|
+
"environment": "prod",
|
|
193
|
+
"imports": {
|
|
194
|
+
"workload": "geek-cafe",
|
|
195
|
+
"environment": "prod",
|
|
196
|
+
"user_pool_arn": "auto" // ✅ This is the key fix
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"cognito_authorizer": {
|
|
200
|
+
"authorizer_name": "geek-cafe-cognito-authorizer"
|
|
201
|
+
},
|
|
202
|
+
"routes": [
|
|
203
|
+
{
|
|
204
|
+
"path": "/cafes",
|
|
205
|
+
"method": "GET",
|
|
206
|
+
"lambda_name": "geek-cafe-prod-get-cafes",
|
|
207
|
+
"authorization_type": "COGNITO_USER_POOLS"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Summary of Changes
|
|
215
|
+
|
|
216
|
+
| Old Pattern (Combined) | New Pattern (Separated) |
|
|
217
|
+
|------------------------|-------------------------|
|
|
218
|
+
| `COGNITO_USER_POOL_ID` env var | SSM import with `user_pool_arn: "auto"` |
|
|
219
|
+
| Single stack with Lambda + API | Three stacks: Cognito → Lambda → API Gateway |
|
|
220
|
+
| Environment vars in CI/CD | Config-driven SSM parameters |
|
|
221
|
+
| `"exports": {"enabled": true}` ❌ | `"auto_export": true` ✅ |
|
|
222
|
+
|
|
223
|
+
## If Still Having Issues
|
|
224
|
+
|
|
225
|
+
1. **Check CDK Factory version:**
|
|
226
|
+
```bash
|
|
227
|
+
pip show cdk-factory
|
|
228
|
+
# Should be v0.8.0 or higher
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
2. **Enable debug logging:**
|
|
232
|
+
```bash
|
|
233
|
+
export LOG_LEVEL=DEBUG
|
|
234
|
+
cdk deploy
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
3. **Verify workload/environment match** in all three stacks
|
|
238
|
+
|
|
239
|
+
4. **Check SSM permissions** in your deployment role
|
|
240
|
+
|
|
241
|
+
5. **Use explicit path** as fallback if auto-discovery fails
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/examples/separate-api-gateway/api-gateway-stack.json
RENAMED
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
"stage_name": "prod",
|
|
10
10
|
"ssm": {
|
|
11
11
|
"enabled": true,
|
|
12
|
+
"auto_export": true,
|
|
12
13
|
"workload": "{{WORKLOAD_NAME}}",
|
|
13
14
|
"environment": "{{ENVIRONMENT}}",
|
|
14
|
-
"exports": {
|
|
15
|
-
"enabled": true
|
|
16
|
-
},
|
|
17
15
|
"imports": {
|
|
18
16
|
"workload": "{{WORKLOAD_NAME}}",
|
|
19
17
|
"environment": "{{ENVIRONMENT}}"
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/enhanced_ssm_config.py
RENAMED
|
@@ -86,7 +86,9 @@ class EnhancedSsmConfig:
|
|
|
86
86
|
self, attribute: str, custom_path: Optional[str] = None
|
|
87
87
|
) -> str:
|
|
88
88
|
"""Generate SSM parameter path using pattern or custom path"""
|
|
89
|
-
|
|
89
|
+
# Handle custom_path - must be a string starting with "/"
|
|
90
|
+
# Protect against incorrect config like: "exports": {"enabled": true}
|
|
91
|
+
if custom_path and isinstance(custom_path, str) and custom_path.startswith("/"):
|
|
90
92
|
return custom_path
|
|
91
93
|
|
|
92
94
|
# Convert underscore attribute names to hyphen format for consistent SSM paths
|
|
@@ -304,9 +304,28 @@ class ApiGatewayStack(IStack, EnhancedSsmParameterMixin):
|
|
|
304
304
|
)
|
|
305
305
|
|
|
306
306
|
def _setup_cognito_authorizer(self, api_gateway, api_id):
|
|
307
|
-
"""Setup Cognito authorizer if configured"""
|
|
307
|
+
"""Setup Cognito authorizer if configured AND if any routes need it"""
|
|
308
308
|
if not self.api_config.cognito_authorizer:
|
|
309
309
|
return None
|
|
310
|
+
|
|
311
|
+
# Check if any routes actually need the authorizer
|
|
312
|
+
# Don't create it if all routes are public (authorization_type: NONE)
|
|
313
|
+
routes = self.api_config.routes or []
|
|
314
|
+
needs_authorizer = any(
|
|
315
|
+
route.get("authorization_type") != "NONE"
|
|
316
|
+
for route in routes
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
# If we're not creating an authorizer but Cognito is configured,
|
|
320
|
+
# inform the integration utility so it can still perform security validations
|
|
321
|
+
if not needs_authorizer:
|
|
322
|
+
logger.info(
|
|
323
|
+
"Cognito authorizer configured but no routes require authorization. "
|
|
324
|
+
"Skipping authorizer creation but maintaining security validation context."
|
|
325
|
+
)
|
|
326
|
+
# Set a flag so the integration utility knows Cognito was available
|
|
327
|
+
self.integration_utility.cognito_configured = True
|
|
328
|
+
return None
|
|
310
329
|
|
|
311
330
|
route_config = ApiGatewayConfigRouteConfig({})
|
|
312
331
|
return self.integration_utility.get_or_create_authorizer(
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/api_gateway_integration_utility.py
RENAMED
|
@@ -40,6 +40,7 @@ class ApiGatewayIntegrationUtility:
|
|
|
40
40
|
self.account = scope.account
|
|
41
41
|
self.api_gateway = None
|
|
42
42
|
self.authorizer = None
|
|
43
|
+
self.cognito_configured = False # Flag for when Cognito is configured but authorizer not created
|
|
43
44
|
self._log_group = None
|
|
44
45
|
self._log_role = None
|
|
45
46
|
|
|
@@ -55,8 +56,10 @@ class ApiGatewayIntegrationUtility:
|
|
|
55
56
|
raise ValueError("API Gateway config is missing in Lambda function config")
|
|
56
57
|
|
|
57
58
|
# Validate authorization configuration for security
|
|
59
|
+
# Check if Cognito is available (either authorizer created OR configured but not created)
|
|
58
60
|
has_cognito_authorizer = (
|
|
59
61
|
self.authorizer is not None
|
|
62
|
+
or self.cognito_configured
|
|
60
63
|
or self._get_existing_authorizer_id_with_ssm_fallback(
|
|
61
64
|
api_config, stack_config
|
|
62
65
|
)
|
|
@@ -614,6 +617,10 @@ class ApiGatewayIntegrationUtility:
|
|
|
614
617
|
authorizer_name=authorizer_name,
|
|
615
618
|
identity_source=identity_source,
|
|
616
619
|
)
|
|
620
|
+
|
|
621
|
+
# The authorizer is automatically attached to the API Gateway when used in a method
|
|
622
|
+
# But we need to ensure it's created in the context of the API's scope
|
|
623
|
+
# The actual attachment happens when the authorizer is referenced in method creation
|
|
617
624
|
|
|
618
625
|
return self.authorizer
|
|
619
626
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.8.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.8.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/enhanced_base_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/_resources.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/api_gateway.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/auto_scaling.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/cloudfront.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/code_artifact.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/code_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/dynamodb.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/exisiting.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/lambda_function.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/lambda_layers.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/lambda_triggers.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/load_balancer.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/resource_mapping.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/resource_naming.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/resource_types.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/configurations/resources/security_group.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/lambdas/policies/policy_docs.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/s3_buckets/s3_bucket_construct.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/constructs/sqs/policies/sqs_policies.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/interfaces/enhanced_ssm_parameter_mixin.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/auto_scaling/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/aws_lambdas/lambda_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/buckets/bucket_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/cognito/cognito_stack.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/dynamodb/dynamodb_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/load_balancer/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/route53/route53_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stack_library/security_group/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/stages/websites/static_website_stage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.0 → cdk_factory-0.8.1}/src/cdk_factory/utilities/lambda_function_utilities.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|