Class: AWSCDK::Autoscaling::StepScalingAction

Inherits:
Constructs::Construct
  • Object
show all
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

Constructor Details

#initialize(scope, id, props) ⇒ StepScalingAction

Returns a new instance of StepScalingAction.

Parameters:



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_methodsObject



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.

Parameters:



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

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


38
39
40
# File 'autoscaling/step_scaling_action.rb', line 38

def node()
  jsii_get_property("node")
end

#scaling_policy_arnString

ARN of the scaling policy.

Returns:

  • (String)


45
46
47
# File 'autoscaling/step_scaling_action.rb', line 45

def scaling_policy_arn()
  jsii_get_property("scalingPolicyArn")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


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.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



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