/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ApplicationAutoScaling { namespace Model { /** *

Represents a target tracking scaling policy configuration to use with * Application Auto Scaling.

See Also:

AWS * API Reference

*/ class AWS_APPLICATIONAUTOSCALING_API TargetTrackingScalingPolicyConfiguration { public: TargetTrackingScalingPolicyConfiguration(); TargetTrackingScalingPolicyConfiguration(Aws::Utils::Json::JsonView jsonValue); TargetTrackingScalingPolicyConfiguration& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** *

The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 * (Base 10) or 2e-360 to 2e360 (Base 2).

*/ inline double GetTargetValue() const{ return m_targetValue; } /** *

The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 * (Base 10) or 2e-360 to 2e360 (Base 2).

*/ inline bool TargetValueHasBeenSet() const { return m_targetValueHasBeenSet; } /** *

The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 * (Base 10) or 2e-360 to 2e360 (Base 2).

*/ inline void SetTargetValue(double value) { m_targetValueHasBeenSet = true; m_targetValue = value; } /** *

The target value for the metric. The range is 8.515920e-109 to 1.174271e+108 * (Base 10) or 2e-360 to 2e360 (Base 2).

*/ inline TargetTrackingScalingPolicyConfiguration& WithTargetValue(double value) { SetTargetValue(value); return *this;} /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline const PredefinedMetricSpecification& GetPredefinedMetricSpecification() const{ return m_predefinedMetricSpecification; } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline bool PredefinedMetricSpecificationHasBeenSet() const { return m_predefinedMetricSpecificationHasBeenSet; } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetPredefinedMetricSpecification(const PredefinedMetricSpecification& value) { m_predefinedMetricSpecificationHasBeenSet = true; m_predefinedMetricSpecification = value; } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetPredefinedMetricSpecification(PredefinedMetricSpecification&& value) { m_predefinedMetricSpecificationHasBeenSet = true; m_predefinedMetricSpecification = std::move(value); } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithPredefinedMetricSpecification(const PredefinedMetricSpecification& value) { SetPredefinedMetricSpecification(value); return *this;} /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithPredefinedMetricSpecification(PredefinedMetricSpecification&& value) { SetPredefinedMetricSpecification(std::move(value)); return *this;} /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline const CustomizedMetricSpecification& GetCustomizedMetricSpecification() const{ return m_customizedMetricSpecification; } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline bool CustomizedMetricSpecificationHasBeenSet() const { return m_customizedMetricSpecificationHasBeenSet; } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetCustomizedMetricSpecification(const CustomizedMetricSpecification& value) { m_customizedMetricSpecificationHasBeenSet = true; m_customizedMetricSpecification = value; } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetCustomizedMetricSpecification(CustomizedMetricSpecification&& value) { m_customizedMetricSpecificationHasBeenSet = true; m_customizedMetricSpecification = std::move(value); } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithCustomizedMetricSpecification(const CustomizedMetricSpecification& value) { SetCustomizedMetricSpecification(value); return *this;} /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithCustomizedMetricSpecification(CustomizedMetricSpecification&& value) { SetCustomizedMetricSpecification(std::move(value)); return *this;} /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect.

With the scale-out cooldown period, the intention is * to continuously (but not excessively) scale out. After Application Auto Scaling * successfully scales out using a target tracking scaling policy, it starts to * calculate the cooldown time. While the scale-out cooldown period is in effect, * the capacity added by the initiating scale-out activity is calculated as part of * the desired capacity for the next scale-out activity.

Application Auto * Scaling provides a default value of 300 for the following scalable targets:

*
  • ECS services

  • Spot Fleet requests

  • *

    EMR clusters

  • AppStream 2.0 fleets

  • Aurora * DB clusters

  • Amazon SageMaker endpoint variants

  • *

    Custom resources

For all other scalable targets, the * default value is 0:

  • DynamoDB tables

  • DynamoDB * global secondary indexes

  • Amazon Comprehend document * classification endpoints

  • Lambda provisioned concurrency

    *
  • Amazon Keyspaces tables

*/ inline int GetScaleOutCooldown() const{ return m_scaleOutCooldown; } /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect.

With the scale-out cooldown period, the intention is * to continuously (but not excessively) scale out. After Application Auto Scaling * successfully scales out using a target tracking scaling policy, it starts to * calculate the cooldown time. While the scale-out cooldown period is in effect, * the capacity added by the initiating scale-out activity is calculated as part of * the desired capacity for the next scale-out activity.

Application Auto * Scaling provides a default value of 300 for the following scalable targets:

*
  • ECS services

  • Spot Fleet requests

  • *

    EMR clusters

  • AppStream 2.0 fleets

  • Aurora * DB clusters

  • Amazon SageMaker endpoint variants

  • *

    Custom resources

For all other scalable targets, the * default value is 0:

  • DynamoDB tables

  • DynamoDB * global secondary indexes

  • Amazon Comprehend document * classification endpoints

  • Lambda provisioned concurrency

    *
  • Amazon Keyspaces tables

*/ inline bool ScaleOutCooldownHasBeenSet() const { return m_scaleOutCooldownHasBeenSet; } /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect.

With the scale-out cooldown period, the intention is * to continuously (but not excessively) scale out. After Application Auto Scaling * successfully scales out using a target tracking scaling policy, it starts to * calculate the cooldown time. While the scale-out cooldown period is in effect, * the capacity added by the initiating scale-out activity is calculated as part of * the desired capacity for the next scale-out activity.

Application Auto * Scaling provides a default value of 300 for the following scalable targets:

*
  • ECS services

  • Spot Fleet requests

  • *

    EMR clusters

  • AppStream 2.0 fleets

  • Aurora * DB clusters

  • Amazon SageMaker endpoint variants

  • *

    Custom resources

For all other scalable targets, the * default value is 0:

  • DynamoDB tables

  • DynamoDB * global secondary indexes

  • Amazon Comprehend document * classification endpoints

  • Lambda provisioned concurrency

    *
  • Amazon Keyspaces tables

*/ inline void SetScaleOutCooldown(int value) { m_scaleOutCooldownHasBeenSet = true; m_scaleOutCooldown = value; } /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect.

With the scale-out cooldown period, the intention is * to continuously (but not excessively) scale out. After Application Auto Scaling * successfully scales out using a target tracking scaling policy, it starts to * calculate the cooldown time. While the scale-out cooldown period is in effect, * the capacity added by the initiating scale-out activity is calculated as part of * the desired capacity for the next scale-out activity.

Application Auto * Scaling provides a default value of 300 for the following scalable targets:

*
  • ECS services

  • Spot Fleet requests

  • *

    EMR clusters

  • AppStream 2.0 fleets

  • Aurora * DB clusters

  • Amazon SageMaker endpoint variants

  • *

    Custom resources

For all other scalable targets, the * default value is 0:

  • DynamoDB tables

  • DynamoDB * global secondary indexes

  • Amazon Comprehend document * classification endpoints

  • Lambda provisioned concurrency

    *
  • Amazon Keyspaces tables

*/ inline TargetTrackingScalingPolicyConfiguration& WithScaleOutCooldown(int value) { SetScaleOutCooldown(value); return *this;} /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start.

With the scale-in cooldown * period, the intention is to scale in conservatively to protect your * application’s availability, so scale-in activities are blocked until the * cooldown period has expired. However, if another alarm triggers a scale-out * activity during the scale-in cooldown period, Application Auto Scaling scales * out the target immediately. In this case, the scale-in cooldown period stops and * doesn't complete.

Application Auto Scaling provides a default value of * 300 for the following scalable targets:

  • ECS services

  • *
  • Spot Fleet requests

  • EMR clusters

  • *

    AppStream 2.0 fleets

  • Aurora DB clusters

  • *

    Amazon SageMaker endpoint variants

  • Custom resources

    *

For all other scalable targets, the default value is 0:

    *
  • DynamoDB tables

  • DynamoDB global secondary indexes

    *
  • Amazon Comprehend document classification endpoints

  • *

    Lambda provisioned concurrency

  • Amazon Keyspaces tables

    *
*/ inline int GetScaleInCooldown() const{ return m_scaleInCooldown; } /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start.

With the scale-in cooldown * period, the intention is to scale in conservatively to protect your * application’s availability, so scale-in activities are blocked until the * cooldown period has expired. However, if another alarm triggers a scale-out * activity during the scale-in cooldown period, Application Auto Scaling scales * out the target immediately. In this case, the scale-in cooldown period stops and * doesn't complete.

Application Auto Scaling provides a default value of * 300 for the following scalable targets:

  • ECS services

  • *
  • Spot Fleet requests

  • EMR clusters

  • *

    AppStream 2.0 fleets

  • Aurora DB clusters

  • *

    Amazon SageMaker endpoint variants

  • Custom resources

    *

For all other scalable targets, the default value is 0:

    *
  • DynamoDB tables

  • DynamoDB global secondary indexes

    *
  • Amazon Comprehend document classification endpoints

  • *

    Lambda provisioned concurrency

  • Amazon Keyspaces tables

    *
*/ inline bool ScaleInCooldownHasBeenSet() const { return m_scaleInCooldownHasBeenSet; } /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start.

With the scale-in cooldown * period, the intention is to scale in conservatively to protect your * application’s availability, so scale-in activities are blocked until the * cooldown period has expired. However, if another alarm triggers a scale-out * activity during the scale-in cooldown period, Application Auto Scaling scales * out the target immediately. In this case, the scale-in cooldown period stops and * doesn't complete.

Application Auto Scaling provides a default value of * 300 for the following scalable targets:

  • ECS services

  • *
  • Spot Fleet requests

  • EMR clusters

  • *

    AppStream 2.0 fleets

  • Aurora DB clusters

  • *

    Amazon SageMaker endpoint variants

  • Custom resources

    *

For all other scalable targets, the default value is 0:

    *
  • DynamoDB tables

  • DynamoDB global secondary indexes

    *
  • Amazon Comprehend document classification endpoints

  • *

    Lambda provisioned concurrency

  • Amazon Keyspaces tables

    *
*/ inline void SetScaleInCooldown(int value) { m_scaleInCooldownHasBeenSet = true; m_scaleInCooldown = value; } /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start.

With the scale-in cooldown * period, the intention is to scale in conservatively to protect your * application’s availability, so scale-in activities are blocked until the * cooldown period has expired. However, if another alarm triggers a scale-out * activity during the scale-in cooldown period, Application Auto Scaling scales * out the target immediately. In this case, the scale-in cooldown period stops and * doesn't complete.

Application Auto Scaling provides a default value of * 300 for the following scalable targets:

  • ECS services

  • *
  • Spot Fleet requests

  • EMR clusters

  • *

    AppStream 2.0 fleets

  • Aurora DB clusters

  • *

    Amazon SageMaker endpoint variants

  • Custom resources

    *

For all other scalable targets, the default value is 0:

    *
  • DynamoDB tables

  • DynamoDB global secondary indexes

    *
  • Amazon Comprehend document classification endpoints

  • *

    Lambda provisioned concurrency

  • Amazon Keyspaces tables

    *
*/ inline TargetTrackingScalingPolicyConfiguration& WithScaleInCooldown(int value) { SetScaleInCooldown(value); return *this;} /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline bool GetDisableScaleIn() const{ return m_disableScaleIn; } /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline bool DisableScaleInHasBeenSet() const { return m_disableScaleInHasBeenSet; } /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline void SetDisableScaleIn(bool value) { m_disableScaleInHasBeenSet = true; m_disableScaleIn = value; } /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline TargetTrackingScalingPolicyConfiguration& WithDisableScaleIn(bool value) { SetDisableScaleIn(value); return *this;} private: double m_targetValue; bool m_targetValueHasBeenSet; PredefinedMetricSpecification m_predefinedMetricSpecification; bool m_predefinedMetricSpecificationHasBeenSet; CustomizedMetricSpecification m_customizedMetricSpecification; bool m_customizedMetricSpecificationHasBeenSet; int m_scaleOutCooldown; bool m_scaleOutCooldownHasBeenSet; int m_scaleInCooldown; bool m_scaleInCooldownHasBeenSet; bool m_disableScaleIn; bool m_disableScaleInHasBeenSet; }; } // namespace Model } // namespace ApplicationAutoScaling } // namespace Aws