Class: AWSCDK::VPCLattice::CfnListener::WeightedTargetGroupProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
vpc_lattice/cfn_listener.rb

Overview

Describes the weight of a target group.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_group_identifier:, weight: nil) ⇒ WeightedTargetGroupProperty

Returns a new instance of WeightedTargetGroupProperty.

Parameters:

  • target_group_identifier (String)

    The ID of the target group.

  • weight (Numeric, nil) (defaults to: nil)

    Only required if you specify multiple target groups for a forward action.



731
732
733
734
735
736
# File 'vpc_lattice/cfn_listener.rb', line 731

def initialize(target_group_identifier:, weight: nil)
  @target_group_identifier = target_group_identifier
  Jsii::Type.check_type(@target_group_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetGroupIdentifier")
  @weight = weight
  Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") unless @weight.nil?
end

Instance Attribute Details

#target_group_identifierString (readonly)

The ID of the target group.



742
743
744
# File 'vpc_lattice/cfn_listener.rb', line 742

def target_group_identifier
  @target_group_identifier
end

#weightNumeric? (readonly)

Only required if you specify multiple target groups for a forward action.

The weight determines how requests are distributed to the target group. For example, if you specify two target groups, each with a weight of 10, each target group receives half the requests. If you specify two target groups, one with a weight of 10 and the other with a weight of 20, the target group with a weight of 20 receives twice as many requests as the other target group. If there's only one target group specified, then the default value is 100.



749
750
751
# File 'vpc_lattice/cfn_listener.rb', line 749

def weight
  @weight
end

Class Method Details

.jsii_propertiesObject



751
752
753
754
755
756
# File 'vpc_lattice/cfn_listener.rb', line 751

def self.jsii_properties
  {
    :target_group_identifier => "targetGroupIdentifier",
    :weight => "weight",
  }
end

Instance Method Details

#to_jsiiObject



758
759
760
761
762
763
764
765
# File 'vpc_lattice/cfn_listener.rb', line 758

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