Class LoadBalancer.Builder

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

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

    • create

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

      @Stability(Stable) public LoadBalancer.Builder vpc(IVpc vpc)
      VPC network of the fleet instances.

      Parameters:
      vpc - VPC network of the fleet instances. This parameter is required.
      Returns:
      this
    • accessLoggingPolicy

      @Stability(Stable) public LoadBalancer.Builder accessLoggingPolicy(CfnLoadBalancer.AccessLoggingPolicyProperty accessLoggingPolicy)
      Enable Loadbalancer access logs Can be used to avoid manual work as aws console Required S3 bucket name , enabled flag Can add interval for pushing log Can set bucket prefix in order to provide folder name inside bucket.

      Default: - disabled

      Parameters:
      accessLoggingPolicy - Enable Loadbalancer access logs Can be used to avoid manual work as aws console Required S3 bucket name , enabled flag Can add interval for pushing log Can set bucket prefix in order to provide folder name inside bucket. This parameter is required.
      Returns:
      this
    • crossZone

      @Stability(Stable) public LoadBalancer.Builder crossZone(Boolean crossZone)
      Whether cross zone load balancing is enabled.

      This controls whether the load balancer evenly distributes requests across each availability zone

      Default: true

      Parameters:
      crossZone - Whether cross zone load balancing is enabled. This parameter is required.
      Returns:
      this
    • healthCheck

      @Stability(Stable) public LoadBalancer.Builder healthCheck(HealthCheck healthCheck)
      Health check settings for the load balancing targets.

      Not required but recommended.

      Default: - None.

      Parameters:
      healthCheck - Health check settings for the load balancing targets. This parameter is required.
      Returns:
      this
    • internetFacing

      @Stability(Stable) public LoadBalancer.Builder internetFacing(Boolean internetFacing)
      Whether this is an internet-facing Load Balancer.

      This controls whether the LB has a public IP address assigned. It does not open up the Load Balancer's security groups to public internet access.

      Default: false

      Parameters:
      internetFacing - Whether this is an internet-facing Load Balancer. This parameter is required.
      Returns:
      this
    • listeners

      @Stability(Stable) public LoadBalancer.Builder listeners(List<? extends LoadBalancerListener> listeners)
      What listeners to set up for the load balancer.

      Can also be added by .addListener()

      Default: -

      Parameters:
      listeners - What listeners to set up for the load balancer. This parameter is required.
      Returns:
      this
    • subnetSelection

      @Stability(Stable) public LoadBalancer.Builder subnetSelection(SubnetSelection subnetSelection)
      Which subnets to deploy the load balancer.

      Can be used to define a specific set of subnets to deploy the load balancer to. Useful multiple public or private subnets are covering the same availability zone.

      Default: - Public subnets if internetFacing, Private subnets otherwise

      Parameters:
      subnetSelection - Which subnets to deploy the load balancer. This parameter is required.
      Returns:
      this
    • targets

      @Stability(Stable) public LoadBalancer.Builder targets(List<? extends ILoadBalancerTarget> targets)
      What targets to load balance to.

      Can also be added by .addTarget()

      Default: - None.

      Parameters:
      targets - What targets to load balance to. This parameter is required.
      Returns:
      this
    • build

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