Class: AWSCDK::VPCLattice::CfnRule::WeightedTargetGroupProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
vpc_lattice/cfn_rule.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.



1017
1018
1019
1020
1021
1022
# File 'vpc_lattice/cfn_rule.rb', line 1017

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.



1028
1029
1030
# File 'vpc_lattice/cfn_rule.rb', line 1028

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.



1035
1036
1037
# File 'vpc_lattice/cfn_rule.rb', line 1035

def weight
  @weight
end

Class Method Details

.jsii_propertiesObject



1037
1038
1039
1040
1041
1042
# File 'vpc_lattice/cfn_rule.rb', line 1037

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

Instance Method Details

#to_jsiiObject



1044
1045
1046
1047
1048
1049
1050
1051
# File 'vpc_lattice/cfn_rule.rb', line 1044

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