cdk-factory 0.16.10__py3-none-any.whl → 0.16.11__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/stack_library/auto_scaling/auto_scaling_stack.py +49 -4
- cdk_factory/version.py +1 -1
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.11.dist-info}/METADATA +1 -1
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.11.dist-info}/RECORD +7 -7
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.11.dist-info}/WHEEL +0 -0
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.11.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.16.10.dist-info → cdk_factory-0.16.11.dist-info}/licenses/LICENSE +0 -0
|
@@ -248,10 +248,12 @@ class AutoScalingStack(IStack, VPCProviderMixin):
|
|
|
248
248
|
# Add base commands
|
|
249
249
|
user_data.add_commands("set -euxo pipefail")
|
|
250
250
|
|
|
251
|
-
# Add custom commands from config
|
|
251
|
+
# Add custom commands from config (with variable substitution)
|
|
252
252
|
for command in self.asg_config.user_data_commands:
|
|
253
|
-
|
|
254
|
-
self.
|
|
253
|
+
# Perform variable substitution on the command
|
|
254
|
+
substituted_command = self._substitute_variables(command)
|
|
255
|
+
user_data.add_commands(substituted_command)
|
|
256
|
+
self.user_data_commands.append(substituted_command)
|
|
255
257
|
|
|
256
258
|
# Add user data scripts from files (with variable substitution)
|
|
257
259
|
if self.asg_config.user_data_scripts:
|
|
@@ -324,6 +326,49 @@ class AutoScalingStack(IStack, VPCProviderMixin):
|
|
|
324
326
|
|
|
325
327
|
logger.info(f"Added user data script from {script_type}: {script_config.get('path', 'inline')}")
|
|
326
328
|
|
|
329
|
+
def _substitute_variables(self, command: str) -> str:
|
|
330
|
+
"""
|
|
331
|
+
Perform variable substitution on a user data command.
|
|
332
|
+
Uses workload and deployment configuration for substitution.
|
|
333
|
+
"""
|
|
334
|
+
if not command:
|
|
335
|
+
return command
|
|
336
|
+
|
|
337
|
+
# Start with the original command
|
|
338
|
+
substituted_command = command
|
|
339
|
+
|
|
340
|
+
# Define available variables for substitution
|
|
341
|
+
variables = {}
|
|
342
|
+
|
|
343
|
+
# Add workload variables
|
|
344
|
+
if self.workload:
|
|
345
|
+
variables.update({
|
|
346
|
+
"WORKLOAD_NAME": getattr(self.workload, 'name', ''),
|
|
347
|
+
"ENVIRONMENT": getattr(self.workload, 'environment', ''),
|
|
348
|
+
"WORKLOAD": getattr(self.workload, 'name', ''),
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
# Add deployment variables
|
|
352
|
+
if self.deployment:
|
|
353
|
+
variables.update({
|
|
354
|
+
"DEPLOYMENT_NAME": getattr(self.deployment, 'name', ''),
|
|
355
|
+
"REGION": getattr(self.deployment, 'region', ''),
|
|
356
|
+
"ACCOUNT": getattr(self.deployment, 'account', ''),
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
# Add stack-level variables
|
|
360
|
+
variables.update({
|
|
361
|
+
"STACK_NAME": self.stack_name,
|
|
362
|
+
})
|
|
363
|
+
|
|
364
|
+
# Perform substitution
|
|
365
|
+
for var_name, var_value in variables.items():
|
|
366
|
+
if var_value is not None:
|
|
367
|
+
placeholder = f"{{{{{var_name}}}}}" # {{VAR_NAME}}
|
|
368
|
+
substituted_command = substituted_command.replace(placeholder, str(var_value))
|
|
369
|
+
|
|
370
|
+
return substituted_command
|
|
371
|
+
|
|
327
372
|
def _add_container_user_data(
|
|
328
373
|
self, user_data: ec2.UserData, container_config: Dict[str, Any]
|
|
329
374
|
) -> None:
|
|
@@ -602,7 +647,7 @@ class AutoScalingStack(IStack, VPCProviderMixin):
|
|
|
602
647
|
return
|
|
603
648
|
|
|
604
649
|
# Generate cluster name from stack configuration
|
|
605
|
-
cluster_name = f"{self.
|
|
650
|
+
cluster_name = f"{self.workload.name}-{self.workload.environment}-cluster"
|
|
606
651
|
|
|
607
652
|
logger.info(f"Creating ECS cluster: {cluster_name}")
|
|
608
653
|
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.16.
|
|
1
|
+
__version__ = "0.16.11"
|
|
@@ -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=EakrCPGyBoMWg8RWPZfDpree9gtV1Dzj_7yPvePXTLA,24
|
|
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
|
|
@@ -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=hflRXyOSjqGeJxBx87EV3Z3MJ5HEX2rnrjJ_E9wwhH8,5862
|
|
87
87
|
cdk_factory/stack_library/api_gateway/api_gateway_stack.py,sha256=l6J5uurBQqbhj9JuvQitV9PiIHS5kqa-dFWifCeA3GM,39347
|
|
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.py,sha256=
|
|
89
|
+
cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py,sha256=5GeQDp0PNULaSI2FPEWLscbSZRK_QjRwk1cyaeD8STI,30787
|
|
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
|
|
@@ -134,8 +134,8 @@ cdk_factory/utilities/lambda_function_utilities.py,sha256=S1GvBsY_q2cyUiaud3HORJ
|
|
|
134
134
|
cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
|
|
135
135
|
cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
|
|
136
136
|
cdk_factory/workload/workload_factory.py,sha256=yDI3cRhVI5ELNDcJPLpk9UY54Uind1xQoV3spzT4z7E,6068
|
|
137
|
-
cdk_factory-0.16.
|
|
138
|
-
cdk_factory-0.16.
|
|
139
|
-
cdk_factory-0.16.
|
|
140
|
-
cdk_factory-0.16.
|
|
141
|
-
cdk_factory-0.16.
|
|
137
|
+
cdk_factory-0.16.11.dist-info/METADATA,sha256=Z14DgOnRweXe38PJbLFn1ZdMUOl13d3nbqRSGyMyQU8,2452
|
|
138
|
+
cdk_factory-0.16.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
139
|
+
cdk_factory-0.16.11.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
|
|
140
|
+
cdk_factory-0.16.11.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
141
|
+
cdk_factory-0.16.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|