Skip to content

CDK overwrites ECS service desired count back to 1 on every deploy #3919

@nathanpeck

Description

@nathanpeck

🐛 Bug Report

What is the problem?

The default behavior of an ECS service update is to maintain the existing desired count if no desired count is specified. This is because customers often use autoscaling, or time based scaling and their scaling rules have already set the service to a specific desired count that is appropriate. Because CDK and CFN can not know this number at the time of the deploy the correct behavior is to omit it and retain the existing desired count.

However when you leave desired count out of the ECS construct in CDK it instead sets it to 1. This overrides whatever the current autoscaling set desired count is, causing a brief period of instability before the desired count is automatically restored to the right number by autoscaling.

Metadata

Metadata

Labels

@aws-cdk/aws-ecsRelated to Amazon Elastic ContainerbugThis issue is a bug.effort/smallSmall work item – less than a day of effortneeds-cfnThis issue is waiting on changes to CloudFormation before it can be addressed.p2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions