Class: AWSCDK::GameLift::CfnGameServerGroup::InstanceDefinitionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
game_lift/cfn_game_server_group.rb

Overview

This data type is used with the Amazon GameLift FleetIQ and game server groups..

An allowed instance type for a GameServerGroup . All game server groups must have at least two instance types defined for it. GameLift FleetIQ periodically evaluates each defined instance type for viability. It then updates the Auto Scaling group with the list of viable instance types.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_type:, weighted_capacity: nil) ⇒ InstanceDefinitionProperty

Returns a new instance of InstanceDefinitionProperty.

Parameters:

  • instance_type (String)

    An Amazon EC2 instance type designation.

  • weighted_capacity (String, nil) (defaults to: nil)

    Instance weighting that indicates how much this instance type contributes to the total capacity of a game server group.



737
738
739
740
741
742
# File 'game_lift/cfn_game_server_group.rb', line 737

def initialize(instance_type:, weighted_capacity: nil)
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceType")
  @weighted_capacity = weighted_capacity
  Jsii::Type.check_type(@weighted_capacity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "weightedCapacity") unless @weighted_capacity.nil?
end

Instance Attribute Details

#instance_typeString (readonly)

An Amazon EC2 instance type designation.



748
749
750
# File 'game_lift/cfn_game_server_group.rb', line 748

def instance_type
  @instance_type
end

#weighted_capacityString? (readonly)

Instance weighting that indicates how much this instance type contributes to the total capacity of a game server group.

Instance weights are used by Amazon GameLift Servers FleetIQ to calculate the instance type's cost per unit hour and better identify the most cost-effective options. For detailed information on weighting instance capacity, see Instance Weighting in the Amazon Elastic Compute Cloud Auto Scaling User Guide . Default value is "1".



755
756
757
# File 'game_lift/cfn_game_server_group.rb', line 755

def weighted_capacity
  @weighted_capacity
end

Class Method Details

.jsii_propertiesObject



757
758
759
760
761
762
# File 'game_lift/cfn_game_server_group.rb', line 757

def self.jsii_properties
  {
    :instance_type => "instanceType",
    :weighted_capacity => "weightedCapacity",
  }
end

Instance Method Details

#to_jsiiObject



764
765
766
767
768
769
770
771
# File 'game_lift/cfn_game_server_group.rb', line 764

def to_jsii
  result = {}
  result.merge!({
    "instanceType" => @instance_type,
    "weightedCapacity" => @weighted_capacity,
  })
  result.compact
end