Class: AWSCDK::Autoscaling::TargetTrackingScalingPolicyProps
- Inherits:
-
BasicTargetTrackingScalingPolicyProps
- Object
- BasicTargetTrackingScalingPolicyProps
- AWSCDK::Autoscaling::TargetTrackingScalingPolicyProps
- Defined in:
- autoscaling/target_tracking_scaling_policy_props.rb
Overview
Properties for a concrete TargetTrackingPolicy.
Adds the scalingTarget.
Instance Attribute Summary collapse
- #auto_scaling_group ⇒ AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef readonly
-
#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, auto_scaling_group:) ⇒ TargetTrackingScalingPolicyProps
constructor
A new instance of TargetTrackingScalingPolicyProps.
- #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, auto_scaling_group:) ⇒ TargetTrackingScalingPolicyProps
Returns a new instance of TargetTrackingScalingPolicyProps.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 17 def initialize(cooldown: nil, disable_scale_in: nil, estimated_instance_warmup: nil, target_value:, custom_metric: nil, predefined_metric: nil, resource_label: nil, auto_scaling_group:) @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? @auto_scaling_group = auto_scaling_group Jsii::Type.check_type(@auto_scaling_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hdXRvc2NhbGluZy5JQXV0b1NjYWxpbmdHcm91cFJlZiJ9")), "autoScalingGroup") end |
Instance Attribute Details
#auto_scaling_group ⇒ AWSCDK::Interfaces::AWSAutoscaling::IAutoScalingGroupRef (readonly)
91 92 93 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 91 def auto_scaling_group @auto_scaling_group end |
#cooldown ⇒ AWSCDK::Duration? (readonly)
Default: - The default cooldown configured on the AutoScalingGroup.
Period after a scaling completes before another scaling activity can start.
40 41 42 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 40 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.
69 70 71 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 69 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.
50 51 52 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 50 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.
55 56 57 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 55 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.
79 80 81 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 79 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/
89 90 91 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 89 def resource_label @resource_label end |
#target_value ⇒ Numeric (readonly)
The target value for the metric.
59 60 61 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 59 def target_value @target_value end |
Class Method Details
.jsii_properties ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 93 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", :auto_scaling_group => "autoScalingGroup", } end |
Instance Method Details
#to_jsii ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'autoscaling/target_tracking_scaling_policy_props.rb', line 106 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, "autoScalingGroup" => @auto_scaling_group, }) result.compact end |