cdk-factory 0.10.0__tar.gz → 0.12.0__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.10.0 → cdk_factory-0.12.0}/PKG-INFO +1 -1
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/pyproject.toml +1 -1
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/lambda_edge.py +5 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/s3.py +3 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/cloudfront/cloudfront_distribution_construct.py +18 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/lambda_edge/lambda_edge_stack.py +44 -3
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/websites/static_website_stack.py +59 -0
- cdk_factory-0.12.0/src/cdk_factory/version.py +1 -0
- cdk_factory-0.10.0/src/cdk_factory/version.py +0 -1
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/.gitignore +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/.windsurfrules +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/LICENSE +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/archive/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/archive/migrate_to_enhanced_ssm.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/examples/json-imports/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/examples/separate-api-gateway/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/examples/separate-api-gateway/api-gateway-stack.json +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/examples/separate-api-gateway/config.json +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/examples/separate-api-gateway/lambda-stack.json +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/mypy.ini +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/publish_to_pypi.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/publish_to_pypi.sh +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/pysetup.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/pysetup.sh +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/requirements.dev.txt +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/requirements.tests.txt +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/requirements.txt +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/run-checks.sh +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/run-tests-clean-venv.sh +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/run-tests.sh +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/app.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/builds/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/cdk.json +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/cli.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/commands/command_loader.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/base_config.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/cdk_config.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/deployment.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/deployment_wave.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/devops.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/enhanced_base_config.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/enhanced_ssm_config.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/management.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/pipeline.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/pipeline_stage.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/_resources.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/api_gateway.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/apigateway_route_config.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/auto_scaling.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/cloudfront.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/cloudwatch_widget.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/code_artifact.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/code_artifact_login.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/code_repository.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/cognito.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/docker.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/dynamodb.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/ecr.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/ecs_service.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/exisiting.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/lambda_function.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/lambda_layers.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/lambda_triggers.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/load_balancer.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/monitoring.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/rds.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/resource_mapping.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/resource_naming.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/resource_types.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/route53.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/route53_hosted_zone.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/rum.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/security_group.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/security_group_full_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/sqs.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/vpc.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/workload.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/ecr/ecr_construct.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/lambdas/lambda_function_construct.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/lambdas/lambda_function_docker_construct.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/lambdas/lambda_function_role_construct.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/lambdas/policies/policy_docs.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/lambdas/policies/policy_statements.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/s3_buckets/s3_bucket_construct.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_destination_construct.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/s3_buckets/s3_bucket_replication_source_construct.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/sqs/policies/sqs_policies.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/interfaces/enhanced_ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/interfaces/istack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/interfaces/live_ssm_resolver.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/interfaces/ssm_parameter_mixin.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/lambdas/edge/ip_gate/handler.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/lambdas/health_handler.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/pipeline/path_utils.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/pipeline/pipeline_factory.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/pipeline/security/policies.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/pipeline/security/roles.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/pipeline/stage.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack/istack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack/stack_factory.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack/stack_module_loader.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack/stack_module_registry.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack/stack_modules.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/api_gateway/api_gateway_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/auto_scaling/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/aws_lambdas/lambda_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/buckets/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/buckets/bucket_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/cloudfront/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/cloudfront/cloudfront_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/code_artifact/code_artifact_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/cognito/cognito_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/dynamodb/dynamodb_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/ecr/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/ecr/ecr_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/ecs/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/ecs/ecs_service_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/lambda_edge/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/load_balancer/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/load_balancer/load_balancer_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/monitoring/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/monitoring/monitoring_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/rds/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/rds/rds_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/route53/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/route53/route53_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/rum/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/rum/rum_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/security_group/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/security_group/security_group_full_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/security_group/security_group_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/simple_queue_service/sqs_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/stack_base.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/vpc/__init__.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/vpc/vpc_stack.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stages/websites/static_website_stage.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/templates/README.md +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/templates/app.py.template +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/templates/cdk.json.template +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/api_gateway_integration_utility.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/commandline_args.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/configuration_loader.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/docker_utilities.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/environment_services.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/file_operations.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/git_utilities.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/json_loading_utility.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/lambda_function_utilities.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/os_execute.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utils/api_gateway_utilities.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/workload/workload_factory.py +0 -0
- {cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/handlers/test/handler.py +0 -0
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/lambda_edge.py
RENAMED
|
@@ -90,3 +90,8 @@ class LambdaEdgeConfig(EnhancedBaseConfig):
|
|
|
90
90
|
def include_body(self) -> bool:
|
|
91
91
|
"""Whether to include request body in origin-request events"""
|
|
92
92
|
return self._config.get("include_body", False)
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def tags(self) -> Dict[str, str]:
|
|
96
|
+
"""Tags to apply to the Lambda function"""
|
|
97
|
+
return self._config.get("tags", {})
|
|
@@ -123,6 +123,9 @@ class S3BucketConfig(EnhancedBaseConfig):
|
|
|
123
123
|
def removal_policy(self) -> cdk.RemovalPolicy:
|
|
124
124
|
"""The Removal policy"""
|
|
125
125
|
value = self.config.get("removal_policy", "retain")
|
|
126
|
+
if isinstance(value, str):
|
|
127
|
+
value = value.lower()
|
|
128
|
+
|
|
126
129
|
if value == "destroy":
|
|
127
130
|
return cdk.RemovalPolicy.DESTROY
|
|
128
131
|
elif value == "snapshot":
|
|
@@ -7,9 +7,13 @@ from aws_cdk import aws_cloudfront_origins as origins
|
|
|
7
7
|
from aws_cdk import aws_iam as iam
|
|
8
8
|
from aws_cdk import aws_lambda as _lambda
|
|
9
9
|
from aws_cdk import aws_s3 as s3
|
|
10
|
+
from aws_cdk import aws_ssm as ssm
|
|
11
|
+
from aws_lambda_powertools import Logger
|
|
10
12
|
from constructs import Construct
|
|
11
13
|
from cdk_factory.configurations.stack import StackConfig
|
|
12
14
|
|
|
15
|
+
logger = Logger(__name__)
|
|
16
|
+
|
|
13
17
|
|
|
14
18
|
class CloudFrontDistributionConstruct(Construct):
|
|
15
19
|
"""
|
|
@@ -241,6 +245,20 @@ class CloudFrontDistributionConstruct(Construct):
|
|
|
241
245
|
if not lambda_arn:
|
|
242
246
|
continue # Skip if no ARN provided
|
|
243
247
|
|
|
248
|
+
# Check if ARN is an SSM parameter reference
|
|
249
|
+
if lambda_arn.startswith("{{ssm:") and lambda_arn.endswith("}}"):
|
|
250
|
+
ssm_param_path = lambda_arn[6:-2] # Extract parameter path
|
|
251
|
+
logger.info(f"Importing Lambda ARN from SSM parameter: {ssm_param_path}")
|
|
252
|
+
|
|
253
|
+
# Import SSM parameter - this creates a reference that resolves at deployment time
|
|
254
|
+
param = ssm.StringParameter.from_string_parameter_name(
|
|
255
|
+
self,
|
|
256
|
+
f"lambda-edge-arn-{hash(ssm_param_path) % 10000}",
|
|
257
|
+
ssm_param_path
|
|
258
|
+
)
|
|
259
|
+
lambda_arn = param.string_value
|
|
260
|
+
logger.info(f"Lambda ARN will be resolved from SSM: {ssm_param_path}")
|
|
261
|
+
|
|
244
262
|
# Map event type string to CloudFront enum
|
|
245
263
|
event_type_map = {
|
|
246
264
|
"viewer-request": cloudfront.LambdaEdgeEventType.VIEWER_REQUEST,
|
|
@@ -6,13 +6,14 @@ Maintainers: Eric Wilson
|
|
|
6
6
|
MIT License. See Project Root for the license information.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from typing import Optional
|
|
9
|
+
from typing import Optional, Dict
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
12
|
import aws_cdk as cdk
|
|
13
13
|
from aws_cdk import aws_lambda as _lambda
|
|
14
14
|
from aws_cdk import aws_iam as iam
|
|
15
15
|
from aws_cdk import aws_logs as logs
|
|
16
|
+
from aws_cdk import aws_ssm as ssm
|
|
16
17
|
from aws_lambda_powertools import Logger
|
|
17
18
|
from constructs import Construct
|
|
18
19
|
|
|
@@ -93,6 +94,34 @@ class LambdaEdgeStack(IStack, EnhancedSsmParameterMixin):
|
|
|
93
94
|
# Add outputs
|
|
94
95
|
self._add_outputs(function_name)
|
|
95
96
|
|
|
97
|
+
def _resolve_environment_variables(self) -> Dict[str, str]:
|
|
98
|
+
"""
|
|
99
|
+
Resolve environment variables, including SSM parameter references.
|
|
100
|
+
Supports {{ssm:parameter-path}} syntax for dynamic SSM lookups.
|
|
101
|
+
Uses CDK tokens that resolve at deployment time, not synthesis time.
|
|
102
|
+
"""
|
|
103
|
+
resolved_env = {}
|
|
104
|
+
|
|
105
|
+
for key, value in self.edge_config.environment.items():
|
|
106
|
+
# Check if value is an SSM parameter reference
|
|
107
|
+
if isinstance(value, str) and value.startswith("{{ssm:") and value.endswith("}}"):
|
|
108
|
+
# Extract SSM parameter path
|
|
109
|
+
ssm_param_path = value[6:-2] # Remove {{ssm: and }}
|
|
110
|
+
|
|
111
|
+
# Import SSM parameter - this creates a token that resolves at deployment time
|
|
112
|
+
param = ssm.StringParameter.from_string_parameter_name(
|
|
113
|
+
self,
|
|
114
|
+
f"env-{key}-{hash(ssm_param_path) % 10000}",
|
|
115
|
+
ssm_param_path
|
|
116
|
+
)
|
|
117
|
+
resolved_value = param.string_value
|
|
118
|
+
logger.info(f"Resolved environment variable {key} from SSM {ssm_param_path}")
|
|
119
|
+
resolved_env[key] = resolved_value
|
|
120
|
+
else:
|
|
121
|
+
resolved_env[key] = value
|
|
122
|
+
|
|
123
|
+
return resolved_env
|
|
124
|
+
|
|
96
125
|
def _create_lambda_function(self, function_name: str) -> None:
|
|
97
126
|
"""Create the Lambda function"""
|
|
98
127
|
|
|
@@ -125,6 +154,9 @@ class LambdaEdgeStack(IStack, EnhancedSsmParameterMixin):
|
|
|
125
154
|
_lambda.Runtime.PYTHON_3_11
|
|
126
155
|
)
|
|
127
156
|
|
|
157
|
+
# Resolve environment variables (handles SSM parameter references)
|
|
158
|
+
resolved_environment = self._resolve_environment_variables()
|
|
159
|
+
|
|
128
160
|
# Create execution role with CloudWatch Logs permissions
|
|
129
161
|
execution_role = iam.Role(
|
|
130
162
|
self,
|
|
@@ -153,7 +185,7 @@ class LambdaEdgeStack(IStack, EnhancedSsmParameterMixin):
|
|
|
153
185
|
timeout=cdk.Duration.seconds(self.edge_config.timeout),
|
|
154
186
|
description=self.edge_config.description,
|
|
155
187
|
role=execution_role,
|
|
156
|
-
environment=
|
|
188
|
+
environment=resolved_environment,
|
|
157
189
|
log_retention=logs.RetentionDays.ONE_WEEK,
|
|
158
190
|
)
|
|
159
191
|
|
|
@@ -214,4 +246,13 @@ class LambdaEdgeStack(IStack, EnhancedSsmParameterMixin):
|
|
|
214
246
|
"function_version": self.function_version.version,
|
|
215
247
|
}
|
|
216
248
|
|
|
217
|
-
|
|
249
|
+
# Export each value to SSM using the enhanced parameter mixin
|
|
250
|
+
for key, param_path in ssm_exports.items():
|
|
251
|
+
if key in export_values:
|
|
252
|
+
self.export_ssm_parameter(
|
|
253
|
+
self,
|
|
254
|
+
f"{key}-param",
|
|
255
|
+
export_values[key],
|
|
256
|
+
param_path,
|
|
257
|
+
description=f"{key} for Lambda@Edge function {function_name}"
|
|
258
|
+
)
|
|
@@ -169,6 +169,13 @@ class StaticWebSiteStack(IStack):
|
|
|
169
169
|
aliases=aliases,
|
|
170
170
|
distribution=cloudfront_distribution.distribution,
|
|
171
171
|
)
|
|
172
|
+
|
|
173
|
+
# Export SSM parameters if configured
|
|
174
|
+
self.__export_ssm_parameters(
|
|
175
|
+
stack_config=stack_config,
|
|
176
|
+
bucket=bucket,
|
|
177
|
+
cloudfront_distribution=cloudfront_distribution,
|
|
178
|
+
)
|
|
172
179
|
|
|
173
180
|
def __setup_route53_records(
|
|
174
181
|
self,
|
|
@@ -200,6 +207,58 @@ class StaticWebSiteStack(IStack):
|
|
|
200
207
|
zone_name=hosted_zone_name,
|
|
201
208
|
)
|
|
202
209
|
|
|
210
|
+
def __export_ssm_parameters(
|
|
211
|
+
self,
|
|
212
|
+
stack_config: StackConfig,
|
|
213
|
+
bucket: s3.IBucket,
|
|
214
|
+
cloudfront_distribution: CloudFrontDistributionConstruct,
|
|
215
|
+
) -> None:
|
|
216
|
+
"""
|
|
217
|
+
Export stack outputs to SSM Parameter Store if ssm_exports is configured.
|
|
218
|
+
|
|
219
|
+
Args:
|
|
220
|
+
stack_config: Stack configuration containing ssm_exports
|
|
221
|
+
bucket: The S3 bucket
|
|
222
|
+
cloudfront_distribution: The CloudFront distribution construct
|
|
223
|
+
"""
|
|
224
|
+
ssm_exports = stack_config.dictionary.get("ssm_exports", {})
|
|
225
|
+
|
|
226
|
+
if not ssm_exports:
|
|
227
|
+
logger.debug("No SSM exports configured for this stack")
|
|
228
|
+
return
|
|
229
|
+
|
|
230
|
+
# Export bucket name if configured
|
|
231
|
+
if "bucket_name" in ssm_exports:
|
|
232
|
+
self.export_ssm_parameter(
|
|
233
|
+
scope=self,
|
|
234
|
+
id="SsmExportBucketName",
|
|
235
|
+
value=bucket.bucket_name,
|
|
236
|
+
parameter_name=ssm_exports["bucket_name"],
|
|
237
|
+
description=f"S3 bucket name for {stack_config.name}",
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
# Export CloudFront domain if configured
|
|
241
|
+
if "cloudfront_domain" in ssm_exports and cloudfront_distribution.distribution:
|
|
242
|
+
self.export_ssm_parameter(
|
|
243
|
+
scope=self,
|
|
244
|
+
id="SsmExportCloudFrontDomain",
|
|
245
|
+
value=cloudfront_distribution.dns_name,
|
|
246
|
+
parameter_name=ssm_exports["cloudfront_domain"],
|
|
247
|
+
description=f"CloudFront domain name for {stack_config.name}",
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
# Export CloudFront distribution ID if configured
|
|
251
|
+
if "cloudfront_distribution_id" in ssm_exports and cloudfront_distribution.distribution:
|
|
252
|
+
self.export_ssm_parameter(
|
|
253
|
+
scope=self,
|
|
254
|
+
id="SsmExportCloudFrontDistributionId",
|
|
255
|
+
value=cloudfront_distribution.distribution_id,
|
|
256
|
+
parameter_name=ssm_exports["cloudfront_distribution_id"],
|
|
257
|
+
description=f"CloudFront distribution ID for {stack_config.name}",
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
logger.info(f"Exported {len(ssm_exports)} SSM parameters for stack {stack_config.name}")
|
|
261
|
+
|
|
203
262
|
def __get_version_number(self, assets_path: str) -> str:
|
|
204
263
|
version = "0.0.1.ckd.factory"
|
|
205
264
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.12.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.10.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
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/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
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/enhanced_base_config.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/enhanced_ssm_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/_resources.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/api_gateway.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/auto_scaling.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/cloudfront.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/code_artifact.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/cognito.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/docker.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/dynamodb.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/ecs_service.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/exisiting.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/lambda_layers.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/load_balancer.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/monitoring.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/resource_types.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/configurations/resources/route53.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/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
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/lambdas/policies/policy_docs.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/constructs/sqs/policies/sqs_policies.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/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
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/auto_scaling/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/aws_lambdas/lambda_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/buckets/bucket_stack.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/cloudfront/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/cognito/cognito_stack.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/dynamodb/dynamodb_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/ecs/ecs_service_stack.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/lambda_edge/__init__.py
RENAMED
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/load_balancer/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/monitoring/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/stack_library/route53/route53_stack.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/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
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cdk_factory-0.10.0 → cdk_factory-0.12.0}/src/cdk_factory/utilities/lambda_function_utilities.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|