BasicTargetTrackingScalingPolicyProps

class aws_cdk.aws_autoscaling.BasicTargetTrackingScalingPolicyProps(*, cooldown=None, disable_scale_in=None, estimated_instance_warmup=None, custom_metric=None, predefined_metric=None, resource_label=None, target_value)

Bases: aws_cdk.aws_autoscaling.BaseTargetTrackingProps

Properties for a Target Tracking policy that include the metric but exclude the target.

Parameters
  • cooldown (Optional[Duration]) – Period after a scaling completes before another scaling activity can start. Default: - The default cooldown configured on the AutoScalingGroup.

  • disable_scale_in (Optional[bool]) – 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 autoscaling group. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the group. Default: false

  • estimated_instance_warmup (Optional[Duration]) – Estimated time until a newly launched instance can send metrics to CloudWatch. Default: - Same as the cooldown.

  • custom_metric (Optional[IMetric]) – 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. Default: - No custom metric.

  • predefined_metric (Optional[PredefinedMetric]) – 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. Default: - No predefined metric.

  • resource_label (Optional[str]) – The resource label associated with the predefined metric. Should be supplied if the predefined metric is ALBRequestCountPerTarget, and the format should be: app///targetgroup// Default: - No resource label.

  • target_value (Union[int, float]) – The target value for the metric.

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling
import aws_cdk.aws_cloudwatch as cloudwatch
import aws_cdk.core as cdk

# metric is of type Metric

basic_target_tracking_scaling_policy_props = autoscaling.BasicTargetTrackingScalingPolicyProps(
    target_value=123,

    # the properties below are optional
    cooldown=cdk.Duration.minutes(30),
    custom_metric=metric,
    disable_scale_in=False,
    estimated_instance_warmup=cdk.Duration.minutes(30),
    predefined_metric=autoscaling.PredefinedMetric.ASG_AVERAGE_CPU_UTILIZATION,
    resource_label="resourceLabel"
)

Attributes

cooldown

Period after a scaling completes before another scaling activity can start.

Default
  • The default cooldown configured on the AutoScalingGroup.

Return type

Optional[Duration]

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.

Default
  • No custom metric.

Return type

Optional[IMetric]

disable_scale_in

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 autoscaling group. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the group.

Default

false

Return type

Optional[bool]

estimated_instance_warmup

Estimated time until a newly launched instance can send metrics to CloudWatch.

Default
  • Same as the cooldown.

Return type

Optional[Duration]

predefined_metric

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.

Default
  • No predefined metric.

Return type

Optional[PredefinedMetric]

resource_label

The resource label associated with the predefined metric.

Should be supplied if the predefined metric is ALBRequestCountPerTarget, and the format should be:

app///targetgroup//

Default
  • No resource label.

Return type

Optional[str]

target_value

The target value for the metric.

Return type

Union[int, float]