Class: AWSCDK::ApplicationAutoScaling::StepScalingActionProps

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

Overview

Properties for a scaling policy.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scaling_target:, adjustment_type: nil, cooldown: nil, metric_aggregation_type: nil, min_adjustment_magnitude: nil, policy_name: nil) ⇒ StepScalingActionProps

Returns a new instance of StepScalingActionProps.

Parameters:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'application_auto_scaling/step_scaling_action_props.rb', line 13

def initialize(scaling_target:, adjustment_type: nil, cooldown: nil, metric_aggregation_type: nil, min_adjustment_magnitude: nil, policy_name: nil)
  @scaling_target = scaling_target
  Jsii::Type.check_type(@scaling_target, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLklTY2FsYWJsZVRhcmdldFJlZiJ9")), "scalingTarget")
  @adjustment_type = adjustment_type
  Jsii::Type.check_type(@adjustment_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5BZGp1c3RtZW50VHlwZSJ9")), "adjustmentType") unless @adjustment_type.nil?
  @cooldown = cooldown
  Jsii::Type.check_type(@cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "cooldown") unless @cooldown.nil?
  @metric_aggregation_type = metric_aggregation_type
  Jsii::Type.check_type(@metric_aggregation_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5NZXRyaWNBZ2dyZWdhdGlvblR5cGUifQ==")), "metricAggregationType") unless @metric_aggregation_type.nil?
  @min_adjustment_magnitude = min_adjustment_magnitude
  Jsii::Type.check_type(@min_adjustment_magnitude, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minAdjustmentMagnitude") unless @min_adjustment_magnitude.nil?
  @policy_name = policy_name
  Jsii::Type.check_type(@policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyName") unless @policy_name.nil?
end

Instance Attribute Details

#adjustment_typeAWSCDK::ApplicationAutoScaling::AdjustmentType? (readonly)

Note:

Default: ChangeInCapacity

How the adjustment numbers are interpreted.



36
37
38
# File 'application_auto_scaling/step_scaling_action_props.rb', line 36

def adjustment_type
  @adjustment_type
end

#cooldownAWSCDK::Duration? (readonly)

Note:

Default: No cooldown period

Grace period after scaling activity.

For scale out policies, multiple scale outs during the cooldown period are squashed so that only the biggest scale out happens.

For scale in policies, subsequent scale ins during the cooldown period are ignored.



48
49
50
# File 'application_auto_scaling/step_scaling_action_props.rb', line 48

def cooldown
  @cooldown
end

#metric_aggregation_typeAWSCDK::ApplicationAutoScaling::MetricAggregationType? (readonly)

Note:

Default: Average

The aggregation type for the CloudWatch metrics.



53
54
55
# File 'application_auto_scaling/step_scaling_action_props.rb', line 53

def metric_aggregation_type
  @metric_aggregation_type
end

#min_adjustment_magnitudeNumeric? (readonly)

Note:

Default: No minimum scaling effect

Minimum absolute number to adjust capacity with as result of percentage scaling.

Only when using AdjustmentType = PercentChangeInCapacity, this number controls the minimum absolute effect size.

Returns:

  • (Numeric, nil)


61
62
63
# File 'application_auto_scaling/step_scaling_action_props.rb', line 61

def min_adjustment_magnitude
  @min_adjustment_magnitude
end

#policy_nameString? (readonly)

Note:

Default: Automatically generated name

A name for the scaling policy.

Returns:

  • (String, nil)


66
67
68
# File 'application_auto_scaling/step_scaling_action_props.rb', line 66

def policy_name
  @policy_name
end

#scaling_targetAWSCDK::Interfaces::AWSApplicationautoscaling::IScalableTargetRef (readonly)

The scalable target.



31
32
33
# File 'application_auto_scaling/step_scaling_action_props.rb', line 31

def scaling_target
  @scaling_target
end

Class Method Details

.jsii_propertiesObject



68
69
70
71
72
73
74
75
76
77
# File 'application_auto_scaling/step_scaling_action_props.rb', line 68

def self.jsii_properties
  {
    :scaling_target => "scalingTarget",
    :adjustment_type => "adjustmentType",
    :cooldown => "cooldown",
    :metric_aggregation_type => "metricAggregationType",
    :min_adjustment_magnitude => "minAdjustmentMagnitude",
    :policy_name => "policyName",
  }
end

Instance Method Details

#to_jsiiObject



79
80
81
82
83
84
85
86
87
88
89
90
# File 'application_auto_scaling/step_scaling_action_props.rb', line 79

def to_jsii
  result = {}
  result.merge!({
    "scalingTarget" => @scaling_target,
    "adjustmentType" => @adjustment_type,
    "cooldown" => @cooldown,
    "metricAggregationType" => @metric_aggregation_type,
    "minAdjustmentMagnitude" => @min_adjustment_magnitude,
    "policyName" => @policy_name,
  })
  result.compact
end