Class InstanceIdTarget
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.elasticloadbalancingv2.targets.InstanceIdTarget
- All Implemented Interfaces:
IApplicationLoadBalancerTarget,INetworkLoadBalancerTarget,software.amazon.jsii.JsiiSerializable
- Direct Known Subclasses:
InstanceTarget
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:40:52.178Z")
@Stability(Stable)
public class InstanceIdTarget
extends software.amazon.jsii.JsiiObject
implements IApplicationLoadBalancerTarget, INetworkLoadBalancerTarget
An EC2 instance that is the target for load balancing.
If you register a target of this type, you are responsible for making sure the load balancer's security group can connect to the instance.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.elasticloadbalancingv2.targets.*;
InstanceIdTarget instanceIdTarget = new InstanceIdTarget("instanceId", 123);
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.IApplicationLoadBalancerTarget
IApplicationLoadBalancerTarget.Jsii$Default, IApplicationLoadBalancerTarget.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.elasticloadbalancingv2.INetworkLoadBalancerTarget
INetworkLoadBalancerTarget.Jsii$Default, INetworkLoadBalancerTarget.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionInstanceIdTarget(String instanceId) Create a new Instance target.InstanceIdTarget(String instanceId, Number port) Create a new Instance target.protectedInstanceIdTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedInstanceIdTarget(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionattachToApplicationTargetGroup(IApplicationTargetGroup targetGroup) Register this instance target with a load balancer.attachToNetworkTargetGroup(INetworkTargetGroup targetGroup) Register this instance target with a load balancer.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
InstanceIdTarget
protected InstanceIdTarget(software.amazon.jsii.JsiiObjectRef objRef) -
InstanceIdTarget
protected InstanceIdTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
InstanceIdTarget
Create a new Instance target.- Parameters:
instanceId- Instance ID of the instance to register to. This parameter is required.port- Override the default port for the target group.
-
InstanceIdTarget
Create a new Instance target.- Parameters:
instanceId- Instance ID of the instance to register to. This parameter is required.
-
-
Method Details
-
attachToApplicationTargetGroup
@Stability(Stable) @NotNull public LoadBalancerTargetProps attachToApplicationTargetGroup(@NotNull IApplicationTargetGroup targetGroup) Register this instance target with a load balancer.Don't call this, it is called automatically when you add the target to a load balancer.
- Specified by:
attachToApplicationTargetGroupin interfaceIApplicationLoadBalancerTarget- Parameters:
targetGroup- This parameter is required.
-
attachToNetworkTargetGroup
@Stability(Stable) @NotNull public LoadBalancerTargetProps attachToNetworkTargetGroup(@NotNull INetworkTargetGroup targetGroup) Register this instance target with a load balancer.Don't call this, it is called automatically when you add the target to a load balancer.
- Specified by:
attachToNetworkTargetGroupin interfaceINetworkLoadBalancerTarget- Parameters:
targetGroup- This parameter is required.
-