From 51a62ddf7511e4782067d7171fdbc71b3e5091fa Mon Sep 17 00:00:00 2001 From: Zachary Schneider Date: Thu, 3 Dec 2026 16:46:27 -0500 Subject: [PATCH] fix(ecs): model the circuit breaker threshold and reset fields AWS added ResetOnHealthyTask and ThresholdConfiguration (Type of COUNT, BOUNDED_PERCENT or UNBOUNDED_PERCENT, and an integer Value) to AWS::ECS::Service DeploymentConfiguration.DeploymentCircuitBreaker and returns them on read. The schema did not know the fields, so rendering a service back to Pkl failed with deploymentConfiguration["deploymentCircuitBreaker"]: Unsupported desired declaration fields: Set("ResetOnHealthyTask", "ThresholdConfiguration") Both fields are now modelled as provider defaults and recorded in the dispositions manifest. AWS defaults them to true and BOUNDED_PERCENT 50. --- schema/pkl/ecs/service.pkl | 12 ++++++++++++ schema/provider-default-dispositions.json | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/schema/pkl/ecs/service.pkl b/schema/pkl/ecs/service.pkl index 22348523..12617e44 100644 --- a/schema/pkl/ecs/service.pkl +++ b/schema/pkl/ecs/service.pkl @@ -43,10 +43,22 @@ open class Alarms extends formae.SubResource { rollback: Boolean } +typealias ThresholdConfigurationType = "COUNT"|"BOUNDED_PERCENT"|"UNBOUNDED_PERCENT" + +@aws.SubResourceHint +open class ThresholdConfiguration extends formae.SubResource { + type: ThresholdConfigurationType + value: Int +} + @aws.SubResourceHint open class DeploymentCircuitBreaker extends formae.SubResource { enable: Boolean rollback: Boolean + @aws.FieldHint{hasProviderDefault = true} + resetOnHealthyTask: Boolean? + @aws.FieldHint{hasProviderDefault = true} + thresholdConfiguration: ThresholdConfiguration? } @aws.SubResourceHint diff --git a/schema/provider-default-dispositions.json b/schema/provider-default-dispositions.json index 4912d054..21e50dae 100644 --- a/schema/provider-default-dispositions.json +++ b/schema/provider-default-dispositions.json @@ -735,6 +735,16 @@ "disposition": "keep", "pin": "documentation" }, + { + "key": "ecs/service.pkl#DeploymentCircuitBreaker.resetOnHealthyTask", + "disposition": "keep", + "pin": "documentation" + }, + { + "key": "ecs/service.pkl#DeploymentCircuitBreaker.thresholdConfiguration", + "disposition": "keep", + "pin": "documentation" + }, { "key": "ecs/service.pkl#DeploymentConfiguration.bakeTimeInMinutes", "disposition": "keep",