cdk-factory 0.18.19__py3-none-any.whl → 0.18.21__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.
- cdk_factory/configurations/resources/auto_scaling.py +5 -0
- cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py +54 -5
- cdk_factory/stack_library/ecs/ecs_service_stack.py +8 -0
- cdk_factory/version.py +1 -1
- {cdk_factory-0.18.19.dist-info → cdk_factory-0.18.21.dist-info}/METADATA +1 -1
- {cdk_factory-0.18.19.dist-info → cdk_factory-0.18.21.dist-info}/RECORD +9 -9
- {cdk_factory-0.18.19.dist-info → cdk_factory-0.18.21.dist-info}/WHEEL +0 -0
- {cdk_factory-0.18.19.dist-info → cdk_factory-0.18.21.dist-info}/entry_points.txt +0 -0
- {cdk_factory-0.18.19.dist-info → cdk_factory-0.18.21.dist-info}/licenses/LICENSE +0 -0
|
@@ -74,6 +74,11 @@ class AutoScalingConfig(EnhancedBaseConfig):
|
|
|
74
74
|
"""Update policy configuration"""
|
|
75
75
|
return self.__config.get("update_policy")
|
|
76
76
|
|
|
77
|
+
@property
|
|
78
|
+
def instance_refresh(self) -> Optional[Dict[str, Any]]:
|
|
79
|
+
"""Instance refresh configuration for rolling updates"""
|
|
80
|
+
return self.__config.get("instance_refresh")
|
|
81
|
+
|
|
77
82
|
@property
|
|
78
83
|
def user_data_commands(self) -> List[str]:
|
|
79
84
|
"""User data commands to run on instance launch"""
|
|
@@ -241,11 +241,12 @@ class AutoScalingStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
|
|
|
241
241
|
user_data = ec2.UserData.for_linux()
|
|
242
242
|
|
|
243
243
|
# Add basic setup commands
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
# this will break amazon linux 2023 which uses dnf instead of yum
|
|
245
|
+
# user_data.add_commands(
|
|
246
|
+
# "#!/bin/bash",
|
|
247
|
+
# "yum update -y",
|
|
248
|
+
# "yum install -y aws-cfn-bootstrap",
|
|
249
|
+
# )
|
|
249
250
|
|
|
250
251
|
# Add user data commands from configuration
|
|
251
252
|
if self.asg_config.user_data_commands:
|
|
@@ -423,6 +424,10 @@ class AutoScalingStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
|
|
|
423
424
|
],
|
|
424
425
|
)
|
|
425
426
|
|
|
427
|
+
# Add instance refresh if configured
|
|
428
|
+
if self.asg_config.instance_refresh:
|
|
429
|
+
self._configure_instance_refresh(auto_scaling_group)
|
|
430
|
+
|
|
426
431
|
# Attach target groups if configured
|
|
427
432
|
self._attach_target_groups(auto_scaling_group)
|
|
428
433
|
|
|
@@ -528,6 +533,50 @@ class AutoScalingStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
|
|
|
528
533
|
|
|
529
534
|
logger.info(f"Exported SSM parameters: {exported_params}")
|
|
530
535
|
|
|
536
|
+
def _configure_instance_refresh(self, asg: autoscaling.AutoScalingGroup) -> None:
|
|
537
|
+
"""Configure instance refresh for rolling updates"""
|
|
538
|
+
instance_refresh_config = self.asg_config.instance_refresh
|
|
539
|
+
|
|
540
|
+
if not instance_refresh_config.get("enabled", False):
|
|
541
|
+
return
|
|
542
|
+
|
|
543
|
+
# Get the CloudFormation ASG resource
|
|
544
|
+
cfn_asg = asg.node.default_child
|
|
545
|
+
|
|
546
|
+
# Configure instance refresh properties
|
|
547
|
+
refresh_props = {}
|
|
548
|
+
|
|
549
|
+
if "min_healthy_percentage" in instance_refresh_config:
|
|
550
|
+
refresh_props["min_healthy_percentage"] = instance_refresh_config["min_healthy_percentage"]
|
|
551
|
+
|
|
552
|
+
if "instance_warmup" in instance_refresh_config:
|
|
553
|
+
refresh_props["instance_warmup"] = instance_refresh_config["instance_warmup"]
|
|
554
|
+
|
|
555
|
+
if "preferences" in instance_refresh_config:
|
|
556
|
+
preferences = instance_refresh_config["preferences"]
|
|
557
|
+
|
|
558
|
+
# Build preferences property
|
|
559
|
+
pref_props = {}
|
|
560
|
+
|
|
561
|
+
if "skip_matching" in preferences:
|
|
562
|
+
pref_props["skip_matching"] = preferences["skip_matching"]
|
|
563
|
+
|
|
564
|
+
if "auto_rollback" in preferences:
|
|
565
|
+
pref_props["auto_rollback"] = preferences["auto_rollback"]
|
|
566
|
+
|
|
567
|
+
if "instance_warmup" in preferences:
|
|
568
|
+
pref_props["instance_warmup"] = preferences["instance_warmup"]
|
|
569
|
+
|
|
570
|
+
if "min_healthy_percentage" in preferences:
|
|
571
|
+
pref_props["min_healthy_percentage"] = preferences["min_healthy_percentage"]
|
|
572
|
+
|
|
573
|
+
if pref_props:
|
|
574
|
+
refresh_props["preferences"] = pref_props
|
|
575
|
+
|
|
576
|
+
if refresh_props:
|
|
577
|
+
cfn_asg.add_property_override("InstanceRefresh", refresh_props)
|
|
578
|
+
logger.info(f"Configured instance refresh: {refresh_props}")
|
|
579
|
+
|
|
531
580
|
|
|
532
581
|
# Backward compatibility alias
|
|
533
582
|
AutoScalingStackStandardized = AutoScalingStack
|
|
@@ -540,6 +540,14 @@ class EcsServiceStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
|
|
|
540
540
|
"""Attach service to load balancer target groups"""
|
|
541
541
|
target_group_arns = self.ecs_config.target_group_arns
|
|
542
542
|
|
|
543
|
+
if target_group_arns:
|
|
544
|
+
tmp = []
|
|
545
|
+
for tg_arn in target_group_arns:
|
|
546
|
+
import hashlib
|
|
547
|
+
unique_id = hashlib.md5(tg_arn.encode()).hexdigest()
|
|
548
|
+
tmp.append(self.resolve_ssm_value(self, tg_arn, unique_id))
|
|
549
|
+
target_group_arns = tmp
|
|
550
|
+
|
|
543
551
|
if not target_group_arns:
|
|
544
552
|
# Try to load from SSM if configured
|
|
545
553
|
target_group_arns = self._load_target_groups_from_ssm()
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.18.
|
|
1
|
+
__version__ = "0.18.21"
|
|
@@ -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=B2Sy7twJt6907f9y1FOcoO6wzQSV9i7I4wVmuy06Voc,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=eJ3Pl3GWk1jVr_bYQaaWlw4_-ZiFGaiXllI_fOOX1i0,9323
|
|
@@ -21,7 +21,7 @@ cdk_factory/configurations/resources/_resources.py,sha256=tnXGn4kEC0JPQaTWB3QpAZ
|
|
|
21
21
|
cdk_factory/configurations/resources/acm.py,sha256=HsHwiH15p0zTqRGDErn35kBEa3rkaRWTDJzVequR9oY,3062
|
|
22
22
|
cdk_factory/configurations/resources/api_gateway.py,sha256=-k4hMGszIdQLb5DGmWBIPy49YGutp8zczafRh-Vob0I,4904
|
|
23
23
|
cdk_factory/configurations/resources/apigateway_route_config.py,sha256=6ytn_nwKwlfpBtHL5sV6gxMpgAJ3p6QFGumMoW4CTHM,2351
|
|
24
|
-
cdk_factory/configurations/resources/auto_scaling.py,sha256=
|
|
24
|
+
cdk_factory/configurations/resources/auto_scaling.py,sha256=mG-b1Zc7BdbdZdJp8K9EB62JY4jyjRnId_kzq1opqCM,6193
|
|
25
25
|
cdk_factory/configurations/resources/cloudfront.py,sha256=YU4my1sQjLnf4DNBECS4GvPAxUG2FX_BszfO76mSbYw,3959
|
|
26
26
|
cdk_factory/configurations/resources/cloudwatch_widget.py,sha256=EdEQSXUkDtoY_Mg_cJBWo1Hp84jSiK7U9tsd3k1VhKI,1271
|
|
27
27
|
cdk_factory/configurations/resources/code_artifact.py,sha256=P2X2i6NEcePitEf2wkN6lFTjIbXasn0uzrlPOT0tEac,3253
|
|
@@ -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=PvLdGvcopGpLP0FwpfUcfXNiTIfYLTXqrG-TniE38yc,39643
|
|
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=KfuNTKpDCQmvbw4F71sZBTkDFiBn1jkxxIojl21ExvQ,24140
|
|
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
|
|
@@ -99,7 +99,7 @@ cdk_factory/stack_library/ecr/README.md,sha256=xw2wPx9WN03Y4BBwqvbi9lAFGNyaD1FUN
|
|
|
99
99
|
cdk_factory/stack_library/ecr/ecr_stack.py,sha256=KLbd5WN5-ZiojsS5wJ4PX-tIL0cCylCSvXjO6sVrgWY,2102
|
|
100
100
|
cdk_factory/stack_library/ecs/__init__.py,sha256=o5vGDtD_h-gVXb3-Ysr8xUNpEcMsnmMVgZv2Pupcdow,219
|
|
101
101
|
cdk_factory/stack_library/ecs/ecs_cluster_stack.py,sha256=sAPTLU5CAwMoLTW_pNy_cd0OtVkfDR7IxxsSq5AE0yo,12091
|
|
102
|
-
cdk_factory/stack_library/ecs/ecs_service_stack.py,sha256=
|
|
102
|
+
cdk_factory/stack_library/ecs/ecs_service_stack.py,sha256=EylXlAHTk0hx9IAl3VfW2hauE-J2jUnAFjsNMe73-ZM,27725
|
|
103
103
|
cdk_factory/stack_library/lambda_edge/__init__.py,sha256=ByBJ_CWdc4UtTmFBZH-6pzBMNkjkdtE65AmnB0Fs6lM,156
|
|
104
104
|
cdk_factory/stack_library/lambda_edge/lambda_edge_stack.py,sha256=C_h2Xb2_zaCGiw5otbeSozOLNbxaciMLo8FX_TQOAlw,16409
|
|
105
105
|
cdk_factory/stack_library/load_balancer/__init__.py,sha256=wZpKw2OecLJGdF5mPayCYAEhu2H3c2gJFFIxwXftGDU,52
|
|
@@ -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.18.
|
|
140
|
-
cdk_factory-0.18.
|
|
141
|
-
cdk_factory-0.18.
|
|
142
|
-
cdk_factory-0.18.
|
|
143
|
-
cdk_factory-0.18.
|
|
139
|
+
cdk_factory-0.18.21.dist-info/METADATA,sha256=cf8ZcJ_UApVTnZw3r8uwjqkYzfgTUxEkURAwg1KNX7g,2452
|
|
140
|
+
cdk_factory-0.18.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
141
|
+
cdk_factory-0.18.21.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
|
|
142
|
+
cdk_factory-0.18.21.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
143
|
+
cdk_factory-0.18.21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|