Class: AWSCDK::ElasticLoadBalancingv2Targets::ALBListenerTarget

Inherits:
ALBARNTarget
  • Object
show all
Defined in:
elastic_load_balancingv2_targets/alb_listener_target.rb

Overview

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(alb_listener) ⇒ ALBListenerTarget

Create a new ALB target.

The associated target group will automatically have a dependency added against the ALB's listener.

Parameters:



14
15
16
17
# File 'elastic_load_balancingv2_targets/alb_listener_target.rb', line 14

def initialize(alb_listener)
  Jsii::Type.check_type(alb_listener, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5BcHBsaWNhdGlvbkxpc3RlbmVyIn0=")), "albListener")
  Jsii::Object.instance_method(:initialize).bind(self).call(alb_listener)
end

Class Method Details

.jsii_overridable_methodsObject



19
20
21
22
23
# File 'elastic_load_balancingv2_targets/alb_listener_target.rb', line 19

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.

This adds dependency on albListener because creation of ALB listener and NLB can vary during runtime. More Details on - https://github.com/aws/aws-cdk/issues/17208



35
36
37
38
# File 'elastic_load_balancingv2_targets/alb_listener_target.rb', line 35

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