(aws-ecs): (Add deregistration delay parameter to FargateService construct) #31529
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
Currently, when deploying a service using ECS Fargate without a load balancer, there is a fixed deregistration delay of 5 minutes for replaced tasks (old tasks enter a draining state and remain there for 5 minutes), which is non-configurable unless a load balancer with target groups is used. I am proposing the addition of a
deregistrationDelay
parameter to the FargateService construct in AWS CDK, allowing developers to customize this delay when a load balancer is not used.Use Case
When deploying a service to ECS Fargate that does not require a load balancer, the deployment process is unnecessarily slowed down by the default 5-minute deregistration delay. For example, when tasks are replaced during a deployment, the old tasks enter a draining state and remain there for 5 minutes, even though the service doesn't need this full delay. This results in a longer deployment time than necessary, impacting deployment pipelines and delaying new service availability. Allowing users to specify a custom deregistration delay would optimize this process.
Proposed Solution
Introduce a
deregistrationDelay
option to the FargateService construct to specify the amount of time, in seconds, to wait before changing the state of a deregistering target fromdraining
tounused
. The range is 0-3600 seconds. The default value is 300 seconds.Other Information
deregistration_delay.timeout_seconds
used in aws_elasticloadbalancingv2Acknowledgements
CDK version used
v2.150.0
Environment details (OS name and version, etc.)
Mac OS Sequoia
The text was updated successfully, but these errors were encountered: