Skip to content

Commit 47bc9ee

Browse files
authored
feat(elbv2) expose connection_termination attribute on network target group (#20821)
This adds `deregistration_delay.connection_termination.enabled` attribute to the `NetworkTargetGroupProps` as `connectionTermination`. This is [specific to Network Load balancers](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-targetgroup-targetgroupattribute.html). I have added integration tests and unit tests. closes #17010 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 400ad91 commit 47bc9ee

File tree

10 files changed

+1582
-1
lines changed

10 files changed

+1582
-1
lines changed

packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ export interface NetworkTargetGroupProps extends BaseTargetGroupProps {
5151
* @default - No targets.
5252
*/
5353
readonly targets?: INetworkLoadBalancerTarget[];
54+
55+
/**
56+
*
57+
* Indicates whether the load balancer terminates connections at
58+
* the end of the deregistration timeout.
59+
*
60+
* @default false
61+
*/
62+
readonly connectionTermination?: boolean;
5463
}
5564

5665
/**
@@ -93,7 +102,9 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge
93102
if (props.preserveClientIp !== undefined) {
94103
this.setAttribute('preserve_client_ip.enabled', props.preserveClientIp ? 'true' : 'false');
95104
}
96-
105+
if (props.connectionTermination !== undefined) {
106+
this.setAttribute('deregistration_delay.connection_termination.enabled', props.connectionTermination ? 'true' : 'false');
107+
}
97108
this.addTarget(...(props.targets || []));
98109
}
99110

packages/@aws-cdk/aws-elasticloadbalancingv2/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"devDependencies": {
8383
"@aws-cdk/assertions": "0.0.0",
8484
"@aws-cdk/cdk-build-tools": "0.0.0",
85+
"@aws-cdk/integ-tests": "0.0.0",
8586
"@aws-cdk/integ-runner": "0.0.0",
8687
"@aws-cdk/cfn2ts": "0.0.0",
8788
"@aws-cdk/pkglint": "0.0.0",

0 commit comments

Comments
 (0)