(ecs): Deployment Circuit Breaker cannot be turned off via CDK #27131
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
p2
Describe the bug
I believe this is similar #25840, but for the
DeploymentCircuitBreaker
.We are unable to turn off the DeploymentCircuitBreaker from an ECS service via CDK.
Expected Behavior
Deploying an ECS service with an unset
.circuitBreaker
will turn off the ECS Deployment Circuit Breaker if it was previously turned on.Current Behavior
When setting the
.circuitBreaker
property on an ECS service in CDK, we see the following added to the resulting ECS::Service CFN:When attempting to remove the circuit breaker by not setting the
.circuitBreaker
property on the CDK service, theDeploymentCircuitBreaker
is no longer set in the resulting CFN. When this new stack (with a removedDeploymentCircuitBreaker
), ECS does not turn off the circuit breaker. I believe that this is due to ECS not treating missing values as "different" when processing the CFN.Manually editing the CFN to explicitly set the
"Enable": false
in the CFN does cause ECS to turn off the circuit breaker, e.g.:Unfortunately, this ability to explicitly disable the circuit breaker is not provided by the L2 CDK construct, and instead it is implied that not settting
.circuitBreaker
on the service will achieve this.Reproduction Steps
See "Current Behavior"
Possible Solution
I believe the right way to fix this is explicitly disable the DeploymentCircuitBreaker in the CFN when the
.circuitBreaker
property is unset.Additional Information/Context
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.FargateService.html#circuitbreaker
CDK CLI Version
2.93.0
Framework Version
No response
Node.js Version
14.21.3
OS
Linux
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: