Class: AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingMetricSpecificationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
application_auto_scaling/cfn_scaling_policy.rb

Overview

This structure specifies the metrics and target utilization settings for a predictive scaling policy.

You must specify either a metric pair, or a load metric and a scaling metric individually. Specifying a metric pair instead of individual metrics provides a simpler way to configure metrics for a scaling policy. You choose the metric pair, and the policy automatically knows the correct sum and average statistics to use for the load metric and the scaling metric.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_value:, customized_capacity_metric_specification: nil, customized_load_metric_specification: nil, customized_scaling_metric_specification: nil, predefined_load_metric_specification: nil, predefined_metric_pair_specification: nil, predefined_scaling_metric_specification: nil) ⇒ PredictiveScalingMetricSpecificationProperty

Returns a new instance of PredictiveScalingMetricSpecificationProperty.

Parameters:



1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1115

def initialize(target_value:, customized_capacity_metric_specification: nil, customized_load_metric_specification: nil, customized_scaling_metric_specification: nil, predefined_load_metric_specification: nil, predefined_metric_pair_specification: nil, predefined_scaling_metric_specification: nil)
  @target_value = target_value
  Jsii::Type.check_type(@target_value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "targetValue")
  @customized_capacity_metric_specification = customized_capacity_metric_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingCustomizedCapacityMetricProperty.new(**customized_capacity_metric_specification.transform_keys(&:to_sym)) : customized_capacity_metric_specification
  Jsii::Type.check_type(@customized_capacity_metric_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdDdXN0b21pemVkQ2FwYWNpdHlNZXRyaWNQcm9wZXJ0eSJ9XX19")), "customizedCapacityMetricSpecification") unless @customized_capacity_metric_specification.nil?
  @customized_load_metric_specification = customized_load_metric_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingCustomizedLoadMetricProperty.new(**customized_load_metric_specification.transform_keys(&:to_sym)) : customized_load_metric_specification
  Jsii::Type.check_type(@customized_load_metric_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdDdXN0b21pemVkTG9hZE1ldHJpY1Byb3BlcnR5In1dfX0=")), "customizedLoadMetricSpecification") unless @customized_load_metric_specification.nil?
  @customized_scaling_metric_specification = customized_scaling_metric_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingCustomizedScalingMetricProperty.new(**customized_scaling_metric_specification.transform_keys(&:to_sym)) : customized_scaling_metric_specification
  Jsii::Type.check_type(@customized_scaling_metric_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdDdXN0b21pemVkU2NhbGluZ01ldHJpY1Byb3BlcnR5In1dfX0=")), "customizedScalingMetricSpecification") unless @customized_scaling_metric_specification.nil?
  @predefined_load_metric_specification = predefined_load_metric_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingPredefinedLoadMetricProperty.new(**predefined_load_metric_specification.transform_keys(&:to_sym)) : predefined_load_metric_specification
  Jsii::Type.check_type(@predefined_load_metric_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdQcmVkZWZpbmVkTG9hZE1ldHJpY1Byb3BlcnR5In1dfX0=")), "predefinedLoadMetricSpecification") unless @predefined_load_metric_specification.nil?
  @predefined_metric_pair_specification = predefined_metric_pair_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingPredefinedMetricPairProperty.new(**predefined_metric_pair_specification.transform_keys(&:to_sym)) : predefined_metric_pair_specification
  Jsii::Type.check_type(@predefined_metric_pair_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdQcmVkZWZpbmVkTWV0cmljUGFpclByb3BlcnR5In1dfX0=")), "predefinedMetricPairSpecification") unless @predefined_metric_pair_specification.nil?
  @predefined_scaling_metric_specification = predefined_scaling_metric_specification.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::PredictiveScalingPredefinedScalingMetricProperty.new(**predefined_scaling_metric_specification.transform_keys(&:to_sym)) : predefined_scaling_metric_specification
  Jsii::Type.check_type(@predefined_scaling_metric_specification, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuUHJlZGljdGl2ZVNjYWxpbmdQcmVkZWZpbmVkU2NhbGluZ01ldHJpY1Byb3BlcnR5In1dfX0=")), "predefinedScalingMetricSpecification") unless @predefined_scaling_metric_specification.nil?
end

Instance Attribute Details

#customized_capacity_metric_specificationAWSCDK::IResolvable, ... (readonly)

The customized capacity metric specification.



1141
1142
1143
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1141

def customized_capacity_metric_specification
  @customized_capacity_metric_specification
end

#customized_load_metric_specificationAWSCDK::IResolvable, ... (readonly)

The customized load metric specification.



1146
1147
1148
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1146

def customized_load_metric_specification
  @customized_load_metric_specification
end

#customized_scaling_metric_specificationAWSCDK::IResolvable, ... (readonly)

The customized scaling metric specification.



1151
1152
1153
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1151

def customized_scaling_metric_specification
  @customized_scaling_metric_specification
end

#predefined_load_metric_specificationAWSCDK::IResolvable, ... (readonly)

The predefined load metric specification.



1156
1157
1158
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1156

def predefined_load_metric_specification
  @predefined_load_metric_specification
end

#predefined_metric_pair_specificationAWSCDK::IResolvable, ... (readonly)

The predefined metric pair specification that determines the appropriate scaling metric and load metric to use.



1161
1162
1163
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1161

def predefined_metric_pair_specification
  @predefined_metric_pair_specification
end

#predefined_scaling_metric_specificationAWSCDK::IResolvable, ... (readonly)

The predefined scaling metric specification.



1166
1167
1168
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1166

def predefined_scaling_metric_specification
  @predefined_scaling_metric_specification
end

#target_valueNumeric (readonly)

Specifies the target utilization.



1136
1137
1138
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1136

def target_value
  @target_value
end

Class Method Details

.jsii_propertiesObject



1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1168

def self.jsii_properties
  {
    :target_value => "targetValue",
    :customized_capacity_metric_specification => "customizedCapacityMetricSpecification",
    :customized_load_metric_specification => "customizedLoadMetricSpecification",
    :customized_scaling_metric_specification => "customizedScalingMetricSpecification",
    :predefined_load_metric_specification => "predefinedLoadMetricSpecification",
    :predefined_metric_pair_specification => "predefinedMetricPairSpecification",
    :predefined_scaling_metric_specification => "predefinedScalingMetricSpecification",
  }
end

Instance Method Details

#to_jsiiObject



1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1180

def to_jsii
  result = {}
  result.merge!({
    "targetValue" => @target_value,
    "customizedCapacityMetricSpecification" => @customized_capacity_metric_specification,
    "customizedLoadMetricSpecification" => @customized_load_metric_specification,
    "customizedScalingMetricSpecification" => @customized_scaling_metric_specification,
    "predefinedLoadMetricSpecification" => @predefined_load_metric_specification,
    "predefinedMetricPairSpecification" => @predefined_metric_pair_specification,
    "predefinedScalingMetricSpecification" => @predefined_scaling_metric_specification,
  })
  result.compact
end