cdk-factory 0.15.6__py3-none-any.whl → 0.15.7__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/lambdas/edge/ip_gate/handler.py +14 -4
- cdk_factory/version.py +1 -1
- {cdk_factory-0.15.6.dist-info → cdk_factory-0.15.7.dist-info}/METADATA +1 -1
- {cdk_factory-0.15.6.dist-info → cdk_factory-0.15.7.dist-info}/RECORD +7 -7
- {cdk_factory-0.15.6.dist-info → cdk_factory-0.15.7.dist-info}/WHEEL +0 -0
- {cdk_factory-0.15.6.dist-info → cdk_factory-0.15.7.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.15.6.dist-info → cdk_factory-0.15.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -15,7 +15,7 @@ from functools import lru_cache
|
|
|
15
15
|
ssm = None
|
|
16
16
|
|
|
17
17
|
@lru_cache(maxsize=128)
|
|
18
|
-
def get_ssm_parameter(parameter_name: str, region: str = 'us-east-1') -> str:
|
|
18
|
+
def get_ssm_parameter(parameter_name: str, region: str = 'us-east-1', default: str = None) -> str:
|
|
19
19
|
"""
|
|
20
20
|
Fetch SSM parameter with caching.
|
|
21
21
|
Lambda@Edge cannot use environment variables, so we fetch from SSM.
|
|
@@ -25,9 +25,10 @@ def get_ssm_parameter(parameter_name: str, region: str = 'us-east-1') -> str:
|
|
|
25
25
|
Args:
|
|
26
26
|
parameter_name: Name of the SSM parameter
|
|
27
27
|
region: AWS region (default us-east-1)
|
|
28
|
+
default: Default value to return if parameter not found (optional)
|
|
28
29
|
|
|
29
30
|
Returns:
|
|
30
|
-
Parameter value, or empty string if value is 'NONE'
|
|
31
|
+
Parameter value, default value if parameter not found, or empty string if value is 'NONE'
|
|
31
32
|
"""
|
|
32
33
|
global ssm
|
|
33
34
|
if ssm is None:
|
|
@@ -43,8 +44,17 @@ def get_ssm_parameter(parameter_name: str, region: str = 'us-east-1') -> str:
|
|
|
43
44
|
return ''
|
|
44
45
|
|
|
45
46
|
return value
|
|
47
|
+
except ssm.exceptions.ParameterNotFound:
|
|
48
|
+
if default is not None:
|
|
49
|
+
print(f"SSM parameter {parameter_name} not found, using default: {default}")
|
|
50
|
+
return default
|
|
51
|
+
print(f"SSM parameter {parameter_name} not found and no default provided")
|
|
52
|
+
raise
|
|
46
53
|
except Exception as e:
|
|
47
54
|
print(f"Error fetching SSM parameter {parameter_name}: {str(e)}")
|
|
55
|
+
if default is not None:
|
|
56
|
+
print(f"Returning default value due to error: {default}")
|
|
57
|
+
return default
|
|
48
58
|
raise
|
|
49
59
|
|
|
50
60
|
|
|
@@ -180,8 +190,8 @@ def lambda_handler(event, context):
|
|
|
180
190
|
|
|
181
191
|
# IP not allowed - either redirect or proxy maintenance page
|
|
182
192
|
# Check response mode from SSM (default: redirect for backward compatibility)
|
|
183
|
-
response_mode_param = f"/{function_name}/response-mode"
|
|
184
|
-
response_mode = get_ssm_parameter(response_mode_param, default='redirect')
|
|
193
|
+
response_mode_param = f"/{env}/{function_name}/response-mode"
|
|
194
|
+
response_mode = get_ssm_parameter(response_mode_param, 'us-east-1', default='redirect')
|
|
185
195
|
|
|
186
196
|
if response_mode == 'proxy':
|
|
187
197
|
# Proxy mode: Fetch and return maintenance content (keeps URL the same)
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.15.
|
|
1
|
+
__version__ = "0.15.7"
|
|
@@ -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=MAPfkctPEvU6tygJmfGoOx7ZrEBKkfDrKqpCja4D-yM,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=JKjhNsy0RCUZy1s8n5D_aXXI-upR9izaLtCTfKYiV9k,9624
|
|
@@ -66,7 +66,7 @@ cdk_factory/interfaces/istack.py,sha256=bhTBs-o9FgKwvJMSuwxjUV6D3nUlvZHVzfm27jP9
|
|
|
66
66
|
cdk_factory/interfaces/live_ssm_resolver.py,sha256=3FIr9a02SXqZmbFs3RT0WxczWEQR_CF7QSt7kWbDrVE,8163
|
|
67
67
|
cdk_factory/interfaces/ssm_parameter_mixin.py,sha256=uA2j8HmAOpuEA9ynRj51s0WjUHMVLsbLQN-QS9NKyHA,12089
|
|
68
68
|
cdk_factory/lambdas/health_handler.py,sha256=dd40ykKMxWCFEIyp2ZdQvAGNjw_ylI9CSm1N24Hp2ME,196
|
|
69
|
-
cdk_factory/lambdas/edge/ip_gate/handler.py,sha256=
|
|
69
|
+
cdk_factory/lambdas/edge/ip_gate/handler.py,sha256=5uSpCB8Kii1CDqgb_Gv8EvVeSzA5XtynaNL3t7tXf_M,10507
|
|
70
70
|
cdk_factory/pipeline/path_utils.py,sha256=fvWdrcb4onmpIu1APkHLhXg8zWfK74HcW3Ra2ynxfXM,2586
|
|
71
71
|
cdk_factory/pipeline/pipeline_factory.py,sha256=rvtkdlTPJG477nTVRN8S2ksWt4bwpd9eVLFd9WO02pM,17248
|
|
72
72
|
cdk_factory/pipeline/stage.py,sha256=Be7ExMB9A-linRM18IQDOzQ-cP_I2_ThRNzlT4FIrUg,437
|
|
@@ -129,8 +129,8 @@ cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJ
|
|
|
129
129
|
cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
|
|
130
130
|
cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
|
|
131
131
|
cdk_factory/workload/workload_factory.py,sha256=mM8GU_5mKq_0OyK060T3JrUSUiGAcKf0eqNlT9mfaws,6028
|
|
132
|
-
cdk_factory-0.15.
|
|
133
|
-
cdk_factory-0.15.
|
|
134
|
-
cdk_factory-0.15.
|
|
135
|
-
cdk_factory-0.15.
|
|
136
|
-
cdk_factory-0.15.
|
|
132
|
+
cdk_factory-0.15.7.dist-info/METADATA,sha256=QrtFEH2ROwve6PqWxq6av8hH-oCohgCU0is2F-R2C70,2451
|
|
133
|
+
cdk_factory-0.15.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
134
|
+
cdk_factory-0.15.7.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
|
|
135
|
+
cdk_factory-0.15.7.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
136
|
+
cdk_factory-0.15.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|