TargetTrackingScalingPolicyProps

class aws_cdk.aws_applicationautoscaling.TargetTrackingScalingPolicyProps(*, disable_scale_in=None, policy_name=None, scale_in_cooldown=None, scale_out_cooldown=None, target_value, custom_metric=None, predefined_metric=None, resource_label=None, scaling_target)

Bases: aws_cdk.aws_applicationautoscaling.BasicTargetTrackingScalingPolicyProps

__init__(*, disable_scale_in=None, policy_name=None, scale_in_cooldown=None, scale_out_cooldown=None, target_value, custom_metric=None, predefined_metric=None, resource_label=None, scaling_target)

Properties for a concrete TargetTrackingPolicy.

Adds the scalingTarget.

Parameters
  • 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 scalable resource. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the scalable resource. Default: false

  • policy_name (Optional[str]) – A name for the scaling policy. Default: - Automatically generated name.

  • scale_in_cooldown (Optional[Duration]) – Period after a scale in activity completes before another scale in activity can start. Default: - No scale in cooldown.

  • scale_out_cooldown (Optional[Duration]) – Period after a scale out activity completes before another scale out activity can start. Default: - No scale out cooldown.

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

  • 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 metrics.

  • resource_label (Optional[str]) – Identify the resource associated with the metric type. Only used for predefined metric ALBRequestCountPerTarget. Default: - No resource label.

  • scaling_target (IScalableTarget) –

Attributes

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

default :default: false

Return type

Optional[bool]

policy_name

A name for the scaling policy.

default :default: - Automatically generated name.

Return type

Optional[str]

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 :default: - No predefined metrics.

Return type

Optional[PredefinedMetric]

resource_label

Identify the resource associated with the metric type.

Only used for predefined metric ALBRequestCountPerTarget.

default :default: - No resource label.

Example:

# Example automatically generated. See https://github.com/aws/jsii/issues/826
app / <load-balancer - name > /<load-balancer-id>/targetgroup / <target-group - name > /<target-group-id>
Return type

Optional[str]

scale_in_cooldown

Period after a scale in activity completes before another scale in activity can start.

default :default: - No scale in cooldown.

Return type

Optional[Duration]

scale_out_cooldown

Period after a scale out activity completes before another scale out activity can start.

default :default: - No scale out cooldown.

Return type

Optional[Duration]

scaling_target
Return type

IScalableTarget

target_value

The target value for the metric.

Return type

Union[int, float]