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 Summary
Modifier and TypeMethodDescriptionaccessLoggingPolicy
(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.build()
static LoadBalancer.Builder
Whether cross zone load balancing is enabled.healthCheck
(HealthCheck healthCheck) Health check settings for the load balancing targets.internetFacing
(Boolean internetFacing) Whether this is an internet-facing Load Balancer.listeners
(List<? extends LoadBalancerListener> listeners) What listeners to set up for the load balancer.subnetSelection
(SubnetSelection subnetSelection) Which subnets to deploy the load balancer.targets
(List<? extends ILoadBalancerTarget> targets) What targets to load balance to.VPC network of the fleet instances.
-
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
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
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
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
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
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
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
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<LoadBalancer>
- Returns:
- a newly built instance of
LoadBalancer
.
-