cdk-factory 0.18.19__py3-none-any.whl → 0.18.20__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.

@@ -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
- user_data.add_commands(
245
- "#!/bin/bash",
246
- "yum update -y",
247
- "yum install -y aws-cfn-bootstrap",
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
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.18.19"
1
+ __version__ = "0.18.20"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.18.19
3
+ Version: 0.18.20
4
4
  Summary: CDK Factory. A QuickStarter and best practices setup for CDK projects
5
5
  Author-email: Eric Wilson <eric.wilson@geekcafe.com>
6
6
  License: MIT License
@@ -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=uiLHk2KTGw3AhvUxFYieCKErlp7FSK2qsHhYB3akgoI,24
5
+ cdk_factory/version.py,sha256=w3jIFt0pGHQrF-Aew_QB3wXbn41ljYgrPStTZxnKK6M,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=jga8qmNY_Ctk5CWY43Bz_gMEFvN6rwKLkyAl9d5d-ko,6000
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=6QDVkv6Zz-qCbT6h2MU9Sp1diFXDEyjJNk1-xWMbMJg,21990
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
@@ -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.19.dist-info/METADATA,sha256=EG4aSnWY4A6-_gB8s4Q2EKPtRqhz3p-NjPbUMqcbJ8M,2452
140
- cdk_factory-0.18.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
141
- cdk_factory-0.18.19.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
142
- cdk_factory-0.18.19.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
143
- cdk_factory-0.18.19.dist-info/RECORD,,
139
+ cdk_factory-0.18.20.dist-info/METADATA,sha256=o1iNkUxex6jmTmzlO_U9hN_-XZT1JbTxLZkLVcOtfqA,2452
140
+ cdk_factory-0.18.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
141
+ cdk_factory-0.18.20.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
142
+ cdk_factory-0.18.20.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
143
+ cdk_factory-0.18.20.dist-info/RECORD,,