Class LoadBalancer
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.elasticloadbalancing.LoadBalancer
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IConnectable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:40.176Z")
@Stability(Stable)
public class LoadBalancer
extends Resource
implements IConnectable
A load balancer with a single listener.
Routes to a fleet of of instances in a VPC.
Example:
IVpc vpc; AutoScalingGroup myAutoScalingGroup; LoadBalancer lb = LoadBalancer.Builder.create(this, "LB") .vpc(vpc) .internetFacing(true) .healthCheck(HealthCheck.builder() .port(80) .build()) .build(); lb.addTarget(myAutoScalingGroup); lb.addListener(LoadBalancerListener.builder() .externalPort(80) .build());
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IConnectable
IConnectable.Jsii$Default, IConnectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
LoadBalancer
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
LoadBalancer
(software.amazon.jsii.JsiiObjectRef objRef) LoadBalancer
(software.constructs.Construct scope, String id, LoadBalancerProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddListener
(LoadBalancerListener listener) Add a backend to the load balancer.void
addTarget
(ILoadBalancerTarget target) Control all connections from and to this load balancer.An object controlling specifically the connections for each listener added to this load balancer.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
LoadBalancer
protected LoadBalancer(software.amazon.jsii.JsiiObjectRef objRef) -
LoadBalancer
protected LoadBalancer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
LoadBalancer
@Stability(Stable) public LoadBalancer(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull LoadBalancerProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
addListener
Add a backend to the load balancer.- Parameters:
listener
- This parameter is required.- Returns:
- A ListenerPort object that controls connections to the listener port
-
addTarget
- Parameters:
target
- This parameter is required.
-
getConnections
Control all connections from and to this load balancer.- Specified by:
getConnections
in interfaceIConnectable
-
getListenerPorts
An object controlling specifically the connections for each listener added to this load balancer. -
getLoadBalancerCanonicalHostedZoneName
-
getLoadBalancerCanonicalHostedZoneNameId
-
getLoadBalancerDnsName
-
getLoadBalancerName
-
getLoadBalancerSourceSecurityGroupGroupName
-
getLoadBalancerSourceSecurityGroupOwnerAlias
-