cdk-factory 0.15.10__py3-none-any.whl → 0.18.9__py3-none-any.whl
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/configurations/base_config.py +23 -24
- cdk_factory/configurations/cdk_config.py +6 -4
- cdk_factory/configurations/deployment.py +12 -0
- cdk_factory/configurations/devops.py +1 -1
- cdk_factory/configurations/pipeline_stage.py +29 -5
- cdk_factory/configurations/resources/acm.py +85 -0
- cdk_factory/configurations/resources/auto_scaling.py +7 -5
- cdk_factory/configurations/resources/cloudfront.py +7 -2
- cdk_factory/configurations/resources/ecr.py +1 -1
- cdk_factory/configurations/resources/ecs_cluster.py +108 -0
- cdk_factory/configurations/resources/ecs_service.py +17 -2
- cdk_factory/configurations/resources/load_balancer.py +17 -4
- cdk_factory/configurations/resources/monitoring.py +8 -3
- cdk_factory/configurations/resources/rds.py +305 -19
- cdk_factory/configurations/resources/rum.py +7 -2
- cdk_factory/configurations/resources/s3.py +1 -1
- cdk_factory/configurations/resources/security_group_full_stack.py +7 -8
- cdk_factory/configurations/resources/vpc.py +19 -0
- cdk_factory/configurations/workload.py +32 -2
- cdk_factory/constructs/ecr/ecr_construct.py +9 -2
- cdk_factory/constructs/lambdas/policies/policy_docs.py +4 -4
- cdk_factory/interfaces/istack.py +6 -3
- cdk_factory/interfaces/networked_stack_mixin.py +75 -0
- cdk_factory/interfaces/standardized_ssm_mixin.py +657 -0
- cdk_factory/interfaces/vpc_provider_mixin.py +210 -0
- cdk_factory/lambdas/edge/ip_gate/handler.py +42 -40
- cdk_factory/pipeline/pipeline_factory.py +222 -27
- cdk_factory/stack/stack_factory.py +34 -0
- cdk_factory/stack_library/__init__.py +3 -2
- cdk_factory/stack_library/acm/__init__.py +6 -0
- cdk_factory/stack_library/acm/acm_stack.py +169 -0
- cdk_factory/stack_library/api_gateway/api_gateway_stack.py +84 -59
- cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py +366 -408
- cdk_factory/stack_library/code_artifact/code_artifact_stack.py +2 -2
- cdk_factory/stack_library/cognito/cognito_stack.py +152 -92
- cdk_factory/stack_library/dynamodb/dynamodb_stack.py +19 -15
- cdk_factory/stack_library/ecr/ecr_stack.py +2 -2
- cdk_factory/stack_library/ecs/__init__.py +12 -0
- cdk_factory/stack_library/ecs/ecs_cluster_stack.py +316 -0
- cdk_factory/stack_library/ecs/ecs_service_stack.py +20 -39
- cdk_factory/stack_library/lambda_edge/lambda_edge_stack.py +2 -2
- cdk_factory/stack_library/load_balancer/load_balancer_stack.py +151 -118
- cdk_factory/stack_library/rds/rds_stack.py +85 -74
- cdk_factory/stack_library/route53/route53_stack.py +8 -3
- cdk_factory/stack_library/rum/rum_stack.py +108 -91
- cdk_factory/stack_library/security_group/security_group_full_stack.py +9 -22
- cdk_factory/stack_library/security_group/security_group_stack.py +11 -11
- cdk_factory/stack_library/stack_base.py +5 -0
- cdk_factory/stack_library/vpc/vpc_stack.py +272 -124
- cdk_factory/stack_library/websites/static_website_stack.py +1 -1
- cdk_factory/utilities/api_gateway_integration_utility.py +24 -16
- cdk_factory/utilities/environment_services.py +5 -5
- cdk_factory/utilities/json_loading_utility.py +12 -3
- cdk_factory/validation/config_validator.py +483 -0
- cdk_factory/version.py +1 -1
- cdk_factory/workload/workload_factory.py +1 -0
- {cdk_factory-0.15.10.dist-info → cdk_factory-0.18.9.dist-info}/METADATA +1 -1
- {cdk_factory-0.15.10.dist-info → cdk_factory-0.18.9.dist-info}/RECORD +61 -54
- cdk_factory/interfaces/enhanced_ssm_parameter_mixin.py +0 -321
- cdk_factory/interfaces/ssm_parameter_mixin.py +0 -329
- {cdk_factory-0.15.10.dist-info → cdk_factory-0.18.9.dist-info}/WHEEL +0 -0
- {cdk_factory-0.15.10.dist-info → cdk_factory-0.18.9.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.15.10.dist-info → cdk_factory-0.18.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Networked Stack Mixin - Combined SSM and VPC functionality for network-aware stacks
|
|
3
|
+
Maintainers: Eric Wilson
|
|
4
|
+
MIT License. See Project Root for license information.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from typing import Any
|
|
8
|
+
from aws_cdk import aws_ec2 as ec2
|
|
9
|
+
from .standardized_ssm_mixin import StandardizedSsmMixin
|
|
10
|
+
from .vpc_provider_mixin import VPCProviderMixin
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class NetworkedStackMixin(StandardizedSsmMixin, VPCProviderMixin):
|
|
14
|
+
"""
|
|
15
|
+
Combined mixin for stacks that need both SSM imports and VPC resolution.
|
|
16
|
+
|
|
17
|
+
This mixin provides a complete solution for network-aware stacks by combining:
|
|
18
|
+
- Enhanced SSM parameter import functionality (with standardized configuration)
|
|
19
|
+
- VPC resolution with multiple fallback strategies
|
|
20
|
+
- Standardized initialization patterns
|
|
21
|
+
|
|
22
|
+
Usage:
|
|
23
|
+
class MyStack(Stack, NetworkedStackMixin):
|
|
24
|
+
def __init__(self, scope, id, **kwargs):
|
|
25
|
+
super().__init__(scope, id, **kwargs)
|
|
26
|
+
# SSM initialization is handled automatically by StandardizedSsmMixin.__init__
|
|
27
|
+
|
|
28
|
+
def _build(self, stack_config, deployment, workload):
|
|
29
|
+
self.setup_ssm_integration(scope=self, config=stack_config.dictionary, resource_type="my-resource", resource_name="my-name")
|
|
30
|
+
self.vpc = self.resolve_vpc(stack_config, deployment, workload)
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
def _initialize_networked_stack(self) -> None:
|
|
34
|
+
"""
|
|
35
|
+
Initialize all networked stack functionality.
|
|
36
|
+
Note: SSM initialization is handled by StandardizedSsmMixin.__init__
|
|
37
|
+
"""
|
|
38
|
+
self._initialize_vpc_cache()
|
|
39
|
+
|
|
40
|
+
def build_networked_stack(
|
|
41
|
+
self,
|
|
42
|
+
config: Any,
|
|
43
|
+
deployment: Any,
|
|
44
|
+
workload: Any,
|
|
45
|
+
resource_type: str = "resource"
|
|
46
|
+
) -> None:
|
|
47
|
+
"""
|
|
48
|
+
Standard build sequence for networked stacks.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
config: The stack configuration
|
|
52
|
+
deployment: The deployment configuration
|
|
53
|
+
workload: The workload configuration
|
|
54
|
+
resource_type: Type name for logging purposes
|
|
55
|
+
"""
|
|
56
|
+
# Process SSM imports first (using enhanced SsmParameterMixin)
|
|
57
|
+
self.process_ssm_imports(config, deployment, resource_type)
|
|
58
|
+
|
|
59
|
+
# Store references for later use
|
|
60
|
+
self.config = config
|
|
61
|
+
self.deployment = deployment
|
|
62
|
+
self.workload = workload
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def vpc(self) -> ec2.IVpc:
|
|
66
|
+
"""
|
|
67
|
+
Standard VPC property that uses the combined mixin functionality.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
Resolved VPC reference
|
|
71
|
+
"""
|
|
72
|
+
if not hasattr(self, 'config') or not hasattr(self, 'deployment') or not hasattr(self, 'workload'):
|
|
73
|
+
raise AttributeError("Networked stack not properly initialized. Call build_networked_stack() first.")
|
|
74
|
+
|
|
75
|
+
return self.get_vpc_property(self.config, self.deployment, self.workload)
|