diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts index 0f254e46486d5..07b651cac8382 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts @@ -259,14 +259,6 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge } } - if (healthCheck.healthyThresholdCount && healthCheck.unhealthyThresholdCount && - healthCheck.healthyThresholdCount !== healthCheck.unhealthyThresholdCount) { - ret.push([ - `Healthy and Unhealthy Threshold Counts must be the same: ${healthCheck.healthyThresholdCount}`, - `is not equal to ${healthCheck.unhealthyThresholdCount}.`, - ].join(' ')); - } - if (!healthCheck.protocol) { return ret; } diff --git a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts index cd44982380734..2bff7359e74bf 100644 --- a/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts +++ b/packages/aws-cdk-lib/aws-elasticloadbalancingv2/test/nlb/target-group.test.ts @@ -542,26 +542,6 @@ describe('tests', () => { }).toThrow(/Unhealthy Threshold Count '1' not supported. Must be a number between 2 and 10./); }); - test('Throws error for unequal healthy and unhealthy threshold counts', () => { - const app = new cdk.App(); - const stack = new cdk.Stack(app, 'Stack'); - const vpc = new ec2.Vpc(stack, 'Vpc'); - - new elbv2.NetworkTargetGroup(stack, 'Group', { - vpc, - port: 80, - healthCheck: { - protocol: elbv2.Protocol.TCP, - healthyThresholdCount: 5, - unhealthyThresholdCount: 3, - }, - }); - - expect(() => { - app.synth(); - }).toThrow(/Healthy and Unhealthy Threshold Counts must be the same: 5 is not equal to 3./); - }); - test('Exercise metrics', () => { // GIVEN const stack = new cdk.Stack();