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.104.0 (build e79254c)", date="2024-12-06T14:43:18.898Z") @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

    Constructors
    Modifier
    Constructor
    Description
     
    Create a new Instance target.
    protected
    InstanceTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    InstanceTarget(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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

      @Stability(Stable) public InstanceTarget(@NotNull Instance instance)
      Create a new Instance target.

      Parameters:
      instance - Instance to register to. This parameter is required.
  • Method Details

    • attachToClassicLB

      @Stability(Stable) public void attachToClassicLB(@NotNull LoadBalancer loadBalancer)
      Attach load-balanced target to a classic ELB.

      Specified by:
      attachToClassicLB in interface ILoadBalancerTarget
      Parameters:
      loadBalancer - This parameter is required.
    • getConnections

      @Stability(Stable) @NotNull public Connections getConnections()
      The network connections associated with this resource.
      Specified by:
      getConnections in interface IConnectable
    • getInstance

      @Stability(Stable) @NotNull public Instance getInstance()
      Instance to register to.