cdk-factory 0.8.4__tar.gz → 0.8.5__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.5/BUG_FIX_SSM_IMPORTS_METADATA_FIELDS.md +123 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/PKG-INFO +1 -1
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/pyproject.toml +1 -1
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/enhanced_ssm_config.py +7 -0
- cdk_factory-0.8.5/src/cdk_factory/version.py +1 -0
- cdk_factory-0.8.4/GEEK_CAFE_FIX.md +0 -241
- cdk_factory-0.8.4/src/cdk_factory/version.py +0 -1
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/.gitignore +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/.windsurfrules +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/CHANGELOG_v0.8.1.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/CHANGELOG_v0.8.2.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/CHANGELOG_v0.8.3.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/LICENSE +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/README.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/RELEASE_NOTES_v0.8.2.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/SUMMARY_v0.8.2.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/SUMMARY_v0.8.3.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/archive/README.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/archive/migrate_to_enhanced_ssm.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/examples/json-imports/README.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/examples/separate-api-gateway/README.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/examples/separate-api-gateway/api-gateway-stack.json +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/examples/separate-api-gateway/config.json +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/examples/separate-api-gateway/lambda-stack.json +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/mypy.ini +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/publish_to_pypi.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/publish_to_pypi.sh +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/pysetup.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/pysetup.sh +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/requirements.dev.txt +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/requirements.tests.txt +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/requirements.txt +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/run-checks.sh +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/run-tests-clean-venv.sh +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/run-tests.sh +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/app.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/builds/README.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/cdk.json +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/commands/command_loader.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/base_config.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/cdk_config.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/deployment.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/deployment_wave.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/devops.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/enhanced_base_config.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/management.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/pipeline.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/pipeline_stage.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/_resources.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/api_gateway.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/apigateway_route_config.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/auto_scaling.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/cloudfront.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/cloudwatch_widget.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_artifact.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_artifact_login.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_repository.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/cognito.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/docker.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/dynamodb.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/ecr.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/exisiting.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_function.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_layers.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_triggers.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/load_balancer.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/rds.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_mapping.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_naming.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_types.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/route53.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/route53_hosted_zone.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/rum.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/s3.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/security_group.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/security_group_full_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/sqs.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/vpc.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/workload.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/cloudfront/cloudfront_distribution_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/ecr/ecr_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/lambda_function_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/lambda_function_docker_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/lambda_function_role_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/policies/policy_docs.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/policies/policy_statements.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/s3_buckets/s3_bucket_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_destination_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_source_construct.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/sqs/policies/sqs_policies.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/enhanced_ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/istack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/live_ssm_resolver.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/lambdas/health_handler.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/pipeline_factory.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/security/policies.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/security/roles.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/stage.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack/istack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_factory.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_module_loader.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_module_registry.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_modules.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/api_gateway/api_gateway_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/auto_scaling/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/aws_lambdas/lambda_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/buckets/README.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/buckets/bucket_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/code_artifact/code_artifact_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/cognito/cognito_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/dynamodb/dynamodb_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/ecr/README.md +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/ecr/ecr_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/load_balancer/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/load_balancer/load_balancer_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rds/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rds/rds_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/route53/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/route53/route53_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rum/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rum/rum_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/security_group/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/security_group/security_group_full_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/security_group/security_group_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/simple_queue_service/sqs_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/stack_base.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/vpc/__init__.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/vpc/vpc_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/websites/static_website_stack.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stages/websites/static_website_stage.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/api_gateway_integration_utility.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/commandline_args.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/configuration_loader.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/docker_utilities.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/environment_services.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/file_operations.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/git_utilities.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/json_loading_utility.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/lambda_function_utilities.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/os_execute.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utils/api_gateway_utilities.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/workload/workload_factory.py +0 -0
- {cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/handlers/test/handler.py +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Bug Fix: SSM Imports Processing Metadata Fields as Parameters
|
|
2
|
+
|
|
3
|
+
## Issue Summary
|
|
4
|
+
|
|
5
|
+
**Error:** `Unable to fetch parameters [geekcafe,prod] from parameter store for this account`
|
|
6
|
+
|
|
7
|
+
**Root Cause:** The SSM imports configuration processor was treating metadata fields (`workload`, `environment`) as actual parameters to import, causing CloudFormation to try fetching non-existent SSM parameters named "geekcafe" and "prod".
|
|
8
|
+
|
|
9
|
+
## The Bug
|
|
10
|
+
|
|
11
|
+
### Configuration Example
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"ssm": {
|
|
15
|
+
"imports": {
|
|
16
|
+
"workload": "geekcafe", // ❌ Incorrectly treated as parameter to import
|
|
17
|
+
"environment": "prod", // ❌ Incorrectly treated as parameter to import
|
|
18
|
+
"user_pool_arn": "auto" // ✅ Actual parameter to import
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### What Was Happening
|
|
25
|
+
The code in `enhanced_ssm_config.py` (line 140) iterated through ALL keys in the `imports` dict:
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
for attribute, import_value in self.ssm_imports.items():
|
|
29
|
+
# This was processing workload, environment, AND user_pool_arn
|
|
30
|
+
definitions.append(...)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This caused it to try to import:
|
|
34
|
+
1. ❌ SSM parameter named "geekcafe" (from `workload` key)
|
|
35
|
+
2. ❌ SSM parameter named "prod" (from `environment` key)
|
|
36
|
+
3. ✅ SSM parameter for `user_pool_arn` (the actual import)
|
|
37
|
+
|
|
38
|
+
CloudFormation then failed trying to fetch parameters "[geekcafe,prod]" which don't exist.
|
|
39
|
+
|
|
40
|
+
## The Fix
|
|
41
|
+
|
|
42
|
+
### Code Change
|
|
43
|
+
**File:** `src/cdk_factory/configurations/enhanced_ssm_config.py`
|
|
44
|
+
**Lines:** 140-146
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
# Handle dict format: {"attribute": "auto" or path}
|
|
48
|
+
# Skip metadata fields that are not actual imports
|
|
49
|
+
metadata_fields = {"workload", "environment", "organization"}
|
|
50
|
+
|
|
51
|
+
for attribute, import_value in self.ssm_imports.items():
|
|
52
|
+
# Skip metadata fields - they specify context, not what to import
|
|
53
|
+
if attribute in metadata_fields:
|
|
54
|
+
continue
|
|
55
|
+
|
|
56
|
+
# Process actual imports...
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### What Changed
|
|
60
|
+
- Added a set of `metadata_fields` that should be skipped
|
|
61
|
+
- Added a check to skip these fields before processing
|
|
62
|
+
- Now only actual resource imports (like `user_pool_arn`) are processed
|
|
63
|
+
|
|
64
|
+
## Testing
|
|
65
|
+
|
|
66
|
+
### Test File
|
|
67
|
+
`tests/unit/test_cognito_ssm_path_resolution.py`
|
|
68
|
+
|
|
69
|
+
### Test Verification
|
|
70
|
+
```python
|
|
71
|
+
ssm_imports={
|
|
72
|
+
"workload": "geekcafe", # Should be SKIPPED
|
|
73
|
+
"environment": "prod", # Should be SKIPPED
|
|
74
|
+
"user_pool_arn": "auto" # Should be processed
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
import_defs = config.get_import_definitions()
|
|
78
|
+
assert len(import_defs) == 1 # Only user_pool_arn, not workload/environment
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Impact
|
|
82
|
+
|
|
83
|
+
### Before Fix
|
|
84
|
+
- ❌ CloudFormation deployment failed with "Unable to fetch parameters [geekcafe,prod]"
|
|
85
|
+
- ❌ Auto-import feature (`"user_pool_arn": "auto"`) was broken
|
|
86
|
+
- ❌ Users had to use explicit paths as workaround
|
|
87
|
+
|
|
88
|
+
### After Fix
|
|
89
|
+
- ✅ CloudFormation deployment succeeds
|
|
90
|
+
- ✅ Auto-import feature works correctly
|
|
91
|
+
- ✅ Metadata fields are correctly recognized as context, not imports
|
|
92
|
+
- ✅ Only actual resource imports are processed
|
|
93
|
+
|
|
94
|
+
## Related Issues
|
|
95
|
+
|
|
96
|
+
This fix resolves the issue where API Gateway could not auto-import Cognito User Pool ARN from SSM Parameter Store, even though:
|
|
97
|
+
1. The path resolution logic was correct (`/geekcafe/prod/cognito/user-pool/user-pool-arn`)
|
|
98
|
+
2. The SSM parameter existed in AWS
|
|
99
|
+
3. The configuration looked correct
|
|
100
|
+
|
|
101
|
+
The bug was subtle - the metadata fields used to specify WHERE to look were being processed as WHAT to import.
|
|
102
|
+
|
|
103
|
+
## Migration Notes
|
|
104
|
+
|
|
105
|
+
No configuration changes required. Existing configurations will work correctly after this fix. The metadata fields (`workload`, `environment`) can remain in the `imports` section - they will now be properly filtered out.
|
|
106
|
+
|
|
107
|
+
## Files Changed
|
|
108
|
+
|
|
109
|
+
1. `src/cdk_factory/configurations/enhanced_ssm_config.py` - Core fix
|
|
110
|
+
2. `tests/unit/test_cognito_ssm_path_resolution.py` - New test
|
|
111
|
+
3. `tests/unit/test_api_gateway_cognito_auto_import.py` - Diagnostic test
|
|
112
|
+
|
|
113
|
+
## Verified Scenarios
|
|
114
|
+
|
|
115
|
+
- ✅ API Gateway auto-importing Cognito User Pool ARN
|
|
116
|
+
- ✅ Lambda auto-importing DynamoDB table names
|
|
117
|
+
- ✅ RDS auto-importing VPC IDs
|
|
118
|
+
- ✅ Mixed explicit paths and auto-discovery
|
|
119
|
+
|
|
120
|
+
## Version
|
|
121
|
+
|
|
122
|
+
Fixed in: Next release
|
|
123
|
+
Issue reported: 2025-10-10
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/enhanced_ssm_config.py
RENAMED
|
@@ -137,7 +137,14 @@ class EnhancedSsmConfig:
|
|
|
137
137
|
if self.ssm_imports:
|
|
138
138
|
if isinstance(self.ssm_imports, dict):
|
|
139
139
|
# Handle dict format: {"attribute": "auto" or path}
|
|
140
|
+
# Skip metadata fields that are not actual imports
|
|
141
|
+
metadata_fields = {"workload", "environment", "organization"}
|
|
142
|
+
|
|
140
143
|
for attribute, import_value in self.ssm_imports.items():
|
|
144
|
+
# Skip metadata fields - they specify context, not what to import
|
|
145
|
+
if attribute in metadata_fields:
|
|
146
|
+
continue
|
|
147
|
+
|
|
141
148
|
if import_value == "auto":
|
|
142
149
|
# Use auto-discovery with source mapping
|
|
143
150
|
imports_config = RESOURCE_AUTO_IMPORTS.get(self.resource_type, {})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.8.5"
|
|
@@ -1,241 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.8.4"
|
|
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.4 → cdk_factory-0.8.5}/examples/separate-api-gateway/api-gateway-stack.json
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
|
|
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.4 → cdk_factory-0.8.5}/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.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/_resources.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/api_gateway.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/auto_scaling.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/cloudfront.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_artifact.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_repository.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/dynamodb.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/exisiting.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_function.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_layers.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_triggers.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/load_balancer.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_mapping.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_naming.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/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.4 → cdk_factory-0.8.5}/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.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/policies/policy_docs.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/s3_buckets/s3_bucket_construct.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/constructs/sqs/policies/sqs_policies.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/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
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/auto_scaling/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/aws_lambdas/lambda_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/buckets/bucket_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/cognito/cognito_stack.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/dynamodb/dynamodb_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/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.4 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/route53/route53_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/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.4 → cdk_factory-0.8.5}/src/cdk_factory/stages/websites/static_website_stage.py
RENAMED
|
File without changes
|
{cdk_factory-0.8.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/api_gateway_integration_utility.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.4 → cdk_factory-0.8.5}/src/cdk_factory/utilities/lambda_function_utilities.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|