class InstanceTarget
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.ElasticLoadBalancingV2.Targets.InstanceTarget | 
|  Java | software.amazon.awscdk.services.elasticloadbalancingv2.targets.InstanceTarget | 
|  Python | aws_cdk.aws_elasticloadbalancingv2_targets.InstanceTarget | 
|  TypeScript (source) | @aws-cdk/aws-elasticloadbalancingv2-targets»InstanceTarget | 
Implements
IApplication, INetwork
Extends
Instance
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as ec2 from '@aws-cdk/aws-ec2';
import * as elasticloadbalancingv2_targets from '@aws-cdk/aws-elasticloadbalancingv2-targets';
declare const instance: ec2.Instance;
const instanceTarget = new elasticloadbalancingv2_targets.InstanceTarget(instance, /* all optional props */ 123);
Initializer
new InstanceTarget(instance: Instance, port?: number)
Parameters
- instance Instance— 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
Parameters
- targetGroup IApplicationTarget 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
Parameters
- targetGroup INetworkTarget 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.
