class InstanceTarget
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ElasticLoadBalancingV2.InstanceTarget |
![]() | software.amazon.awscdk.services.elasticloadbalancingv2.InstanceTarget |
![]() | aws_cdk.aws_elasticloadbalancingv2.InstanceTarget |
![]() | @aws-cdk/aws-elasticloadbalancingv2 » InstanceTarget |
⚠️ Deprecated: Use IpTarget from the
Implements
IApplication
, INetwork
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 * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
const instanceTarget = new elbv2.InstanceTarget('instanceId', /* all optional props */ 123);
Initializer
new InstanceTarget(instanceId: string, port?: number)
⚠️ Deprecated: Use IpTarget from the
Parameters
- instanceId
string
— Instance ID of the instance to register to. - port
number
— Override the default port for the target group.
Create a new Instance target.
Methods
Name | Description |
---|---|
attach | Register this instance target with a load balancer. |
attach | Register this instance target with a load balancer. |
attachToApplicationTargetGroup(targetGroup)
public attachToApplicationTargetGroup(targetGroup: IApplicationTargetGroup): LoadBalancerTargetProps
⚠️ Deprecated: Use IpTarget from the
Parameters
- targetGroup
IApplication
Target Group
Returns
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.
attachToNetworkTargetGroup(targetGroup)
public attachToNetworkTargetGroup(targetGroup: INetworkTargetGroup): LoadBalancerTargetProps
⚠️ Deprecated: Use IpTarget from the
Parameters
- targetGroup
INetwork
Target Group
Returns
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.