Class: AWSCDK::ApplicationAutoScaling::BasicTargetTrackingScalingPolicyProps
- Inherits:
-
BaseTargetTrackingProps
- Object
- BaseTargetTrackingProps
- AWSCDK::ApplicationAutoScaling::BasicTargetTrackingScalingPolicyProps
- Defined in:
- application_auto_scaling/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
-
#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.
-
#policy_name ⇒ String?
readonly
A name for the scaling policy.
-
#predefined_metric ⇒ AWSCDK::ApplicationAutoScaling::PredefinedMetric?
readonly
A predefined metric for application autoscaling.
-
#resource_label ⇒ String?
readonly
Identify the resource associated with the metric type.
-
#scale_in_cooldown ⇒ AWSCDK::Duration?
readonly
Period after a scale in activity completes before another scale in activity can start.
-
#scale_out_cooldown ⇒ AWSCDK::Duration?
readonly
Period after a scale out activity completes before another scale out activity can start.
-
#target_value ⇒ Numeric
readonly
The target value for the metric.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(disable_scale_in: nil, policy_name: nil, scale_in_cooldown: nil, scale_out_cooldown: 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(disable_scale_in: nil, policy_name: nil, scale_in_cooldown: nil, scale_out_cooldown: nil, target_value:, custom_metric: nil, predefined_metric: nil, resource_label: nil) ⇒ BasicTargetTrackingScalingPolicyProps
Returns a new instance of BasicTargetTrackingScalingPolicyProps.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 15 def initialize(disable_scale_in: nil, policy_name: nil, scale_in_cooldown: nil, scale_out_cooldown: nil, target_value:, custom_metric: nil, predefined_metric: nil, resource_label: 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? @policy_name = policy_name Jsii::Type.check_type(@policy_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "policyName") unless @policy_name.nil? @scale_in_cooldown = scale_in_cooldown Jsii::Type.check_type(@scale_in_cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "scaleInCooldown") unless @scale_in_cooldown.nil? @scale_out_cooldown = scale_out_cooldown Jsii::Type.check_type(@scale_out_cooldown, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "scaleOutCooldown") unless @scale_out_cooldown.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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbGljYXRpb25hdXRvc2NhbGluZy5QcmVkZWZpbmVkTWV0cmljIn0=")), "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
#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.
72 73 74 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 72 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 scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource.
43 44 45 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 43 def disable_scale_in @disable_scale_in end |
#policy_name ⇒ String? (readonly)
Default: - Automatically generated name.
A name for the scaling policy.
48 49 50 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 48 def policy_name @policy_name end |
#predefined_metric ⇒ AWSCDK::ApplicationAutoScaling::PredefinedMetric? (readonly)
Default: - No predefined metrics.
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.
82 83 84 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 82 def predefined_metric @predefined_metric end |
#resource_label ⇒ String? (readonly)
Default: - No resource label.
Identify the resource associated with the metric type.
Only used for predefined metric ALBRequestCountPerTarget.
Example value: app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>
91 92 93 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 91 def resource_label @resource_label end |
#scale_in_cooldown ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
Period after a scale in activity completes before another scale in activity can start.
53 54 55 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 53 def scale_in_cooldown @scale_in_cooldown end |
#scale_out_cooldown ⇒ AWSCDK::Duration? (readonly)
Default: Duration.seconds(300) for the following scalable targets: ECS services, Spot Fleet requests, EMR clusters, AppStream 2.0 fleets, Aurora DB clusters, Amazon SageMaker endpoint variants, Custom resources. For all other scalable targets, the default value is Duration.seconds(0): DynamoDB tables, DynamoDB global secondary indexes, Amazon Comprehend document classification endpoints, Lambda provisioned concurrency
Period after a scale out activity completes before another scale out activity can start.
58 59 60 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 58 def scale_out_cooldown @scale_out_cooldown end |
#target_value ⇒ Numeric (readonly)
The target value for the metric.
62 63 64 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 62 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 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 93 def self.jsii_properties { :disable_scale_in => "disableScaleIn", :policy_name => "policyName", :scale_in_cooldown => "scaleInCooldown", :scale_out_cooldown => "scaleOutCooldown", :target_value => "targetValue", :custom_metric => "customMetric", :predefined_metric => "predefinedMetric", :resource_label => "resourceLabel", } end |
Instance Method Details
#to_jsii ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'application_auto_scaling/basic_target_tracking_scaling_policy_props.rb', line 106 def to_jsii result = {} result.merge!(super) result.merge!({ "disableScaleIn" => @disable_scale_in, "policyName" => @policy_name, "scaleInCooldown" => @scale_in_cooldown, "scaleOutCooldown" => @scale_out_cooldown, "targetValue" => @target_value, "customMetric" => @custom_metric, "predefinedMetric" => @predefined_metric, "resourceLabel" => @resource_label, }) result.compact end |