Class: AWSCDK::Autoscaling::BasicTargetTrackingScalingPolicyProps
- Inherits:
-
BaseTargetTrackingProps
- Object
- BaseTargetTrackingProps
- AWSCDK::Autoscaling::BasicTargetTrackingScalingPolicyProps
- Defined in:
- autoscaling/basic_target_tracking_scaling_policy_props.rb
Overview
Properties for a Target Tracking policy that include the metric but exclude the target.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cooldown ⇒ AWSCDK::Duration?
readonly
Period after a scaling completes before another scaling activity can start.
-
#custom_metric ⇒ AWSCDK::CloudWatch::IMetric?
readonly
A custom metric for application autoscaling.
-
#disable_scale_in ⇒ Boolean?
readonly
Indicates whether scale in by the target tracking policy is disabled.
-
#estimated_instance_warmup ⇒ AWSCDK::Duration?
readonly
Estimated time until a newly launched instance can send metrics to CloudWatch.
-
#predefined_metric ⇒ AWSCDK::Autoscaling::PredefinedMetric?
readonly
A predefined metric for application autoscaling.
-
#resource_label ⇒ String?
readonly
The resource label associated with the predefined metric.
-
#target_value ⇒ Numeric
readonly
The target value for the metric.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(cooldown: nil, disable_scale_in: nil, estimated_instance_warmup: nil, target_value:, custom_metric: nil, predefined_metric: nil, resource_label: nil) ⇒ BasicTargetTrackingScalingPolicyProps
constructor
A new instance of BasicTargetTrackingScalingPolicyProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(cooldown: nil, disable_scale_in: nil, estimated_instance_warmup: nil, target_value:, custom_metric: nil, predefined_metric: nil, resource_label: nil) ⇒ BasicTargetTrackingScalingPolicyProps
Returns a new instance of BasicTargetTrackingScalingPolicyProps.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 14 def initialize(cooldown: nil, disable_scale_in: nil, estimated_instance_warmup: nil, target_value:, custom_metric: nil, predefined_metric: nil, resource_label: nil) @cooldown = cooldown Jsii::Type.check_type(@cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "cooldown") unless @cooldown.nil? @disable_scale_in = disable_scale_in Jsii::Type.check_type(@disable_scale_in, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "disableScaleIn") unless @disable_scale_in.nil? @estimated_instance_warmup = estimated_instance_warmup Jsii::Type.check_type(@estimated_instance_warmup, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "estimatedInstanceWarmup") unless @estimated_instance_warmup.nil? @target_value = target_value Jsii::Type.check_type(@target_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "targetValue") @custom_metric = custom_metric Jsii::Type.check_type(@custom_metric, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5JTWV0cmljIn0=")), "customMetric") unless @custom_metric.nil? @predefined_metric = predefined_metric Jsii::Type.check_type(@predefined_metric, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmcuUHJlZGVmaW5lZE1ldHJpYyJ9")), "predefinedMetric") unless @predefined_metric.nil? @resource_label = resource_label Jsii::Type.check_type(@resource_label, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceLabel") unless @resource_label.nil? end |
Instance Attribute Details
#cooldown ⇒ AWSCDK::Duration? (readonly)
Default: - The default cooldown configured on the AutoScalingGroup.
Period after a scaling completes before another scaling activity can start.
35 36 37 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 35 def cooldown @cooldown end |
#custom_metric ⇒ AWSCDK::CloudWatch::IMetric? (readonly)
Default: - No custom metric.
A custom metric for application autoscaling.
The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.
Exactly one of customMetric or predefinedMetric must be specified.
64 65 66 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 64 def custom_metric @custom_metric end |
#disable_scale_in ⇒ Boolean? (readonly)
Default: false
Indicates whether scale in by the target tracking policy is disabled.
If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the autoscaling group. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the group.
45 46 47 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 45 def disable_scale_in @disable_scale_in end |
#estimated_instance_warmup ⇒ AWSCDK::Duration? (readonly)
Default: - Same as the cooldown.
Estimated time until a newly launched instance can send metrics to CloudWatch.
50 51 52 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 50 def estimated_instance_warmup @estimated_instance_warmup end |
#predefined_metric ⇒ AWSCDK::Autoscaling::PredefinedMetric? (readonly)
Default: - No predefined metric.
A predefined metric for application autoscaling.
The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.
Exactly one of customMetric or predefinedMetric must be specified.
74 75 76 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 74 def predefined_metric @predefined_metric end |
#resource_label ⇒ String? (readonly)
Default: - No resource label.
The resource label associated with the predefined metric.
Should be supplied if the predefined metric is ALBRequestCountPerTarget, and the format should be:
app/
84 85 86 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 84 def resource_label @resource_label end |
#target_value ⇒ Numeric (readonly)
The target value for the metric.
54 55 56 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 54 def target_value @target_value end |
Class Method Details
.jsii_properties ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 86 def self.jsii_properties { :cooldown => "cooldown", :disable_scale_in => "disableScaleIn", :estimated_instance_warmup => "estimatedInstanceWarmup", :target_value => "targetValue", :custom_metric => "customMetric", :predefined_metric => "predefinedMetric", :resource_label => "resourceLabel", } end |
Instance Method Details
#to_jsii ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'autoscaling/basic_target_tracking_scaling_policy_props.rb', line 98 def to_jsii result = {} result.merge!(super) result.merge!({ "cooldown" => @cooldown, "disableScaleIn" => @disable_scale_in, "estimatedInstanceWarmup" => @estimated_instance_warmup, "targetValue" => @target_value, "customMetric" => @custom_metric, "predefinedMetric" => @predefined_metric, "resourceLabel" => @resource_label, }) result.compact end |