aws / aws/aws-cdk

(aws-elasticloadbalancingv2): Support for deregistration_delay.connection_termination.enabled property on target group

Open
#24,328 2 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-elasticloadbalancingv2 effort/medium feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

The NLB target group has a boolean property `deregistration_delay.connection_termination.enabled` [1]. This is NLB specific flag and not available in ALB [2].

But the current cdk implementation of NetworkTargetGroupProps inherits the deregistrationDelay from BaseTargetGroupProps [3] and BaseTargetGroupProps defines the deregistrationDelay as a Duration type [4].

So, it is not possible to set this flag through CDK.

[1] https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html
[2] https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html
[3] https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts
[4] https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts#L39

### Use Case

Aws NLB has this feature to terminate connections to targets where deregistration delay is reached and Aws console recommends to set this flag. Though this flag in available in console, it is not available in CDK.

### Proposed Solution

Move the deregistrationDelay from BaseTargetGroupProps down to NetworkTargetGroupProps and ApplicationTargetGroupProps. In NetworkTargetGroupProps have this a composite typed attribute which has duration for timeout_seconds and also a boolean flag to set connection termination.

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.59

### Environment details (OS name and version, etc.)

macos, amazon linux2

Contributor guide

Open the contributing guide

Research direction

Start with packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts and packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-target-group.ts, then compare the linked AWS NLB and ALB target-group documentation. Trace how deregistrationDelay is exposed and identify the corresponding tests before deciding the API shape. Done means the NLB connection-termination flag and timeout can be configured through CDK without exposing the NLB-only flag on ALB.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.