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

@@ -540,42 +540,38 @@ class AutoScalingStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
540
540
  if not instance_refresh_config.get("enabled", False):
541
541
  return
542
542
 
543
- # Get the CloudFormation ASG resource
544
- cfn_asg = asg.node.default_child
545
-
546
- # Configure instance refresh properties
547
- refresh_props = {}
543
+ # Configure instance refresh using CDK construct
544
+ refresh_prefs = autoscaling.InstanceRefreshPreferences()
548
545
 
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
546
  if "preferences" in instance_refresh_config:
556
547
  preferences = instance_refresh_config["preferences"]
557
548
 
558
- # Build preferences property
559
- pref_props = {}
560
-
561
549
  if "skip_matching" in preferences:
562
- pref_props["skip_matching"] = preferences["skip_matching"]
550
+ refresh_prefs.skip_matching = preferences["skip_matching"]
563
551
 
564
552
  if "auto_rollback" in preferences:
565
- pref_props["auto_rollback"] = preferences["auto_rollback"]
553
+ refresh_prefs.auto_rollback = preferences["auto_rollback"]
566
554
 
567
555
  if "instance_warmup" in preferences:
568
- pref_props["instance_warmup"] = preferences["instance_warmup"]
556
+ refresh_prefs.instance_warmup = cdk.Duration.seconds(preferences["instance_warmup"])
569
557
 
570
558
  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
559
+ refresh_prefs.min_healthy_percentage = preferences["min_healthy_percentage"]
560
+
561
+ # Apply instance refresh to the ASG
562
+ if "min_healthy_percentage" in instance_refresh_config:
563
+ refresh_prefs.min_healthy_percentage = instance_refresh_config["min_healthy_percentage"]
564
+
565
+ if "instance_warmup" in instance_refresh_config:
566
+ refresh_prefs.instance_warmup = cdk.Duration.seconds(instance_refresh_config["instance_warmup"])
567
+
568
+ # Set the instance refresh property
569
+ asg.instance_refresh = autoscaling.InstanceRefresh(
570
+ strategy=autoscaling.InstanceRefreshStrategy.ROLLING,
571
+ preferences=refresh_prefs
572
+ )
575
573
 
576
- if refresh_props:
577
- cfn_asg.add_property_override("InstanceRefresh", refresh_props)
578
- logger.info(f"Configured instance refresh: {refresh_props}")
574
+ logger.info(f"Configured instance refresh with strategy: ROLLING")
579
575
 
580
576
 
581
577
  # Backward compatibility alias
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.18.21"
1
+ __version__ = "0.18.22"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.18.21
3
+ Version: 0.18.22
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=B2Sy7twJt6907f9y1FOcoO6wzQSV9i7I4wVmuy06Voc,24
5
+ cdk_factory/version.py,sha256=pHO6ezOHYwgmmUPh-SrlmFc1Ry9SsxoQkiW3pezfNsI,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
@@ -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=KfuNTKpDCQmvbw4F71sZBTkDFiBn1jkxxIojl21ExvQ,24140
89
+ cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py,sha256=9JqDj9KAW6ZsSvOgrXrOtYnlQRtVGy-8odm-8zLnuhE,24112
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.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,,
139
+ cdk_factory-0.18.22.dist-info/METADATA,sha256=V-J7NzatfiQExE16n82Nvt_8ei7-C2C3Q8euLZdVM-k,2452
140
+ cdk_factory-0.18.22.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
141
+ cdk_factory-0.18.22.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
142
+ cdk_factory-0.18.22.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
143
+ cdk_factory-0.18.22.dist-info/RECORD,,