Skip to content

Commit

Permalink
fix(elasticloadbalancingv2): remove equality check for threshold counts
Browse files Browse the repository at this point in the history
  • Loading branch information
msambol committed Aug 30, 2023
1 parent ed0b5c0 commit 0b80ea9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0b80ea9

Please sign in to comment.