Class NetworkLoadBalancer.Builder

java.lang.Object
software.amazon.awscdk.services.elasticloadbalancingv2.NetworkLoadBalancer.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkLoadBalancer>
Enclosing class:
NetworkLoadBalancer

@Stability(Stable) public static final class NetworkLoadBalancer.Builder extends Object implements software.amazon.jsii.Builder<NetworkLoadBalancer>
A fluent builder for NetworkLoadBalancer.
  • Method Details

    • create

      @Stability(Stable) public static NetworkLoadBalancer.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of NetworkLoadBalancer.Builder.
    • vpc

      @Stability(Stable) public NetworkLoadBalancer.Builder vpc(IVpc vpc)
      The VPC network to place the load balancer in.

      Parameters:
      vpc - The VPC network to place the load balancer in. This parameter is required.
      Returns:
      this
    • crossZoneEnabled

      @Stability(Stable) public NetworkLoadBalancer.Builder crossZoneEnabled(Boolean crossZoneEnabled)
      Indicates whether cross-zone load balancing is enabled.

      Default: - false for Network Load Balancers and true for Application Load Balancers.

      Parameters:
      crossZoneEnabled - Indicates whether cross-zone load balancing is enabled. This parameter is required.
      Returns:
      this
    • deletionProtection

      @Stability(Stable) public NetworkLoadBalancer.Builder deletionProtection(Boolean deletionProtection)
      Indicates whether deletion protection is enabled.

      Default: false

      Parameters:
      deletionProtection - Indicates whether deletion protection is enabled. This parameter is required.
      Returns:
      this
    • denyAllIgwTraffic

      @Stability(Stable) public NetworkLoadBalancer.Builder denyAllIgwTraffic(Boolean denyAllIgwTraffic)
      Indicates whether the load balancer blocks traffic through the Internet Gateway (IGW).

      Default: - false for internet-facing load balancers and true for internal load balancers

      Parameters:
      denyAllIgwTraffic - Indicates whether the load balancer blocks traffic through the Internet Gateway (IGW). This parameter is required.
      Returns:
      this
    • internetFacing

      @Stability(Stable) public NetworkLoadBalancer.Builder internetFacing(Boolean internetFacing)
      Whether the load balancer has an internet-routable address.

      Default: false

      Parameters:
      internetFacing - Whether the load balancer has an internet-routable address. This parameter is required.
      Returns:
      this
    • loadBalancerName

      @Stability(Stable) public NetworkLoadBalancer.Builder loadBalancerName(String loadBalancerName)
      Name of the load balancer.

      Default: - Automatically generated name.

      Parameters:
      loadBalancerName - Name of the load balancer. This parameter is required.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public NetworkLoadBalancer.Builder vpcSubnets(SubnetSelection vpcSubnets)
      Which subnets place the load balancer in.

      Default: - the Vpc default strategy.

      Parameters:
      vpcSubnets - Which subnets place the load balancer in. This parameter is required.
      Returns:
      this
    • clientRoutingPolicy

      @Stability(Stable) public NetworkLoadBalancer.Builder clientRoutingPolicy(ClientRoutingPolicy clientRoutingPolicy)
      The AZ affinity routing policy.

      Default: - AZ affinity is disabled.

      Parameters:
      clientRoutingPolicy - The AZ affinity routing policy. This parameter is required.
      Returns:
      this
      See Also:
    • enforceSecurityGroupInboundRulesOnPrivateLinkTraffic

      @Stability(Stable) public NetworkLoadBalancer.Builder enforceSecurityGroupInboundRulesOnPrivateLinkTraffic(Boolean enforceSecurityGroupInboundRulesOnPrivateLinkTraffic)
      Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.

      Default: true

      Parameters:
      enforceSecurityGroupInboundRulesOnPrivateLinkTraffic - Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink. This parameter is required.
      Returns:
      this
    • ipAddressType

      @Stability(Stable) public NetworkLoadBalancer.Builder ipAddressType(IpAddressType ipAddressType)
      The type of IP addresses to use.

      If you want to add a UDP or TCP_UDP listener to the load balancer, you must choose IPv4.

      Default: IpAddressType.IPV4

      Parameters:
      ipAddressType - The type of IP addresses to use. This parameter is required.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public NetworkLoadBalancer.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      Security groups to associate with this load balancer.

      Default: - No security groups associated with the load balancer.

      Parameters:
      securityGroups - Security groups to associate with this load balancer. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public NetworkLoadBalancer build()
      Specified by:
      build in interface software.amazon.jsii.Builder<NetworkLoadBalancer>
      Returns:
      a newly built instance of NetworkLoadBalancer.