Class: AWSCDK::ElasticLoadBalancingv2::WeightedTargetGroup

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
elastic_load_balancingv2/weighted_target_group.rb

Overview

A Target Group and weight combination.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_group:, weight: nil) ⇒ WeightedTargetGroup

Returns a new instance of WeightedTargetGroup.

Parameters:



9
10
11
12
13
14
# File 'elastic_load_balancingv2/weighted_target_group.rb', line 9

def initialize(target_group:, weight: nil)
  @target_group = target_group
  Jsii::Type.check_type(@target_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWxhc3RpY2xvYWRiYWxhbmNpbmd2Mi5JQXBwbGljYXRpb25UYXJnZXRHcm91cCJ9")), "targetGroup")
  @weight = weight
  Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") unless @weight.nil?
end

Instance Attribute Details

#target_groupAWSCDK::ElasticLoadBalancingv2::IApplicationTargetGroup (readonly)

The target group.



19
20
21
# File 'elastic_load_balancingv2/weighted_target_group.rb', line 19

def target_group
  @target_group
end

#weightNumeric? (readonly)

Note:

Default: 1

The target group's weight.

Range is [0..1000).

Returns:

  • (Numeric, nil)


26
27
28
# File 'elastic_load_balancingv2/weighted_target_group.rb', line 26

def weight
  @weight
end

Class Method Details

.jsii_propertiesObject



28
29
30
31
32
33
# File 'elastic_load_balancingv2/weighted_target_group.rb', line 28

def self.jsii_properties
  {
    :target_group => "targetGroup",
    :weight => "weight",
  }
end

Instance Method Details

#to_jsiiObject



35
36
37
38
39
40
41
42
# File 'elastic_load_balancingv2/weighted_target_group.rb', line 35

def to_jsii
  result = {}
  result.merge!({
    "targetGroup" => @target_group,
    "weight" => @weight,
  })
  result.compact
end