Class: AWSCDK::AutoScalingPlans::CfnScalingPlan::CustomizedScalingMetricSpecificationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
auto_scaling_plans/cfn_scaling_plan.rb

Overview

CustomizedScalingMetricSpecification is a subproperty of TargetTrackingConfiguration that specifies a customized scaling metric for a target tracking configuration to use with a scaling plan.

To create your customized scaling metric specification:

  • Add values for each required property from CloudWatch. You can use an existing metric, or a new metric that you create. To use your own metric, you must first publish the metric to CloudWatch. For more information, see Publish Custom Metrics in the Amazon CloudWatch User Guide .
  • Choose a metric that changes proportionally with capacity. The value of the metric should increase or decrease in inverse proportion to the number of capacity units. That is, the value of the metric should decrease when capacity increases.

For information about terminology, available metrics, or how to publish new metrics, see Amazon CloudWatch Concepts in the Amazon CloudWatch User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(metric_name:, namespace:, statistic:, dimensions: nil, unit: nil) ⇒ CustomizedScalingMetricSpecificationProperty

Returns a new instance of CustomizedScalingMetricSpecificationProperty.

Parameters:



683
684
685
686
687
688
689
690
691
692
693
694
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 683

def initialize(metric_name:, namespace:, statistic:, dimensions: nil, unit: nil)
  @metric_name = metric_name
  Jsii::Type.check_type(@metric_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "metricName")
  @namespace = namespace
  Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace")
  @statistic = statistic
  Jsii::Type.check_type(@statistic, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statistic")
  @dimensions = dimensions
  Jsii::Type.check_type(@dimensions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXV0b3NjYWxpbmdwbGFucy5DZm5TY2FsaW5nUGxhbi5NZXRyaWNEaW1lbnNpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "dimensions") unless @dimensions.nil?
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit") unless @unit.nil?
end

Instance Attribute Details

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

The dimensions of the metric.

Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy.



719
720
721
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 719

def dimensions
  @dimensions
end

#metric_nameString (readonly)

The name of the metric.

To get the exact metric name, namespace, and dimensions, inspect the Metrics object that is returned by a call to ListMetrics .



702
703
704
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 702

def metric_name
  @metric_name
end

#namespaceString (readonly)

The namespace of the metric.



707
708
709
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 707

def namespace
  @namespace
end

#statisticString (readonly)

The statistic of the metric.



712
713
714
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 712

def statistic
  @statistic
end

#unitString? (readonly)

The unit of the metric.

For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference .



726
727
728
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 726

def unit
  @unit
end

Class Method Details

.jsii_propertiesObject



728
729
730
731
732
733
734
735
736
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 728

def self.jsii_properties
  {
    :metric_name => "metricName",
    :namespace => "namespace",
    :statistic => "statistic",
    :dimensions => "dimensions",
    :unit => "unit",
  }
end

Instance Method Details

#to_jsiiObject



738
739
740
741
742
743
744
745
746
747
748
# File 'auto_scaling_plans/cfn_scaling_plan.rb', line 738

def to_jsii
  result = {}
  result.merge!({
    "metricName" => @metric_name,
    "namespace" => @namespace,
    "statistic" => @statistic,
    "dimensions" => @dimensions,
    "unit" => @unit,
  })
  result.compact
end