Class: AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingPolicyConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
application_auto_scaling/cfn_scaling_policy.rb

Overview

Represents a predictive scaling policy configuration.

Predictive scaling is supported on Amazon ECS services.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric_specifications:, max_capacity_breach_behavior: nil, max_capacity_buffer: nil, mode: nil, scheduling_buffer_time: nil) ⇒ PredictiveScalingPolicyConfigurationProperty

Returns a new instance of PredictiveScalingPolicyConfigurationProperty.

Parameters:

  • metric_specifications (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricSpecificationProperty>)

    This structure includes the metrics and target utilization to use for predictive scaling.

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

    Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity.

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

    The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity.

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

    The predictive scaling mode.

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

    The amount of time, in seconds, that the start time can be advanced.



1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1269

def initialize(metric_specifications:, max_capacity_breach_behavior: nil, max_capacity_buffer: nil, mode: nil, scheduling_buffer_time: nil)
  @metric_specifications = metric_specifications
  Jsii::Type.check_type(@metric_specifications, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5DZm5TY2FsaW5nUG9saWN5LlByZWRpY3RpdmVTY2FsaW5nTWV0cmljU3BlY2lmaWNhdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "metricSpecifications")
  @max_capacity_breach_behavior = max_capacity_breach_behavior
  Jsii::Type.check_type(@max_capacity_breach_behavior, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "maxCapacityBreachBehavior") unless @max_capacity_breach_behavior.nil?
  @max_capacity_buffer = max_capacity_buffer
  Jsii::Type.check_type(@max_capacity_buffer, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxCapacityBuffer") unless @max_capacity_buffer.nil?
  @mode = mode
  Jsii::Type.check_type(@mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mode") unless @mode.nil?
  @scheduling_buffer_time = scheduling_buffer_time
  Jsii::Type.check_type(@scheduling_buffer_time, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "schedulingBufferTime") unless @scheduling_buffer_time.nil?
end

Instance Attribute Details

#max_capacity_breach_behaviorString? (readonly)

Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity.

Defaults to HonorMaxCapacity if not specified.



1295
1296
1297
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1295

def max_capacity_breach_behavior
  @max_capacity_breach_behavior
end

#max_capacity_bufferNumeric? (readonly)

The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity.

The value is specified as a percentage relative to the forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55.

Required if the MaxCapacityBreachBehavior property is set to IncreaseMaxCapacity , and cannot be used otherwise.



1304
1305
1306
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1304

def max_capacity_buffer
  @max_capacity_buffer
end

#metric_specificationsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricSpecificationProperty> (readonly)

This structure includes the metrics and target utilization to use for predictive scaling.

This is an array, but we currently only support a single metric specification. That is, you can specify a target value and a single metric pair, or a target value and one scaling metric and one load metric.



1288
1289
1290
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1288

def metric_specifications
  @metric_specifications
end

#modeString? (readonly)

The predictive scaling mode.

Defaults to ForecastOnly if not specified.



1311
1312
1313
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1311

def mode
  @mode
end

#scheduling_buffer_timeNumeric? (readonly)

The amount of time, in seconds, that the start time can be advanced.

The value must be less than the forecast interval duration of 3600 seconds (60 minutes). Defaults to 300 seconds if not specified.



1318
1319
1320
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1318

def scheduling_buffer_time
  @scheduling_buffer_time
end

Class Method Details

.jsii_propertiesObject



1320
1321
1322
1323
1324
1325
1326
1327
1328
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1320

def self.jsii_properties
  {
    :metric_specifications => "metricSpecifications",
    :max_capacity_breach_behavior => "maxCapacityBreachBehavior",
    :max_capacity_buffer => "maxCapacityBuffer",
    :mode => "mode",
    :scheduling_buffer_time => "schedulingBufferTime",
  }
end

Instance Method Details

#to_jsiiObject



1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1330

def to_jsii
  result = {}
  result.merge!({
    "metricSpecifications" => @metric_specifications,
    "maxCapacityBreachBehavior" => @max_capacity_breach_behavior,
    "maxCapacityBuffer" => @max_capacity_buffer,
    "mode" => @mode,
    "schedulingBufferTime" => @scheduling_buffer_time,
  })
  result.compact
end