cdk-factory 0.18.25__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.

@@ -25,6 +25,7 @@ logger = Logger(service="AcmStack")
25
25
 
26
26
  @register_stack("acm_stack")
27
27
  @register_stack("certificate_stack")
28
+ @register_stack("certificate_library_module")
28
29
  class AcmStack(IStack, StandardizedSsmMixin):
29
30
  """
30
31
  Reusable stack for AWS Certificate Manager.
@@ -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,43 +539,62 @@ 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
- # Configure instance refresh using CloudFormation property
547
- # The correct structure is at the ASG level, not nested
548
- refresh_config = {
549
- "Strategy": "Rolling",
550
- "Preferences": {}
549
+ # Configure instance refresh using CloudFormation UpdatePolicy
550
+ # UpdatePolicy is added at the resource level, not as a property
551
+ update_policy = {
552
+ "AutoScalingRollingUpdate": {
553
+ "PauseTime": "PT300S", # 5 minutes pause
554
+ "MinInstancesInService": "1",
555
+ "MaxBatchSize": "1",
556
+ "WaitOnResourceSignals": True,
557
+ "SuspendProcesses": [
558
+ "HealthCheck",
559
+ "ReplaceUnhealthy",
560
+ "AZRebalance",
561
+ "AlarmNotification",
562
+ "ScheduledActions"
563
+ ]
564
+ }
551
565
  }
552
566
 
553
- # Add preferences if configured
554
- if "preferences" in instance_refresh_config:
555
- preferences = instance_refresh_config["preferences"]
556
-
557
- if "min_healthy_percentage" in preferences:
558
- refresh_config["Preferences"]["MinHealthyPercentage"] = preferences["min_healthy_percentage"]
559
-
560
- if "instance_warmup" in preferences:
561
- refresh_config["Preferences"]["InstanceWarmup"] = preferences["instance_warmup"]
562
-
563
- if "skip_matching" in preferences:
564
- refresh_config["Preferences"]["SkipMatching"] = preferences["skip_matching"]
565
-
566
- if "auto_rollback" in preferences:
567
- refresh_config["Preferences"]["AutoRollback"] = preferences["auto_rollback"]
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
+ # )
568
574
 
569
- # Add top-level properties if configured
570
- if "min_healthy_percentage" in instance_refresh_config:
571
- refresh_config["MinHealthyPercentage"] = instance_refresh_config["min_healthy_percentage"]
572
-
573
- if "instance_warmup" in instance_refresh_config:
574
- refresh_config["InstanceWarmup"] = instance_refresh_config["instance_warmup"]
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")
575
595
 
576
- # Apply instance refresh using CloudFormation property override
577
- cfn_asg.add_property_override("InstanceRefresh", refresh_config)
578
- logger.info(f"Configured instance refresh: {refresh_config}")
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
579
598
 
580
599
 
581
600
  # Backward compatibility alias
cdk_factory/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.18.25"
1
+ __version__ = "0.18.27"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cdk_factory
3
- Version: 0.18.25
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=PZgdjvO3-LlUWKlOch_neGUTL_kEBywqFp8I5GE_xnk,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
@@ -83,10 +83,10 @@ cdk_factory/stack/stack_modules.py,sha256=kgEK-j0smZPozVwTCfM1g1V17EyTBT0TXAQZq4
83
83
  cdk_factory/stack_library/__init__.py,sha256=_v4kz9EYAjox6strrTK_4fb9GloJ2Kyhf63VRPivl2U,638
84
84
  cdk_factory/stack_library/stack_base.py,sha256=Cu3qeqPQf33QaaXoxk_EaziNCIXcyspOo5AU3eX_wyM,5140
85
85
  cdk_factory/stack_library/acm/__init__.py,sha256=4FNRLykblcKZvq_wieYwvv9N_jgrZnJ7ECH9xKh-0Ls,81
86
- cdk_factory/stack_library/acm/acm_stack.py,sha256=QJ3GkT17PmWoGkfO5Um02hvrfyJ9HbiPMnclwDP7IbA,5846
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=6-cXA9BNcAlzEo_3CR0UImkixpGZ2PpcOTDNpcQDAE8,24309
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.25.dist-info/METADATA,sha256=iaMbsIWt-zcsrfraeJY_U7oOmsTj6dq44MbwD0G8_4E,2452
140
- cdk_factory-0.18.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
141
- cdk_factory-0.18.25.dist-info/entry_points.txt,sha256=S1DPe0ORcdiwEALMN_WIo3UQrW_g4YdQCLEsc_b0Swg,53
142
- cdk_factory-0.18.25.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
143
- cdk_factory-0.18.25.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,,