InstanceTarget

class aws_cdk.aws_elasticloadbalancingv2.InstanceTarget(instance_id, port=None)

Bases: object

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.

deprecated :deprecated: Use IpTarget from the

stability :stability: deprecated aws: :aws:: -cdk/aws-elasticloadbalancingv2-targets package instead.

__init__(instance_id, port=None)

Create a new Instance target.

Parameters
  • instance_id (str) – Instance ID of the instance to register to.

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

stability :stability: deprecated

Return type

None

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) –

stability :stability: deprecated

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) –

stability :stability: deprecated

Return type

LoadBalancerTargetProps