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

@@ -13,7 +13,7 @@ from aws_cdk import aws_cloudwatch as cloudwatch
13
13
  from aws_cdk import aws_iam as iam
14
14
  from aws_cdk import aws_ssm as ssm
15
15
  from aws_cdk import aws_ecs as ecs
16
- from aws_cdk import Duration, Stack
16
+ from aws_cdk import Duration, Stack, CfnUpdatePolicy
17
17
  from aws_lambda_powertools import Logger
18
18
  from constructs import Construct
19
19
 
@@ -539,12 +539,15 @@ class AutoScalingStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
539
539
 
540
540
  if not instance_refresh_config.get("enabled", False):
541
541
  return
542
+
543
+ logger.warning("Instance refresh is not supported in this version of the CDK")
544
+ return
542
545
 
543
546
  # Get the CloudFormation ASG resource
544
547
  cfn_asg = asg.node.default_child
545
548
 
546
549
  # Configure instance refresh using CloudFormation UpdatePolicy
547
- # Instance refresh is configured as an update policy, not a property
550
+ # UpdatePolicy is added at the resource level, not as a property
548
551
  update_policy = {
549
552
  "AutoScalingRollingUpdate": {
550
553
  "PauseTime": "PT300S", # 5 minutes pause
@@ -561,13 +564,37 @@ class AutoScalingStack(IStack, VPCProviderMixin, StandardizedSsmMixin):
561
564
  }
562
565
  }
563
566
 
564
- # Apply instance refresh using CloudFormation UpdatePolicy
565
- cfn_asg.add_property_override("UpdatePolicy", update_policy)
566
- logger.info(f"Configured instance refresh via UpdatePolicy: {update_policy}")
567
+ # # Apply instance refresh using CloudFormation's cfn_options.update_policy
568
+ # cfn_asg.cfn_options.update_policy = cdk.CfnUpdatePolicy.from_rolling_update(
569
+ # pause_time=cdk.Duration.seconds(300),
570
+ # min_instances_in_service=1,
571
+ # max_batch_size=1,
572
+ # wait_on_resource_signals=True
573
+ # )
574
+
575
+ # Grab the L1 to attach UpdatePolicy.InstanceRefresh
576
+ cfn_asg: autoscaling.CfnAutoScalingGroup = asg.node.default_child
577
+
578
+ # cfn_asg.cfn_options.update_policy = CfnUpdatePolicy.from_auto_scaling_instance_refresh(
579
+ # # Triggers tell CFN *what* changes should start a refresh
580
+ # triggers=[CfnUpdatePolicy.InstanceRefreshTrigger.LAUNCH_TEMPLATE],
581
+ # preferences=CfnUpdatePolicy.InstanceRefreshPreferences(
582
+ # # warmup is like “grace” before counting a new instance healthy
583
+ # instance_warmup=Duration.minutes(5),
584
+ # # how aggressive the refresh is; 90 keeps capacity high
585
+ # min_healthy_percentage=90,
586
+ # # skip instances that already match the new LT (fast when only userdata/env tweaked)
587
+ # skip_matching=True,
588
+ # # optional: put instances in Standby first; default is rolling terminate/launch
589
+ # # standby_instances=CfnUpdatePolicy.StandbyInstances.TERMINATE,
590
+ # # checkpoint_percentages=[25, 50, 75], # optional: progressive checkpoints
591
+ # # checkpoint_delay=Duration.minutes(2), # optional delay at checkpoints
592
+ # ),
593
+ # )
594
+ logger.info(f"Configured instance refresh via CDK CfnUpdatePolicy")
567
595
 
568
- # Note: For true instance refresh with preferences, we would need to use
569
- # CDK's native instance refresh support when available, or custom CloudFormation
570
- # This rolling update policy provides similar functionality
596
+ # Note: This provides rolling update functionality similar to instance refresh
597
+ # For true instance refresh with preferences, we would need CDK v2.80+ or custom CloudFormation
571
598
 
572
599
 
573
600
  # Backward compatibility alias
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.18.26"
1
+ __version__ = "0.18.27"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.18.26
3
+ Version: 0.18.27
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=x6HBvMHJHUDmBrRU89pbUhXS9tnqNUKtubnJD65wkzA,24
5
+ cdk_factory/version.py,sha256=YNQJ-VryNrWDERxChWC0-gxAAjJiCQsSbtwrsv85MJc,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=bFJIWQQKga8KzRKOJt0CsdELqJwGbIUhgab8yX4QLxo,5892
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=-v35HvMcoYL6poFBSLeONKMBuioYzdZ7MqkTm3sLwgc,23796
89
+ cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py,sha256=G8OOgTAfsTDVArvuDfzuNpuGHzqz8kREHnnkMtjulAQ,25334
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.26.dist-info/METADATA,sha256=CpcLnX94u-x9Ac6HwBVbdbzx1FGnE91Nbc2Moe9vnhY,2452
140
- cdk_factory-0.18.26.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
141
- cdk_factory-0.18.26.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
142
- cdk_factory-0.18.26.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
143
- cdk_factory-0.18.26.dist-info/RECORD,,
139
+ cdk_factory-0.18.27.dist-info/METADATA,sha256=ZkbDRYkuHJv01dDjamoMI9neVd3lDn-W2kAAwbptnhI,2452
140
+ cdk_factory-0.18.27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
141
+ cdk_factory-0.18.27.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
142
+ cdk_factory-0.18.27.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
143
+ cdk_factory-0.18.27.dist-info/RECORD,,