InstanceTarget

class aws_cdk.aws_elasticloadbalancingv2_targets.InstanceTarget(instance, port=None)

Bases: InstanceIdTarget

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_elasticloadbalancingv2_targets as elasticloadbalancingv2_targets

# instance: ec2.Instance

instance_target = elasticloadbalancingv2_targets.InstanceTarget(instance, 123)

Create a new Instance target.

Parameters:
  • instance (Instance) – Instance to register to.

  • port (Union[int, float, None]) – Override the default port for the target group.

Methods

attach_to_application_target_group(target_group)

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.

Parameters:

target_group (IApplicationTargetGroup) –

Return type:

LoadBalancerTargetProps

attach_to_network_target_group(target_group)

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.

Parameters:

target_group (INetworkTargetGroup) –

Return type:

LoadBalancerTargetProps