Class: AWSCDK::Autoscaling::StepScalingAction
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::Autoscaling::StepScalingAction
- Defined in:
- autoscaling/step_scaling_action.rb
Overview
Define a step scaling action.
This kind of scaling policy adjusts the target capacity in configurable steps. The size of the step is configurable based on the metric's distance to its alarm threshold.
This Action must be used as the target of a CloudWatch alarm to take effect.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_adjustment(adjustment) ⇒ void
Add an adjustment interval to the ScalingAction.
-
#initialize(scope, id, props) ⇒ StepScalingAction
constructor
A new instance of StepScalingAction.
-
#node ⇒ Constructs::Node
The tree node.
-
#scaling_policy_arn ⇒ String
ARN of the scaling policy.
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ StepScalingAction
Returns a new instance of StepScalingAction.
17 18 19 20 21 22 23 |
# File 'autoscaling/step_scaling_action.rb', line 17 def initialize(scope, id, props) props = props.is_a?(Hash) ? ::AWSCDK::Autoscaling::StepScalingActionProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuU3RlcFNjYWxpbmdBY3Rpb25Qcm9wcyJ9")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'autoscaling/step_scaling_action.rb', line 25 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :scaling_policy_arn => { kind: :property, name: "scalingPolicyArn", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :add_adjustment => { kind: :method, name: "addAdjustment", is_optional: false }, } end |
Instance Method Details
#add_adjustment(adjustment) ⇒ void
This method returns an undefined value.
Add an adjustment interval to the ScalingAction.
76 77 78 79 80 |
# File 'autoscaling/step_scaling_action.rb', line 76 def add_adjustment(adjustment) adjustment = adjustment.is_a?(Hash) ? ::AWSCDK::Autoscaling::AdjustmentTier.new(**adjustment.transform_keys(&:to_sym)) : adjustment Jsii::Type.check_type(adjustment, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuQWRqdXN0bWVudFRpZXIifQ==")), "adjustment") jsii_call_method("addAdjustment", [adjustment]) end |
#node ⇒ Constructs::Node
The tree node.
38 39 40 |
# File 'autoscaling/step_scaling_action.rb', line 38 def node() jsii_get_property("node") end |
#scaling_policy_arn ⇒ String
ARN of the scaling policy.
45 46 47 |
# File 'autoscaling/step_scaling_action.rb', line 45 def scaling_policy_arn() jsii_get_property("scalingPolicyArn") end |
#to_string ⇒ String
Returns a string representation of this construct.
52 53 54 |
# File 'autoscaling/step_scaling_action.rb', line 52 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
65 66 67 68 69 70 |
# File 'autoscaling/step_scaling_action.rb', line 65 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |