Class: AWSCDK::GameLift::CfnGameServerGroup::AutoScalingPolicyProperty

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

Overview

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

Configuration settings for intelligent automatic scaling that uses target tracking. After the Auto Scaling group is created, all updates to Auto Scaling policies, including changing this policy and adding or removing other policies, is done directly on the Auto Scaling group.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_tracking_configuration:, estimated_instance_warmup: nil) ⇒ AutoScalingPolicyProperty

Returns a new instance of AutoScalingPolicyProperty.

Parameters:



688
689
690
691
692
693
# File 'game_lift/cfn_game_server_group.rb', line 688

def initialize(target_tracking_configuration:, estimated_instance_warmup: nil)
  @target_tracking_configuration = target_tracking_configuration.is_a?(Hash) ? ::AWSCDK::GameLift::CfnGameServerGroup::TargetTrackingConfigurationProperty.new(**target_tracking_configuration.transform_keys(&:to_sym)) : target_tracking_configuration
  Jsii::Type.check_type(@target_tracking_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19nYW1lbGlmdC5DZm5HYW1lU2VydmVyR3JvdXAuVGFyZ2V0VHJhY2tpbmdDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "targetTrackingConfiguration")
  @estimated_instance_warmup = estimated_instance_warmup
  Jsii::Type.check_type(@estimated_instance_warmup, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "estimatedInstanceWarmup") unless @estimated_instance_warmup.nil?
end

Instance Attribute Details

#estimated_instance_warmupNumeric? (readonly)

Length of time, in seconds, it takes for a new instance to start new game server processes and register with Amazon GameLift Servers FleetIQ.

Specifying a warm-up time can be useful, particularly with game servers that take a long time to start up, because it avoids prematurely starting new instances.



708
709
710
# File 'game_lift/cfn_game_server_group.rb', line 708

def estimated_instance_warmup
  @estimated_instance_warmup
end

#target_tracking_configurationAWSCDK::IResolvable, AWSCDK::GameLift::CfnGameServerGroup::TargetTrackingConfigurationProperty (readonly)

Settings for a target-based scaling policy applied to Auto Scaling group.

These settings are used to create a target-based policy that tracks the GameLift FleetIQ metric PercentUtilizedGameServers and specifies a target value for the metric. As player usage changes, the policy triggers to adjust the game server group capacity so that the metric returns to the target value.



701
702
703
# File 'game_lift/cfn_game_server_group.rb', line 701

def target_tracking_configuration
  @target_tracking_configuration
end

Class Method Details

.jsii_propertiesObject



710
711
712
713
714
715
# File 'game_lift/cfn_game_server_group.rb', line 710

def self.jsii_properties
  {
    :target_tracking_configuration => "targetTrackingConfiguration",
    :estimated_instance_warmup => "estimatedInstanceWarmup",
  }
end

Instance Method Details

#to_jsiiObject



717
718
719
720
721
722
723
724
# File 'game_lift/cfn_game_server_group.rb', line 717

def to_jsii
  result = {}
  result.merge!({
    "targetTrackingConfiguration" => @target_tracking_configuration,
    "estimatedInstanceWarmup" => @estimated_instance_warmup,
  })
  result.compact
end