Class InstanceTarget
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.elasticloadbalancing.InstanceTarget
- All Implemented Interfaces:
IConnectable
,ILoadBalancerTarget
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.102.0 (build e354887)",
date="2024-08-29T22:54:18.773Z")
@Stability(Stable)
public class InstanceTarget
extends software.amazon.jsii.JsiiObject
implements ILoadBalancerTarget
An EC2 instance that is the target for load balancing.
Example:
IVpc vpc; LoadBalancer lb = LoadBalancer.Builder.create(this, "LB") .vpc(vpc) .internetFacing(true) .build(); // instance to add as the target for load balancer. Instance instance = Instance.Builder.create(this, "targetInstance") .vpc(vpc) .instanceType(InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.MICRO)) .machineImage(AmazonLinuxImage.Builder.create().generation(AmazonLinuxGeneration.AMAZON_LINUX_2).build()) .build(); lb.addTarget(new InstanceTarget(instance));
-
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.elasticloadbalancing.ILoadBalancerTarget
ILoadBalancerTarget.Jsii$Default, ILoadBalancerTarget.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionInstanceTarget
(Instance instance) Create a new Instance target.protected
InstanceTarget
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
InstanceTarget
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoid
attachToClassicLB
(LoadBalancer loadBalancer) Attach load-balanced target to a classic ELB.The network connections associated with this resource.Instance to register to.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, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
InstanceTarget
protected InstanceTarget(software.amazon.jsii.JsiiObjectRef objRef) -
InstanceTarget
protected InstanceTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
InstanceTarget
Create a new Instance target.- Parameters:
instance
- Instance to register to. This parameter is required.
-
-
Method Details
-
attachToClassicLB
Attach load-balanced target to a classic ELB.- Specified by:
attachToClassicLB
in interfaceILoadBalancerTarget
- Parameters:
loadBalancer
- This parameter is required.
-
getConnections
The network connections associated with this resource.- Specified by:
getConnections
in interfaceIConnectable
-
getInstance
Instance to register to.
-