Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-ecs): (Add deregistration delay parameter to FargateService construct) #31529

Open
2 tasks
lorenzozamponi opened this issue Sep 23, 2024 · 0 comments
Open
2 tasks
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@lorenzozamponi
Copy link

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 from draining to unused. The range is 0-3600 seconds. The default value is 300 seconds.

Other Information

deregistration_delay.timeout_seconds used in aws_elasticloadbalancingv2

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

v2.150.0

Environment details (OS name and version, etc.)

Mac OS Sequoia

@lorenzozamponi lorenzozamponi added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 23, 2024
@github-actions github-actions bot added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant