Class: AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::TargetTrackingScalingPolicyConfigurationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::TargetTrackingScalingPolicyConfigurationProperty
- Defined in:
- application_auto_scaling/cfn_scaling_policy.rb
Overview
TargetTrackingScalingPolicyConfiguration is a property of the AWS::ApplicationAutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Application Auto Scaling. Use a target tracking scaling policy to adjust the capacity of the specified scalable target in response to actual workloads, so that resource utilization remains at or near the target utilization value.
For more information, see Target tracking scaling policies in the Application Auto Scaling User Guide .
Instance Attribute Summary collapse
-
#customized_metric_specification ⇒ AWSCDK::IResolvable, ...
readonly
A customized metric.
-
#disable_scale_in ⇒ Boolean, ...
readonly
Indicates whether scale in by the target tracking scaling policy is disabled.
-
#predefined_metric_specification ⇒ AWSCDK::IResolvable, ...
readonly
A predefined metric.
-
#scale_in_cooldown ⇒ Numeric?
readonly
The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start.
-
#scale_out_cooldown ⇒ Numeric?
readonly
The amount of time, in seconds, to wait for a previous scale-out activity to take effect.
-
#target_value ⇒ Numeric
readonly
The target value for the metric.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target_value:, customized_metric_specification: nil, disable_scale_in: nil, predefined_metric_specification: nil, scale_in_cooldown: nil, scale_out_cooldown: nil) ⇒ TargetTrackingScalingPolicyConfigurationProperty
constructor
A new instance of TargetTrackingScalingPolicyConfigurationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(target_value:, customized_metric_specification: nil, disable_scale_in: nil, predefined_metric_specification: nil, scale_in_cooldown: nil, scale_out_cooldown: nil) ⇒ TargetTrackingScalingPolicyConfigurationProperty
Returns a new instance of TargetTrackingScalingPolicyConfigurationProperty.
1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1947 def initialize(target_value:, customized_metric_specification: nil, disable_scale_in: nil, predefined_metric_specification: nil, scale_in_cooldown: nil, scale_out_cooldown: nil) @target_value = target_value Jsii::Type.check_type(@target_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "targetValue") @customized_metric_specification = customized_metric_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::CustomizedMetricSpecificationProperty.new(**customized_metric_specification.transform_keys(&:to_sym)) : customized_metric_specification Jsii::Type.check_type(@customized_metric_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuQ3VzdG9taXplZE1ldHJpY1NwZWNpZmljYXRpb25Qcm9wZXJ0eSJ9XX19")), "customizedMetricSpecification") unless @customized_metric_specification.nil? @disable_scale_in = disable_scale_in Jsii::Type.check_type(@disable_scale_in, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "disableScaleIn") unless @disable_scale_in.nil? @predefined_metric_specification = predefined_metric_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredefinedMetricSpecificationProperty.new(**predefined_metric_specification.transform_keys(&:to_sym)) : predefined_metric_specification Jsii::Type.check_type(@predefined_metric_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGVmaW5lZE1ldHJpY1NwZWNpZmljYXRpb25Qcm9wZXJ0eSJ9XX19")), "predefinedMetricSpecification") unless @predefined_metric_specification.nil? @scale_in_cooldown = scale_in_cooldown Jsii::Type.check_type(@scale_in_cooldown, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "scaleInCooldown") unless @scale_in_cooldown.nil? @scale_out_cooldown = scale_out_cooldown Jsii::Type.check_type(@scale_out_cooldown, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "scaleOutCooldown") unless @scale_out_cooldown.nil? end |
Instance Attribute Details
#customized_metric_specification ⇒ AWSCDK::IResolvable, ... (readonly)
A customized metric.
You can specify either a predefined metric or a customized metric.
1975 1976 1977 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1975 def customized_metric_specification @customized_metric_specification end |
#disable_scale_in ⇒ Boolean, ... (readonly)
Indicates whether scale in by the target tracking scaling policy is disabled.
If the value is true , scale in is disabled and the target tracking scaling policy won't remove capacity from the scalable target. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable target. The default value is false .
1982 1983 1984 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1982 def disable_scale_in @disable_scale_in end |
#predefined_metric_specification ⇒ AWSCDK::IResolvable, ... (readonly)
A predefined metric.
You can specify either a predefined metric or a customized metric.
1989 1990 1991 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1989 def predefined_metric_specification @predefined_metric_specification end |
#scale_in_cooldown ⇒ Numeric? (readonly)
The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start.
For more information and for default values, see Define cooldown periods in the Application Auto Scaling User Guide .
1996 1997 1998 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1996 def scale_in_cooldown @scale_in_cooldown end |
#scale_out_cooldown ⇒ Numeric? (readonly)
The amount of time, in seconds, to wait for a previous scale-out activity to take effect.
For more information and for default values, see Define cooldown periods in the Application Auto Scaling User Guide .
2003 2004 2005 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 2003 def scale_out_cooldown @scale_out_cooldown end |
#target_value ⇒ Numeric (readonly)
The target value for the metric.
Although this property accepts numbers of type Double, it won't accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360. The value must be a valid number based on the choice of metric. For example, if the metric is CPU utilization, then the target value is a percent value that represents how much of the CPU can be used before scaling out.
1968 1969 1970 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1968 def target_value @target_value end |
Class Method Details
.jsii_properties ⇒ Object
2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 2005 def self.jsii_properties { :target_value => "targetValue", :customized_metric_specification => "customizedMetricSpecification", :disable_scale_in => "disableScaleIn", :predefined_metric_specification => "predefinedMetricSpecification", :scale_in_cooldown => "scaleInCooldown", :scale_out_cooldown => "scaleOutCooldown", } end |
Instance Method Details
#to_jsii ⇒ Object
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 |
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 2016 def to_jsii result = {} result.merge!({ "targetValue" => @target_value, "customizedMetricSpecification" => @customized_metric_specification, "disableScaleIn" => @disable_scale_in, "predefinedMetricSpecification" => @predefined_metric_specification, "scaleInCooldown" => @scale_in_cooldown, "scaleOutCooldown" => @scale_out_cooldown, }) result.compact end |