cdk-factory 0.17.0__py3-none-any.whl → 0.17.2__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/interfaces/vpc_provider_mixin.py +13 -3
- cdk_factory/stack_library/auto_scaling/auto_scaling_stack_standardized.py +2 -2
- cdk_factory/stack_library/rum/rum_stack.py +17 -11
- cdk_factory/stack_library/vpc/vpc_stack_standardized.py +5 -28
- cdk_factory/version.py +1 -1
- {cdk_factory-0.17.0.dist-info → cdk_factory-0.17.2.dist-info}/METADATA +1 -1
- {cdk_factory-0.17.0.dist-info → cdk_factory-0.17.2.dist-info}/RECORD +10 -10
- {cdk_factory-0.17.0.dist-info → cdk_factory-0.17.2.dist-info}/WHEEL +0 -0
- {cdk_factory-0.17.0.dist-info → cdk_factory-0.17.2.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.17.0.dist-info → cdk_factory-0.17.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,7 @@ MIT License. See Project Root for license information.
|
|
|
6
6
|
|
|
7
7
|
from typing import Optional, List, Any
|
|
8
8
|
from aws_lambda_powertools import Logger
|
|
9
|
-
from aws_cdk import aws_ec2 as ec2
|
|
9
|
+
from aws_cdk import aws_ec2 as ec2, aws_ssm as ssm
|
|
10
10
|
from constructs import Construct
|
|
11
11
|
|
|
12
12
|
logger = Logger(__name__)
|
|
@@ -113,16 +113,26 @@ class VPCProviderMixin:
|
|
|
113
113
|
Create VPC reference from SSM imported VPC ID.
|
|
114
114
|
|
|
115
115
|
Args:
|
|
116
|
-
vpc_id: The VPC ID from SSM
|
|
116
|
+
vpc_id: The VPC ID from SSM (can be SSM path or actual VPC ID)
|
|
117
117
|
availability_zones: List of availability zones
|
|
118
118
|
subnet_ids: Optional list of subnet IDs from SSM
|
|
119
119
|
|
|
120
120
|
Returns:
|
|
121
121
|
VPC reference created from attributes
|
|
122
122
|
"""
|
|
123
|
+
# Check if vpc_id is an SSM path (starts with /) or actual VPC ID
|
|
124
|
+
if vpc_id.startswith('/'):
|
|
125
|
+
# Create CDK token for VPC ID from SSM parameter
|
|
126
|
+
vpc_id_token = ssm.StringParameter.from_string_parameter_name(
|
|
127
|
+
self, f"{self.stack_name}-VPC-ID-Token", vpc_id
|
|
128
|
+
).string_value
|
|
129
|
+
else:
|
|
130
|
+
# Use the VPC ID directly (for testing or direct configuration)
|
|
131
|
+
vpc_id_token = vpc_id
|
|
132
|
+
|
|
123
133
|
# Build VPC attributes
|
|
124
134
|
vpc_attrs = {
|
|
125
|
-
"vpc_id":
|
|
135
|
+
"vpc_id": vpc_id_token,
|
|
126
136
|
"availability_zones": availability_zones,
|
|
127
137
|
}
|
|
128
138
|
|
|
@@ -137,8 +137,8 @@ class AutoScalingStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
|
|
|
137
137
|
logger.info(f"Auto Scaling Group {asg_name} built successfully")
|
|
138
138
|
|
|
139
139
|
def _get_ssm_imports(self) -> Dict[str, Any]:
|
|
140
|
-
"""Get SSM imports from
|
|
141
|
-
return self.
|
|
140
|
+
"""Get SSM imports from standardized mixin processing"""
|
|
141
|
+
return self.get_all_ssm_imports()
|
|
142
142
|
|
|
143
143
|
def _get_security_groups(self) -> List[ec2.ISecurityGroup]:
|
|
144
144
|
"""
|
|
@@ -59,14 +59,18 @@ class RumStack(IStack, StandardizedSsmMixin):
|
|
|
59
59
|
|
|
60
60
|
# Configure SSM imports for cognito resources if needed
|
|
61
61
|
if not self.rum_config.cognito_identity_pool_id:
|
|
62
|
-
#
|
|
63
|
-
if
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
# Only add SSM imports if we have the required template variables
|
|
63
|
+
# Check if deployment has organization info for template resolution
|
|
64
|
+
if (hasattr(deployment, 'organization') and deployment.organization and
|
|
65
|
+
hasattr(deployment, 'environment') and deployment.environment):
|
|
66
|
+
# Add explicit import path for cognito identity pool using new pattern
|
|
67
|
+
if "ssm" not in rum_config:
|
|
68
|
+
rum_config["ssm"] = {}
|
|
69
|
+
if "imports" not in rum_config["ssm"]:
|
|
70
|
+
rum_config["ssm"]["imports"] = {}
|
|
71
|
+
rum_config["ssm"]["imports"][
|
|
72
|
+
"cognito_identity_pool_id"
|
|
73
|
+
] = "/{{ORGANIZATION}}/{{ENVIRONMENT}}/cognito/user-pool/identity-pool-id"
|
|
70
74
|
|
|
71
75
|
self.setup_standardized_ssm_integration(
|
|
72
76
|
scope=self,
|
|
@@ -75,6 +79,9 @@ class RumStack(IStack, StandardizedSsmMixin):
|
|
|
75
79
|
resource_name=self.rum_config.name,
|
|
76
80
|
)
|
|
77
81
|
|
|
82
|
+
# Process SSM imports using standardized method
|
|
83
|
+
self.process_standardized_ssm_imports()
|
|
84
|
+
|
|
78
85
|
# Import or create Cognito resources
|
|
79
86
|
identity_pool_id, guest_role_arn = self._setup_cognito_integration()
|
|
80
87
|
|
|
@@ -97,9 +104,8 @@ class RumStack(IStack, StandardizedSsmMixin):
|
|
|
97
104
|
identity_pool_id = self.rum_config.cognito_identity_pool_id
|
|
98
105
|
logger.info(f"Using existing Cognito Identity Pool: {identity_pool_id}")
|
|
99
106
|
else:
|
|
100
|
-
# Try to import from SSM using
|
|
101
|
-
|
|
102
|
-
cognito_identity_pool_id = ssm_imports.get("cognito_identity_pool_id")
|
|
107
|
+
# Try to import from SSM using standardized approach
|
|
108
|
+
cognito_identity_pool_id = self.get_ssm_imported_value("cognito_identity_pool_id")
|
|
103
109
|
|
|
104
110
|
if cognito_identity_pool_id:
|
|
105
111
|
identity_pool_id = cognito_identity_pool_id
|
|
@@ -111,25 +111,7 @@ class VpcStack(IStack, StandardizedSsmMixin):
|
|
|
111
111
|
# Configure NAT gateways
|
|
112
112
|
nat_gateway_count = self.vpc_config.nat_gateways.get("count", 1)
|
|
113
113
|
|
|
114
|
-
# Get explicit availability zones to avoid dummy AZs in pipeline synthesis
|
|
115
|
-
# When CDK synthesizes in a pipeline context, it doesn't have access to real AZs
|
|
116
|
-
# So we explicitly specify them based on the deployment region
|
|
117
|
-
availability_zones = None
|
|
118
|
-
if self.deployment:
|
|
119
|
-
region = self.deployment.region or "us-east-1"
|
|
120
|
-
# Explicitly list AZs for the region to avoid dummy values
|
|
121
|
-
max_azs = self.vpc_config.max_azs or 2
|
|
122
|
-
if region == "us-east-1":
|
|
123
|
-
availability_zones = [f"us-east-1{chr(97+i)}" for i in range(max_azs)] # us-east-1a, us-east-1b, etc.
|
|
124
|
-
elif region == "us-east-2":
|
|
125
|
-
availability_zones = [f"us-east-2{chr(97+i)}" for i in range(max_azs)]
|
|
126
|
-
elif region == "us-west-1":
|
|
127
|
-
availability_zones = [f"us-west-1{chr(97+i)}" for i in range(max_azs)]
|
|
128
|
-
elif region == "us-west-2":
|
|
129
|
-
availability_zones = [f"us-west-2{chr(97+i)}" for i in range(max_azs)]
|
|
130
|
-
|
|
131
114
|
# Build VPC properties
|
|
132
|
-
# Note: CDK doesn't allow both 'availability_zones' and 'max_azs' - use one or the other
|
|
133
115
|
vpc_props = {
|
|
134
116
|
"vpc_name": vpc_name,
|
|
135
117
|
"cidr": self.vpc_config.cidr,
|
|
@@ -137,6 +119,7 @@ class VpcStack(IStack, StandardizedSsmMixin):
|
|
|
137
119
|
"subnet_configuration": subnet_configuration,
|
|
138
120
|
"enable_dns_hostnames": self.vpc_config.enable_dns_hostnames,
|
|
139
121
|
"enable_dns_support": self.vpc_config.enable_dns_support,
|
|
122
|
+
"max_azs": self.vpc_config.max_azs, # Use max_azs instead of explicit availability_zones
|
|
140
123
|
"gateway_endpoints": (
|
|
141
124
|
{
|
|
142
125
|
"S3": ec2.GatewayVpcEndpointOptions(
|
|
@@ -148,12 +131,6 @@ class VpcStack(IStack, StandardizedSsmMixin):
|
|
|
148
131
|
),
|
|
149
132
|
}
|
|
150
133
|
|
|
151
|
-
# Use either availability_zones or max_azs, not both
|
|
152
|
-
if availability_zones:
|
|
153
|
-
vpc_props["availability_zones"] = availability_zones
|
|
154
|
-
else:
|
|
155
|
-
vpc_props["max_azs"] = self.vpc_config.max_azs
|
|
156
|
-
|
|
157
134
|
# Create the VPC
|
|
158
135
|
vpc = ec2.Vpc(self, vpc_name, **vpc_props)
|
|
159
136
|
|
|
@@ -350,9 +327,9 @@ class VpcStack(IStack, StandardizedSsmMixin):
|
|
|
350
327
|
# Prepare resource values for export
|
|
351
328
|
resource_values = {
|
|
352
329
|
"vpc_id": self.vpc.vpc_id,
|
|
353
|
-
"public_subnet_ids": [subnet.subnet_id for subnet in self.vpc.public_subnets],
|
|
354
|
-
"private_subnet_ids": [subnet.subnet_id for subnet in self.vpc.private_subnets],
|
|
355
|
-
"isolated_subnet_ids": [subnet.subnet_id for subnet in self.vpc.isolated_subnets],
|
|
330
|
+
"public_subnet_ids": ",".join([subnet.subnet_id for subnet in self.vpc.public_subnets]) if self.vpc.public_subnets else "",
|
|
331
|
+
"private_subnet_ids": ",".join([subnet.subnet_id for subnet in self.vpc.private_subnets]) if self.vpc.private_subnets else "",
|
|
332
|
+
"isolated_subnet_ids": ",".join([subnet.subnet_id for subnet in self.vpc.isolated_subnets]) if self.vpc.isolated_subnets else "",
|
|
356
333
|
}
|
|
357
334
|
|
|
358
335
|
# Add route table IDs if available - commented out due to CDK API issues
|
|
@@ -386,7 +363,7 @@ class VpcStack(IStack, StandardizedSsmMixin):
|
|
|
386
363
|
if hasattr(child, 'nat_gateway_id') and child.nat_gateway_id:
|
|
387
364
|
nat_gateway_ids.append(child.nat_gateway_id)
|
|
388
365
|
if nat_gateway_ids:
|
|
389
|
-
resource_values["nat_gateway_ids"] = nat_gateway_ids
|
|
366
|
+
resource_values["nat_gateway_ids"] = ",".join(nat_gateway_ids)
|
|
390
367
|
|
|
391
368
|
# Add Internet Gateway ID if available
|
|
392
369
|
if hasattr(self.vpc, 'internet_gateway_id') and self.vpc.internet_gateway_id:
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.17.
|
|
1
|
+
__version__ = "0.17.2"
|
|
@@ -2,7 +2,7 @@ cdk_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
cdk_factory/app.py,sha256=RnX0-pwdTAPAdKJK_j13Zl8anf9zYKBwboR0KA8K8xM,10346
|
|
3
3
|
cdk_factory/cdk.json,sha256=SKZKhJ2PBpFH78j-F8S3VDYW-lf76--Q2I3ON-ZIQfw,3106
|
|
4
4
|
cdk_factory/cli.py,sha256=FGbCTS5dYCNsfp-etshzvFlGDCjC28r6rtzYbe7KoHI,6407
|
|
5
|
-
cdk_factory/version.py,sha256=
|
|
5
|
+
cdk_factory/version.py,sha256=I5u6uLh7NsbyGkKLvVteW175Afe6HJt5UsjBZ28EGks,23
|
|
6
6
|
cdk_factory/builds/README.md,sha256=9BBWd7bXpyKdMU_g2UljhQwrC9i5O_Tvkb6oPvndoZk,90
|
|
7
7
|
cdk_factory/commands/command_loader.py,sha256=QbLquuP_AdxtlxlDy-2IWCQ6D-7qa58aphnDPtp_uTs,3744
|
|
8
8
|
cdk_factory/configurations/base_config.py,sha256=eJ3Pl3GWk1jVr_bYQaaWlw4_-ZiFGaiXllI_fOOX1i0,9323
|
|
@@ -67,7 +67,7 @@ cdk_factory/interfaces/istack.py,sha256=3xqGw5kNTt_KeLHdMxI7rIR0YORqcWQOqsacmDlT
|
|
|
67
67
|
cdk_factory/interfaces/live_ssm_resolver.py,sha256=3FIr9a02SXqZmbFs3RT0WxczWEQR_CF7QSt7kWbDrVE,8163
|
|
68
68
|
cdk_factory/interfaces/networked_stack_mixin.py,sha256=69pJp4IE1n_tdHh2UZQ08O6ZW-v5P4uJJ_fleNaj6Nw,2897
|
|
69
69
|
cdk_factory/interfaces/standardized_ssm_mixin.py,sha256=-BT-K7mro2f3taS7biAm_oaxC7z2lurUfNUpryvahXk,22680
|
|
70
|
-
cdk_factory/interfaces/vpc_provider_mixin.py,sha256=
|
|
70
|
+
cdk_factory/interfaces/vpc_provider_mixin.py,sha256=tfe3XqWd4lf5mMHGKexDcWmS0T2CKHSP0TDDyp6MPoY,8363
|
|
71
71
|
cdk_factory/lambdas/health_handler.py,sha256=dd40ykKMxWCFEIyp2ZdQvAGNjw_ylI9CSm1N24Hp2ME,196
|
|
72
72
|
cdk_factory/lambdas/edge/ip_gate/handler.py,sha256=gUevgX462mqGYddtQIyJ1-Jk3oXhFmbmd46jlqjai9E,10657
|
|
73
73
|
cdk_factory/pipeline/path_utils.py,sha256=fvWdrcb4onmpIu1APkHLhXg8zWfK74HcW3Ra2ynxfXM,2586
|
|
@@ -86,7 +86,7 @@ cdk_factory/stack_library/acm/__init__.py,sha256=4FNRLykblcKZvq_wieYwvv9N_jgrZnJ
|
|
|
86
86
|
cdk_factory/stack_library/acm/acm_stack.py,sha256=QJ3GkT17PmWoGkfO5Um02hvrfyJ9HbiPMnclwDP7IbA,5846
|
|
87
87
|
cdk_factory/stack_library/api_gateway/api_gateway_stack.py,sha256=_wbPBsgh7FHq9cnL44CiuffBj3XCO5ErQx_yclxFsVY,39669
|
|
88
88
|
cdk_factory/stack_library/auto_scaling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
|
-
cdk_factory/stack_library/auto_scaling/auto_scaling_stack_standardized.py,sha256=
|
|
89
|
+
cdk_factory/stack_library/auto_scaling/auto_scaling_stack_standardized.py,sha256=wpR8m4JuM5BaKNOAQ4SPUbmsnpd1QQWSqffpNVMgZ8w,21991
|
|
90
90
|
cdk_factory/stack_library/aws_lambdas/lambda_stack.py,sha256=SFbBPvvCopbyiuYtq-O5sQkFCf94Wzua6aDUXiFDSB4,26161
|
|
91
91
|
cdk_factory/stack_library/buckets/README.md,sha256=XkK3UNVtRLE7NtUvbhCOBBYUYi8hlrrSaI1s3GJVrqI,78
|
|
92
92
|
cdk_factory/stack_library/buckets/bucket_stack.py,sha256=SLoZqSffAqmeBBEVUQg54D_8Ad5UKdkjEAmKAVgAqQo,1778
|
|
@@ -111,13 +111,13 @@ cdk_factory/stack_library/rds/rds_stack.py,sha256=YwRLvqfIEDE5uwocnr7HpmniIfEF5O
|
|
|
111
111
|
cdk_factory/stack_library/route53/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
112
112
|
cdk_factory/stack_library/route53/route53_stack.py,sha256=mPUJta6maUNlkXup7xKsqq7gefsRI1w_ulInE29wJs4,8387
|
|
113
113
|
cdk_factory/stack_library/rum/__init__.py,sha256=gUrWQdzd4rZ2J0YzAQC8PsEGAS7QgyYjB2ZCUKWasy4,90
|
|
114
|
-
cdk_factory/stack_library/rum/rum_stack.py,sha256=
|
|
114
|
+
cdk_factory/stack_library/rum/rum_stack.py,sha256=BEXsx_PsZOu2dR3Pmv1_flY51uRIeHP5l5rj96bOgPQ,14106
|
|
115
115
|
cdk_factory/stack_library/security_group/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
116
116
|
cdk_factory/stack_library/security_group/security_group_full_stack.py,sha256=yvZ5QS9eDj_LkkwHY_Pcb37lOVPbGMfSdizZa1X6BEI,13561
|
|
117
117
|
cdk_factory/stack_library/security_group/security_group_stack.py,sha256=Zv9FCEHvSBT1cM9bXOtyIUFwhRHKCSTgvaqOyhGj0wg,14456
|
|
118
118
|
cdk_factory/stack_library/simple_queue_service/sqs_stack.py,sha256=jJksWrvrvgZUMM01RZ317DOIxqIJbkYYSYu38w0jHpc,6039
|
|
119
119
|
cdk_factory/stack_library/vpc/__init__.py,sha256=7pIqP97Gf2AJbv9Ebp1WbQGHYhgEbWJ52L1MzeXBybA,42
|
|
120
|
-
cdk_factory/stack_library/vpc/vpc_stack_standardized.py,sha256=
|
|
120
|
+
cdk_factory/stack_library/vpc/vpc_stack_standardized.py,sha256=yUmmAugFl0jhQYHZy93ZKjBqtwgnqXEY7oHLfNQzxvo,16443
|
|
121
121
|
cdk_factory/stack_library/websites/static_website_stack.py,sha256=A292BlKDof0JnVewkK_3JiRB04rX7J9Na0a-iz3JWzw,11243
|
|
122
122
|
cdk_factory/stages/websites/static_website_stage.py,sha256=X4fpKXkhb0zIbSHx3QyddBhVSLBryb1vf1Cg2fMTqog,755
|
|
123
123
|
cdk_factory/templates/README.md,sha256=ATBEjG6beYvbEAdLtZ_8xnxgFD5X0cgZoI_6pToqH90,2679
|
|
@@ -136,8 +136,8 @@ cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITE
|
|
|
136
136
|
cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
|
|
137
137
|
cdk_factory/validation/config_validator.py,sha256=Pb0TkLiPFzUplBOgMorhRCVm08vEzZhRU5xXCDTa5CA,17602
|
|
138
138
|
cdk_factory/workload/workload_factory.py,sha256=yDI3cRhVI5ELNDcJPLpk9UY54Uind1xQoV3spzT4z7E,6068
|
|
139
|
-
cdk_factory-0.17.
|
|
140
|
-
cdk_factory-0.17.
|
|
141
|
-
cdk_factory-0.17.
|
|
142
|
-
cdk_factory-0.17.
|
|
143
|
-
cdk_factory-0.17.
|
|
139
|
+
cdk_factory-0.17.2.dist-info/METADATA,sha256=xmiyleHsFEcn_VXTYKBNrDH8sgLyuAXRGxR2-RyvtRU,2451
|
|
140
|
+
cdk_factory-0.17.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
141
|
+
cdk_factory-0.17.2.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
|
|
142
|
+
cdk_factory-0.17.2.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
143
|
+
cdk_factory-0.17.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|