Class: AWSCDK::ElasticLoadBalancingv2Targets::ALBARNTarget

Inherits:
Jsii::Object
  • Object
show all
Includes:
AWSCDK::ElasticLoadBalancingv2::INetworkLoadBalancerTarget
Defined in:
elastic_load_balancingv2_targets/albarn_target.rb

Overview

A single Application Load Balancer as the target for load balancing.

Direct Known Subclasses

ALBListenerTarget, ALBTarget

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alb_arn, port) ⇒ ALBARNTarget

Create a new alb target.

Note that the ALB must have a listener on the provided target port.

Parameters:

  • alb_arn (String)

    The ARN of the application load balancer to load balance to.

  • port (Numeric)

    The port on which the target is listening.



15
16
17
18
19
# File 'elastic_load_balancingv2_targets/albarn_target.rb', line 15

def initialize(alb_arn, port)
  Jsii::Type.check_type(alb_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "albArn")
  Jsii::Type.check_type(port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port")
  Jsii::Object.instance_method(:initialize).bind(self).call(alb_arn, port)
end

Class Method Details

.jsii_overridable_methodsObject



21
22
23
24
25
# File 'elastic_load_balancingv2_targets/albarn_target.rb', line 21

def self.jsii_overridable_methods
  {
    :attach_to_network_target_group => { kind: :method, name: "attachToNetworkTargetGroup", is_optional: false },
  }
end

Instance Method Details

#attach_to_network_target_group(target_group) ⇒ AWSCDK::ElasticLoadBalancingv2::LoadBalancerTargetProps

Register this alb target with a load balancer.

Don't call this, it is called automatically when you add the target to a load balancer.



34
35
36
37
# File 'elastic_load_balancingv2_targets/albarn_target.rb', line 34

def attach_to_network_target_group(target_group)
  Jsii::Type.check_type(target_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JTmV0d29ya1RhcmdldEdyb3VwIn0=")), "targetGroup")
  jsii_call_method("attachToNetworkTargetGroup", [target_group])
end