Class: AWSCDK::ApplicationAutoScaling::StepScalingActionProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ApplicationAutoScaling::StepScalingActionProps
- Defined in:
- application_auto_scaling/step_scaling_action_props.rb
Overview
Properties for a scaling policy.
Instance Attribute Summary collapse
-
#adjustment_type ⇒ AWSCDK::ApplicationAutoScaling::AdjustmentType?
readonly
How the adjustment numbers are interpreted.
-
#cooldown ⇒ AWSCDK::Duration?
readonly
Grace period after scaling activity.
-
#metric_aggregation_type ⇒ AWSCDK::ApplicationAutoScaling::MetricAggregationType?
readonly
The aggregation type for the CloudWatch metrics.
-
#min_adjustment_magnitude ⇒ Numeric?
readonly
Minimum absolute number to adjust capacity with as result of percentage scaling.
-
#policy_name ⇒ String?
readonly
A name for the scaling policy.
-
#scaling_target ⇒ AWSCDK::Interfaces::AWSApplicationautoscaling::IScalableTargetRef
readonly
The scalable target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(scaling_target:, adjustment_type: nil, cooldown: nil, metric_aggregation_type: nil, min_adjustment_magnitude: nil, policy_name: nil) ⇒ StepScalingActionProps
constructor
A new instance of StepScalingActionProps.
- #to_jsii ⇒ Object
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.
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_type ⇒ AWSCDK::ApplicationAutoScaling::AdjustmentType? (readonly)
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 |
#cooldown ⇒ AWSCDK::Duration? (readonly)
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_type ⇒ AWSCDK::ApplicationAutoScaling::MetricAggregationType? (readonly)
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_magnitude ⇒ Numeric? (readonly)
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.
61 62 63 |
# File 'application_auto_scaling/step_scaling_action_props.rb', line 61 def min_adjustment_magnitude @min_adjustment_magnitude end |
#policy_name ⇒ String? (readonly)
Default: Automatically generated name
A name for the scaling policy.
66 67 68 |
# File 'application_auto_scaling/step_scaling_action_props.rb', line 66 def policy_name @policy_name end |
#scaling_target ⇒ AWSCDK::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_properties ⇒ Object
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_jsii ⇒ Object
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 |