Skip to content

Commit

Permalink
feat(elbv2) expose connection_termination attribute on network target…
Browse files Browse the repository at this point in the history
… 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*
  • Loading branch information
michaeldrey authored Jul 6, 2022
1 parent 400ad91 commit 47bc9ee
Show file tree
Hide file tree
Showing 10 changed files with 1,582 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ export interface NetworkTargetGroupProps extends BaseTargetGroupProps {
* @default - No targets.
*/
readonly targets?: INetworkLoadBalancerTarget[];

/**
*
* Indicates whether the load balancer terminates connections at
* the end of the deregistration timeout.
*
* @default false
*/
readonly connectionTermination?: boolean;
}

/**
Expand Down Expand Up @@ -93,7 +102,9 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge
if (props.preserveClientIp !== undefined) {
this.setAttribute('preserve_client_ip.enabled', props.preserveClientIp ? 'true' : 'false');
}

if (props.connectionTermination !== undefined) {
this.setAttribute('deregistration_delay.connection_termination.enabled', props.connectionTermination ? 'true' : 'false');
}
this.addTarget(...(props.targets || []));
}

Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-elasticloadbalancingv2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"devDependencies": {
"@aws-cdk/assertions": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-tests": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
Expand Down
Loading

0 comments on commit 47bc9ee

Please sign in to comment.