Class CfnScalingPolicy.MetricStatProperty.Builder
java.lang.Object
software.amazon.awscdk.services.autoscaling.CfnScalingPolicy.MetricStatProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnScalingPolicy.MetricStatProperty>
- Enclosing interface:
CfnScalingPolicy.MetricStatProperty
@Stability(Stable)
public static final class CfnScalingPolicy.MetricStatProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnScalingPolicy.MetricStatProperty>
A builder for
CfnScalingPolicy.MetricStatProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.metric
(IResolvable metric) Sets the value ofCfnScalingPolicy.MetricStatProperty.getMetric()
Sets the value ofCfnScalingPolicy.MetricStatProperty.getMetric()
Sets the value ofCfnScalingPolicy.MetricStatProperty.getStat()
Sets the value ofCfnScalingPolicy.MetricStatProperty.getUnit()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
metric
Sets the value ofCfnScalingPolicy.MetricStatProperty.getMetric()
- Parameters:
metric
- The CloudWatch metric to return, including the metric name, namespace, and dimensions. This parameter is required. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .- Returns:
this
-
metric
@Stability(Stable) public CfnScalingPolicy.MetricStatProperty.Builder metric(CfnScalingPolicy.MetricProperty metric) Sets the value ofCfnScalingPolicy.MetricStatProperty.getMetric()
- Parameters:
metric
- The CloudWatch metric to return, including the metric name, namespace, and dimensions. This parameter is required. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics .- Returns:
this
-
stat
Sets the value ofCfnScalingPolicy.MetricStatProperty.getStat()
- Parameters:
stat
- The statistic to return. This parameter is required. 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 metrics for predictive scaling are
Average
andSum
.- Returns:
this
-
unit
Sets the value ofCfnScalingPolicy.MetricStatProperty.getUnit()
- Parameters:
unit
- 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 .- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnScalingPolicy.MetricStatProperty>
- Returns:
- a new instance of
CfnScalingPolicy.MetricStatProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-