cdk-factory 0.8.3__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.5/CHANGELOG_v0.8.3.md +223 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/PKG-INFO +1 -1
- cdk_factory-0.8.5/SUMMARY_v0.8.3.md +146 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/pyproject.toml +1 -1
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/pysetup.py +432 -675
- cdk_factory-0.8.5/requirements.tests.txt +3 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/run-tests.sh +15 -7
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/enhanced_ssm_config.py +7 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/api_gateway/api_gateway_stack.py +15 -10
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/lambda_function_utilities.py +16 -2
- cdk_factory-0.8.5/src/cdk_factory/version.py +1 -0
- cdk_factory-0.8.3/GEEK_CAFE_FIX.md +0 -241
- cdk_factory-0.8.3/requirements.tests.txt +0 -1
- cdk_factory-0.8.3/src/cdk_factory/version.py +0 -1
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/.gitignore +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/.windsurfrules +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/CHANGELOG_v0.8.1.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/CHANGELOG_v0.8.2.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/LICENSE +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/README.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/RELEASE_NOTES_v0.8.2.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/SUMMARY_v0.8.2.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/archive/README.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/archive/migrate_to_enhanced_ssm.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/examples/json-imports/README.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/examples/separate-api-gateway/README.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/examples/separate-api-gateway/api-gateway-stack.json +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/examples/separate-api-gateway/config.json +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/examples/separate-api-gateway/lambda-stack.json +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/mypy.ini +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/publish_to_pypi.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/publish_to_pypi.sh +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/pysetup.sh +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/requirements.dev.txt +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/requirements.txt +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/run-checks.sh +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/run-tests-clean-venv.sh +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/app.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/builds/README.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/cdk.json +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/commands/command_loader.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/base_config.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/cdk_config.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/deployment.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/deployment_wave.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/devops.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/enhanced_base_config.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/management.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/pipeline.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/pipeline_stage.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/_resources.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/api_gateway.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/apigateway_route_config.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/auto_scaling.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/cloudfront.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/cloudwatch_widget.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_artifact.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_artifact_login.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/code_repository.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/cognito.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/docker.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/dynamodb.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/ecr.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/exisiting.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_function.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_layers.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/lambda_triggers.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/load_balancer.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/rds.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_mapping.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_naming.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/resource_types.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/route53.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/route53_hosted_zone.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/rum.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/s3.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/security_group.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/security_group_full_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/sqs.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/resources/vpc.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/configurations/workload.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/cloudfront/cloudfront_distribution_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/ecr/ecr_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/lambda_function_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/lambda_function_docker_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/lambda_function_role_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/policies/policy_docs.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/lambdas/policies/policy_statements.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/s3_buckets/s3_bucket_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_destination_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_source_construct.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/constructs/sqs/policies/sqs_policies.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/enhanced_ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/istack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/live_ssm_resolver.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/interfaces/ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/lambdas/health_handler.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/pipeline_factory.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/security/policies.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/security/roles.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/pipeline/stage.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack/istack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_factory.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_module_loader.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_module_registry.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack/stack_modules.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/auto_scaling/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/aws_lambdas/lambda_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/buckets/README.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/buckets/bucket_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/code_artifact/code_artifact_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/cognito/cognito_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/dynamodb/dynamodb_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/ecr/README.md +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/ecr/ecr_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/load_balancer/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/load_balancer/load_balancer_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rds/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rds/rds_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/route53/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/route53/route53_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rum/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/rum/rum_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/security_group/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/security_group/security_group_full_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/security_group/security_group_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/simple_queue_service/sqs_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/stack_base.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/vpc/__init__.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/vpc/vpc_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stack_library/websites/static_website_stack.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/stages/websites/static_website_stage.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/api_gateway_integration_utility.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/commandline_args.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/configuration_loader.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/docker_utilities.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/environment_services.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/file_operations.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/git_utilities.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/json_loading_utility.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utilities/os_execute.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/utils/api_gateway_utilities.py +0 -0
- {cdk_factory-0.8.3 → cdk_factory-0.8.5}/src/cdk_factory/workload/workload_factory.py +0 -0
- {cdk_factory-0.8.3 → 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
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# CDK Factory v0.8.3 Release Notes
|
|
2
|
+
|
|
3
|
+
Released: October 9, 2025
|
|
4
|
+
|
|
5
|
+
## Bug Fixes
|
|
6
|
+
|
|
7
|
+
### 1. Fixed Lambda Build Warning: "__pycache__ already exists"
|
|
8
|
+
|
|
9
|
+
**Issue**: During CDK synth/deploy, pip would display warnings:
|
|
10
|
+
```
|
|
11
|
+
WARNING: Target directory /var/folders/.../lambda-builds/my-lambda/__pycache__ already exists.
|
|
12
|
+
Specify --upgrade to force replacement.
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Root Cause**:
|
|
16
|
+
- Lambda source code was copied to the build directory, including `__pycache__` directories
|
|
17
|
+
- Pip would then complain about existing `__pycache__` directories when installing dependencies
|
|
18
|
+
|
|
19
|
+
**Fix**:
|
|
20
|
+
1. **Excluded build artifacts during copy** (`lambda_function_utilities.py`)
|
|
21
|
+
- Added `ignore_patterns` function to `__validate_directories()`
|
|
22
|
+
- Excludes: `__pycache__`, `.pyc`, `.pyo`, `.pytest_cache`, `.mypy_cache`
|
|
23
|
+
- Prevents build artifacts from being copied to Lambda build directory
|
|
24
|
+
|
|
25
|
+
2. **Added --upgrade flag to pip install**
|
|
26
|
+
- Changed: `pip install -r {requirement} -t {output_dir}`
|
|
27
|
+
- To: `pip install -r {requirement} -t {output_dir} --upgrade`
|
|
28
|
+
- Forces pip to replace any existing packages without warnings
|
|
29
|
+
|
|
30
|
+
**Impact**:
|
|
31
|
+
- ✅ Eliminates pip warnings during Lambda builds
|
|
32
|
+
- ✅ Cleaner build output
|
|
33
|
+
- ✅ Faster builds (no unnecessary `__pycache__` copies)
|
|
34
|
+
- ✅ More reliable builds
|
|
35
|
+
|
|
36
|
+
**Example Before:**
|
|
37
|
+
```bash
|
|
38
|
+
cdk synth
|
|
39
|
+
# Output:
|
|
40
|
+
WARNING: Target directory /var/folders/2p/.../lambda-builds/my-lambda/__pycache__ already exists.
|
|
41
|
+
WARNING: Target directory /var/folders/2p/.../lambda-builds/my-lambda/.pytest_cache already exists.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Example After:**
|
|
45
|
+
```bash
|
|
46
|
+
cdk synth
|
|
47
|
+
# Output: Clean, no warnings
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Enhanced Lambda Route Naming in API Gateway
|
|
51
|
+
|
|
52
|
+
**Issue**: Multiple routes to the same path with different HTTP methods would cause naming conflicts.
|
|
53
|
+
|
|
54
|
+
**Fix**:
|
|
55
|
+
- Routes now support explicit `name` field for unique identification
|
|
56
|
+
- Auto-generated names include HTTP method for uniqueness: `{method}-{path}`
|
|
57
|
+
- Example: `GET /api/users` → `get-api-users`, `POST /api/users` → `post-api-users`
|
|
58
|
+
|
|
59
|
+
**Before:**
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"routes": [
|
|
63
|
+
{"path": "/users", "method": "GET"}, // Could conflict
|
|
64
|
+
{"path": "/users", "method": "POST"} // Could conflict
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**After (Auto-named):**
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"routes": [
|
|
73
|
+
{"path": "/users", "method": "GET"}, // Auto-named: get-users
|
|
74
|
+
{"path": "/users", "method": "POST"} // Auto-named: post-users
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**After (Explicit naming):**
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"routes": [
|
|
83
|
+
{"path": "/users", "method": "GET", "name": "list-users"},
|
|
84
|
+
{"path": "/users", "method": "POST", "name": "create-user"}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Carried Forward from v0.8.2
|
|
90
|
+
|
|
91
|
+
All features and fixes from v0.8.2 are included:
|
|
92
|
+
|
|
93
|
+
### Features
|
|
94
|
+
- ✅ **`__imports__` keyword** - More intuitive configuration imports
|
|
95
|
+
- ✅ **Backward compatible** - `__inherits__` still works
|
|
96
|
+
|
|
97
|
+
### Bug Fixes
|
|
98
|
+
- ✅ **SSM Export Configuration** - Type validation
|
|
99
|
+
- ✅ **Cognito SSM Integration** - Auto-discovery support
|
|
100
|
+
- ✅ **Authorizer Creation** - Only created when needed
|
|
101
|
+
- ✅ **SSM Deprecation Warnings** - Eliminated
|
|
102
|
+
|
|
103
|
+
## Test Coverage
|
|
104
|
+
|
|
105
|
+
- **167 tests passing** ✅
|
|
106
|
+
- All existing tests maintained
|
|
107
|
+
- No new tests needed (internal improvements)
|
|
108
|
+
|
|
109
|
+
## Breaking Changes
|
|
110
|
+
|
|
111
|
+
**None** - All changes are backward compatible
|
|
112
|
+
|
|
113
|
+
## Upgrade Instructions
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pip install --upgrade cdk-factory
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Verify:
|
|
120
|
+
```bash
|
|
121
|
+
python -c "import cdk_factory; print(cdk_factory.__version__)"
|
|
122
|
+
# Output: 0.8.3
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Technical Details
|
|
126
|
+
|
|
127
|
+
### Files Modified
|
|
128
|
+
|
|
129
|
+
**src/cdk_factory/utilities/lambda_function_utilities.py:**
|
|
130
|
+
1. Added `ignore_patterns()` function in `__validate_directories()`
|
|
131
|
+
- Filters out `__pycache__`, `.pyc`, `.pyo`, `.pytest_cache`, `.mypy_cache`
|
|
132
|
+
- Applied to `shutil.copytree()` operation
|
|
133
|
+
|
|
134
|
+
2. Modified pip install command
|
|
135
|
+
- Added `--upgrade` flag to force replacement of existing packages
|
|
136
|
+
|
|
137
|
+
**src/cdk_factory/stack_library/api_gateway/api_gateway_stack.py:**
|
|
138
|
+
1. Enhanced `_setup_single_lambda_route()` naming logic
|
|
139
|
+
- Supports explicit `name` field in route config
|
|
140
|
+
- Auto-generates unique names with HTTP method prefix
|
|
141
|
+
|
|
142
|
+
### Excluded Patterns
|
|
143
|
+
|
|
144
|
+
The following patterns are now excluded when copying Lambda source code:
|
|
145
|
+
- `__pycache__/` - Python bytecode cache
|
|
146
|
+
- `*.pyc` - Compiled Python files
|
|
147
|
+
- `*.pyo` - Optimized Python files
|
|
148
|
+
- `.pytest_cache/` - Pytest cache
|
|
149
|
+
- `.mypy_cache/` - MyPy cache
|
|
150
|
+
|
|
151
|
+
## Performance Improvements
|
|
152
|
+
|
|
153
|
+
- **Faster Lambda builds** - Fewer files copied (excludes cache directories)
|
|
154
|
+
- **Smaller Lambda packages** - Build artifacts not included
|
|
155
|
+
- **Cleaner logs** - No pip warnings
|
|
156
|
+
|
|
157
|
+
## Migration Guide
|
|
158
|
+
|
|
159
|
+
### No Migration Required
|
|
160
|
+
|
|
161
|
+
This release is 100% backward compatible. Simply upgrade and continue using:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
pip install --upgrade cdk-factory==0.8.3
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Optional: Clean Old Build Directories
|
|
168
|
+
|
|
169
|
+
If you want to clean up old build directories manually:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
# Find temp build directories
|
|
173
|
+
find /tmp/cdk-factory/lambda-builds -type d -name "__pycache__" -exec rm -rf {} +
|
|
174
|
+
find /var/folders -name "cdk-factory" -type d 2>/dev/null
|
|
175
|
+
|
|
176
|
+
# Or remove all Lambda builds
|
|
177
|
+
rm -rf /tmp/cdk-factory/lambda-builds
|
|
178
|
+
rm -rf "$TMPDIR/cdk-factory/lambda-builds"
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The next `cdk synth` will create fresh, clean build directories.
|
|
182
|
+
|
|
183
|
+
## Verification
|
|
184
|
+
|
|
185
|
+
After upgrading, verify the fix:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Deploy or synth
|
|
189
|
+
cdk synth
|
|
190
|
+
|
|
191
|
+
# Should NOT see these warnings anymore:
|
|
192
|
+
# ❌ WARNING: Target directory .../__pycache__ already exists
|
|
193
|
+
# ✅ Clean output
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Known Issues
|
|
197
|
+
|
|
198
|
+
None
|
|
199
|
+
|
|
200
|
+
## Contributors
|
|
201
|
+
|
|
202
|
+
- Eric Wilson (@geekcafe)
|
|
203
|
+
|
|
204
|
+
## Related Issues
|
|
205
|
+
|
|
206
|
+
- Fixes pip warnings during Lambda function builds
|
|
207
|
+
- Improves Lambda package cleanliness
|
|
208
|
+
- Enhances API Gateway route naming flexibility
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
## Summary
|
|
213
|
+
|
|
214
|
+
v0.8.3 is a maintenance release that eliminates annoying pip warnings during Lambda builds and enhances route naming in API Gateway. No breaking changes, just cleaner builds and better DX (Developer Experience).
|
|
215
|
+
|
|
216
|
+
**Key improvements:**
|
|
217
|
+
- ✅ No more `__pycache__` warnings
|
|
218
|
+
- ✅ Cleaner build output
|
|
219
|
+
- ✅ Faster Lambda builds
|
|
220
|
+
- ✅ Better route naming in API Gateway
|
|
221
|
+
- ✅ 100% backward compatible
|
|
222
|
+
|
|
223
|
+
Happy deploying! 🚀
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# CDK Factory v0.8.3 - Summary
|
|
2
|
+
|
|
3
|
+
## Quick Fix: Eliminated Lambda Build Warnings
|
|
4
|
+
|
|
5
|
+
### The Problem
|
|
6
|
+
|
|
7
|
+
During `cdk synth` or `cdk deploy`, you'd see annoying warnings:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
WARNING: Target directory /var/folders/2p/4t4zjp0n20vg6y66vgdpvhvr0000gn/T/cdk-factory/lambda-builds/geekcafe-prod-create-site-message/__pycache__ already exists. Specify --upgrade to force replacement.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### The Solution
|
|
14
|
+
|
|
15
|
+
**Two-part fix in `lambda_function_utilities.py`:**
|
|
16
|
+
|
|
17
|
+
1. **Exclude build artifacts during copy**
|
|
18
|
+
```python
|
|
19
|
+
# Added ignore_patterns function
|
|
20
|
+
def ignore_patterns(directory, files):
|
|
21
|
+
"""Ignore __pycache__, .pyc files, and other build artifacts"""
|
|
22
|
+
return [
|
|
23
|
+
f for f in files
|
|
24
|
+
if f == '__pycache__'
|
|
25
|
+
or f.endswith('.pyc')
|
|
26
|
+
or f.endswith('.pyo')
|
|
27
|
+
or f == '.pytest_cache'
|
|
28
|
+
or f == '.mypy_cache'
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
# Applied to copytree
|
|
32
|
+
shutil.copytree(lambda_directory, output_dir, dirs_exist_ok=True, ignore=ignore_patterns)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. **Added --upgrade flag to pip**
|
|
36
|
+
```python
|
|
37
|
+
# Before
|
|
38
|
+
pip install -r {requirement} -t {output_dir}
|
|
39
|
+
|
|
40
|
+
# After
|
|
41
|
+
pip install -r {requirement} -t {output_dir} --upgrade
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Benefits
|
|
45
|
+
|
|
46
|
+
✅ **No more warnings** - Clean build output
|
|
47
|
+
✅ **Faster builds** - Fewer files to copy
|
|
48
|
+
✅ **Smaller packages** - No cache files in Lambda deployment
|
|
49
|
+
✅ **Better reliability** - Fresh pip installs every time
|
|
50
|
+
|
|
51
|
+
### Bonus Fix: API Gateway Route Naming
|
|
52
|
+
|
|
53
|
+
Enhanced route naming to support:
|
|
54
|
+
- Explicit `name` field in route config
|
|
55
|
+
- Auto-generated names include HTTP method: `{method}-{path}`
|
|
56
|
+
- Prevents conflicts when same path has multiple methods
|
|
57
|
+
|
|
58
|
+
## Testing
|
|
59
|
+
|
|
60
|
+
✅ **167/167 tests passing**
|
|
61
|
+
✅ No breaking changes
|
|
62
|
+
✅ 100% backward compatible
|
|
63
|
+
|
|
64
|
+
## Files Changed
|
|
65
|
+
|
|
66
|
+
1. `src/cdk_factory/utilities/lambda_function_utilities.py`
|
|
67
|
+
- Line 298-311: Added ignore_patterns function
|
|
68
|
+
- Line 393-395: Added --upgrade flag to pip
|
|
69
|
+
|
|
70
|
+
2. `src/cdk_factory/stack_library/api_gateway/api_gateway_stack.py`
|
|
71
|
+
- Line 439-447: Enhanced route naming logic
|
|
72
|
+
|
|
73
|
+
## Upgrade
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install --upgrade cdk-factory
|
|
77
|
+
# Version: 0.8.3
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Verification
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
cdk synth
|
|
84
|
+
# Should see clean output, no __pycache__ warnings
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## What Gets Excluded
|
|
88
|
+
|
|
89
|
+
These build artifacts are now excluded when copying Lambda code:
|
|
90
|
+
- `__pycache__/` directories
|
|
91
|
+
- `*.pyc` files (compiled Python)
|
|
92
|
+
- `*.pyo` files (optimized Python)
|
|
93
|
+
- `.pytest_cache/` directories
|
|
94
|
+
- `.mypy_cache/` directories
|
|
95
|
+
|
|
96
|
+
## Before vs After
|
|
97
|
+
|
|
98
|
+
### Before v0.8.3
|
|
99
|
+
```bash
|
|
100
|
+
$ cdk synth
|
|
101
|
+
output dir: /var/folders/.../lambda-builds/my-lambda
|
|
102
|
+
WARNING: Target directory .../__pycache__ already exists.
|
|
103
|
+
WARNING: Target directory .../.pytest_cache already exists.
|
|
104
|
+
# Many more warnings...
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### After v0.8.3
|
|
108
|
+
```bash
|
|
109
|
+
$ cdk synth
|
|
110
|
+
output dir: /var/folders/.../lambda-builds/my-lambda
|
|
111
|
+
making output dir: /var/folders/.../lambda-builds/my-lambda
|
|
112
|
+
# Clean output, no warnings ✅
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Impact
|
|
116
|
+
|
|
117
|
+
**Developer Experience:**
|
|
118
|
+
- Cleaner terminal output
|
|
119
|
+
- Less noise during builds
|
|
120
|
+
- Faster build times
|
|
121
|
+
|
|
122
|
+
**Technical:**
|
|
123
|
+
- Proper artifact exclusion
|
|
124
|
+
- Forces pip to upgrade packages
|
|
125
|
+
- Better cache management
|
|
126
|
+
|
|
127
|
+
## Rollback
|
|
128
|
+
|
|
129
|
+
If needed (unlikely):
|
|
130
|
+
```bash
|
|
131
|
+
pip install cdk-factory==0.8.2
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Status
|
|
135
|
+
|
|
136
|
+
✅ **Published to PyPI**
|
|
137
|
+
✅ **All tests passing**
|
|
138
|
+
✅ **Backward compatible**
|
|
139
|
+
✅ **Ready for production**
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
**Version:** 0.8.3
|
|
144
|
+
**Released:** October 9, 2025
|
|
145
|
+
**Type:** Bug Fix
|
|
146
|
+
**Breaking Changes:** None
|