Skip to content

(elasticloadbalancingv2): Incorrect validation on NetworkLoadBalancer.configureHealthCheck() #16446

@ryparker

Description

@ryparker

The NetworkLoadBalancer's configureHealthCheck() method is incorrectly throwing a validation error when provided a valid protocol and the same value for both interval and timeout.

Error: Healthcheck interval 10 seconds must be greater than the timeout 10 seconds

This rule only applies to Application Load Balancers and not Network Load Balancers.

Reproduction Steps

const app = new cdk.App();
const stack = new cdk.Stack(app, 'Stack');
const vpc = new ec2.Vpc(stack, 'VPC', {});


new elbv2.NetworkTargetGroup(stack, 'TargetGroup', {
  vpc,
  port: 80,
  healthCheck: {
    interval: cdk.Duration.seconds(10),
    timeout: cdk.Duration.seconds(10),
    protocol: protocol,
  },
});

What did you expect to happen?

No validation errors.

What actually happened?

Error: Healthcheck interval 10 seconds must be greater than the timeout 10 seconds

Environment

  • CDK CLI Version : 1.121.0 (build 026cb8f)
  • Framework Version:
  • Node.js Version: v16.6.2
  • OS : Mac
  • Language (Version): TypeScript

Other

Fixed in PR: #16445


This is 🐛 Bug Report

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-elasticloadbalancingv2Related to Amazon Elastic Load Balancing V2bugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions