Class: AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::TargetTrackingMetricStatProperty

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

Overview

This structure defines the CloudWatch metric to return, along with the statistic and unit.

TargetTrackingMetricStat is a property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetricDataQuery property type.

For more information about the CloudWatch terminology below, 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: nil, stat: nil, unit: nil) ⇒ TargetTrackingMetricStatProperty

Returns a new instance of TargetTrackingMetricStatProperty.

Parameters:



1881
1882
1883
1884
1885
1886
1887
1888
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1881

def initialize(metric: nil, stat: nil, unit: nil)
  @metric = metric.is_a?(Hash) ? ::AWSCDK::ApplicationAutoScaling::CfnScalingPolicy::TargetTrackingMetricProperty.new(**metric.transform_keys(&:to_sym)) : metric
  Jsii::Type.check_type(@metric, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBsaWNhdGlvbmF1dG9zY2FsaW5nLkNmblNjYWxpbmdQb2xpY3kuVGFyZ2V0VHJhY2tpbmdNZXRyaWNQcm9wZXJ0eSJ9XX19")), "metric") unless @metric.nil?
  @stat = stat
  Jsii::Type.check_type(@stat, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stat") unless @stat.nil?
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit") unless @unit.nil?
end

Instance Attribute Details

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

The CloudWatch metric to return, including the metric name, namespace, and dimensions.

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



1896
1897
1898
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1896

def metric
  @metric
end

#statString? (readonly)

The statistic to return.

It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide .

The most commonly used metric for scaling is Average .



1905
1906
1907
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1905

def stat
  @stat
end

#unitString? (readonly)

The unit to use for the returned data points.

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



1912
1913
1914
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1912

def unit
  @unit
end

Class Method Details

.jsii_propertiesObject



1914
1915
1916
1917
1918
1919
1920
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1914

def self.jsii_properties
  {
    :metric => "metric",
    :stat => "stat",
    :unit => "unit",
  }
end

Instance Method Details

#to_jsiiObject



1922
1923
1924
1925
1926
1927
1928
1929
1930
# File 'application_auto_scaling/cfn_scaling_policy.rb', line 1922

def to_jsii
  result = {}
  result.merge!({
    "metric" => @metric,
    "stat" => @stat,
    "unit" => @unit,
  })
  result.compact
end