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

Describes a scaling policy.

See Also:

AWS * API Reference

*/ class AWS_AUTOSCALING_API ScalingPolicy { public: ScalingPolicy(); ScalingPolicy(const Aws::Utils::Xml::XmlNode& xmlNode); ScalingPolicy& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

The name of the Auto Scaling group.

*/ inline const Aws::String& GetAutoScalingGroupName() const{ return m_autoScalingGroupName; } /** *

The name of the Auto Scaling group.

*/ inline bool AutoScalingGroupNameHasBeenSet() const { return m_autoScalingGroupNameHasBeenSet; } /** *

The name of the Auto Scaling group.

*/ inline void SetAutoScalingGroupName(const Aws::String& value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName = value; } /** *

The name of the Auto Scaling group.

*/ inline void SetAutoScalingGroupName(Aws::String&& value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName = std::move(value); } /** *

The name of the Auto Scaling group.

*/ inline void SetAutoScalingGroupName(const char* value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName.assign(value); } /** *

The name of the Auto Scaling group.

*/ inline ScalingPolicy& WithAutoScalingGroupName(const Aws::String& value) { SetAutoScalingGroupName(value); return *this;} /** *

The name of the Auto Scaling group.

*/ inline ScalingPolicy& WithAutoScalingGroupName(Aws::String&& value) { SetAutoScalingGroupName(std::move(value)); return *this;} /** *

The name of the Auto Scaling group.

*/ inline ScalingPolicy& WithAutoScalingGroupName(const char* value) { SetAutoScalingGroupName(value); return *this;} /** *

The name of the scaling policy.

*/ inline const Aws::String& GetPolicyName() const{ return m_policyName; } /** *

The name of the scaling policy.

*/ inline bool PolicyNameHasBeenSet() const { return m_policyNameHasBeenSet; } /** *

The name of the scaling policy.

*/ inline void SetPolicyName(const Aws::String& value) { m_policyNameHasBeenSet = true; m_policyName = value; } /** *

The name of the scaling policy.

*/ inline void SetPolicyName(Aws::String&& value) { m_policyNameHasBeenSet = true; m_policyName = std::move(value); } /** *

The name of the scaling policy.

*/ inline void SetPolicyName(const char* value) { m_policyNameHasBeenSet = true; m_policyName.assign(value); } /** *

The name of the scaling policy.

*/ inline ScalingPolicy& WithPolicyName(const Aws::String& value) { SetPolicyName(value); return *this;} /** *

The name of the scaling policy.

*/ inline ScalingPolicy& WithPolicyName(Aws::String&& value) { SetPolicyName(std::move(value)); return *this;} /** *

The name of the scaling policy.

*/ inline ScalingPolicy& WithPolicyName(const char* value) { SetPolicyName(value); return *this;} /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline const Aws::String& GetPolicyARN() const{ return m_policyARN; } /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline bool PolicyARNHasBeenSet() const { return m_policyARNHasBeenSet; } /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline void SetPolicyARN(const Aws::String& value) { m_policyARNHasBeenSet = true; m_policyARN = value; } /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline void SetPolicyARN(Aws::String&& value) { m_policyARNHasBeenSet = true; m_policyARN = std::move(value); } /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline void SetPolicyARN(const char* value) { m_policyARNHasBeenSet = true; m_policyARN.assign(value); } /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline ScalingPolicy& WithPolicyARN(const Aws::String& value) { SetPolicyARN(value); return *this;} /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline ScalingPolicy& WithPolicyARN(Aws::String&& value) { SetPolicyARN(std::move(value)); return *this;} /** *

The Amazon Resource Name (ARN) of the policy.

*/ inline ScalingPolicy& WithPolicyARN(const char* value) { SetPolicyARN(value); return *this;} /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline const Aws::String& GetPolicyType() const{ return m_policyType; } /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline bool PolicyTypeHasBeenSet() const { return m_policyTypeHasBeenSet; } /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline void SetPolicyType(const Aws::String& value) { m_policyTypeHasBeenSet = true; m_policyType = value; } /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline void SetPolicyType(Aws::String&& value) { m_policyTypeHasBeenSet = true; m_policyType = std::move(value); } /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline void SetPolicyType(const char* value) { m_policyTypeHasBeenSet = true; m_policyType.assign(value); } /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline ScalingPolicy& WithPolicyType(const Aws::String& value) { SetPolicyType(value); return *this;} /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline ScalingPolicy& WithPolicyType(Aws::String&& value) { SetPolicyType(std::move(value)); return *this;} /** *

One of the following policy types:

  • * TargetTrackingScaling

  • StepScaling *

  • SimpleScaling (default)

For * more information, see Target * Tracking Scaling Policies and Step * and Simple Scaling Policies in the Amazon EC2 Auto Scaling User * Guide.

*/ inline ScalingPolicy& WithPolicyType(const char* value) { SetPolicyType(value); return *this;} /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline const Aws::String& GetAdjustmentType() const{ return m_adjustmentType; } /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline bool AdjustmentTypeHasBeenSet() const { return m_adjustmentTypeHasBeenSet; } /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline void SetAdjustmentType(const Aws::String& value) { m_adjustmentTypeHasBeenSet = true; m_adjustmentType = value; } /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline void SetAdjustmentType(Aws::String&& value) { m_adjustmentTypeHasBeenSet = true; m_adjustmentType = std::move(value); } /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline void SetAdjustmentType(const char* value) { m_adjustmentTypeHasBeenSet = true; m_adjustmentType.assign(value); } /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline ScalingPolicy& WithAdjustmentType(const Aws::String& value) { SetAdjustmentType(value); return *this;} /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline ScalingPolicy& WithAdjustmentType(Aws::String&& value) { SetAdjustmentType(std::move(value)); return *this;} /** *

Specifies how the scaling adjustment is interpreted (for example, an absolute * number or a percentage). The valid values are ChangeInCapacity, * ExactCapacity, and PercentChangeInCapacity.

*/ inline ScalingPolicy& WithAdjustmentType(const char* value) { SetAdjustmentType(value); return *this;} /** *

Available for backward compatibility. Use MinAdjustmentMagnitude * instead.

*/ inline int GetMinAdjustmentStep() const{ return m_minAdjustmentStep; } /** *

Available for backward compatibility. Use MinAdjustmentMagnitude * instead.

*/ inline bool MinAdjustmentStepHasBeenSet() const { return m_minAdjustmentStepHasBeenSet; } /** *

Available for backward compatibility. Use MinAdjustmentMagnitude * instead.

*/ inline void SetMinAdjustmentStep(int value) { m_minAdjustmentStepHasBeenSet = true; m_minAdjustmentStep = value; } /** *

Available for backward compatibility. Use MinAdjustmentMagnitude * instead.

*/ inline ScalingPolicy& WithMinAdjustmentStep(int value) { SetMinAdjustmentStep(value); return *this;} /** *

The minimum value to scale by when the adjustment type is * PercentChangeInCapacity.

*/ inline int GetMinAdjustmentMagnitude() const{ return m_minAdjustmentMagnitude; } /** *

The minimum value to scale by when the adjustment type is * PercentChangeInCapacity.

*/ inline bool MinAdjustmentMagnitudeHasBeenSet() const { return m_minAdjustmentMagnitudeHasBeenSet; } /** *

The minimum value to scale by when the adjustment type is * PercentChangeInCapacity.

*/ inline void SetMinAdjustmentMagnitude(int value) { m_minAdjustmentMagnitudeHasBeenSet = true; m_minAdjustmentMagnitude = value; } /** *

The minimum value to scale by when the adjustment type is * PercentChangeInCapacity.

*/ inline ScalingPolicy& WithMinAdjustmentMagnitude(int value) { SetMinAdjustmentMagnitude(value); return *this;} /** *

The amount by which to scale, based on the specified adjustment type. A * positive value adds to the current capacity while a negative number removes from * the current capacity.

*/ inline int GetScalingAdjustment() const{ return m_scalingAdjustment; } /** *

The amount by which to scale, based on the specified adjustment type. A * positive value adds to the current capacity while a negative number removes from * the current capacity.

*/ inline bool ScalingAdjustmentHasBeenSet() const { return m_scalingAdjustmentHasBeenSet; } /** *

The amount by which to scale, based on the specified adjustment type. A * positive value adds to the current capacity while a negative number removes from * the current capacity.

*/ inline void SetScalingAdjustment(int value) { m_scalingAdjustmentHasBeenSet = true; m_scalingAdjustment = value; } /** *

The amount by which to scale, based on the specified adjustment type. A * positive value adds to the current capacity while a negative number removes from * the current capacity.

*/ inline ScalingPolicy& WithScalingAdjustment(int value) { SetScalingAdjustment(value); return *this;} /** *

The duration of the policy's cooldown period, in seconds.

*/ inline int GetCooldown() const{ return m_cooldown; } /** *

The duration of the policy's cooldown period, in seconds.

*/ inline bool CooldownHasBeenSet() const { return m_cooldownHasBeenSet; } /** *

The duration of the policy's cooldown period, in seconds.

*/ inline void SetCooldown(int value) { m_cooldownHasBeenSet = true; m_cooldown = value; } /** *

The duration of the policy's cooldown period, in seconds.

*/ inline ScalingPolicy& WithCooldown(int value) { SetCooldown(value); return *this;} /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline const Aws::Vector& GetStepAdjustments() const{ return m_stepAdjustments; } /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline bool StepAdjustmentsHasBeenSet() const { return m_stepAdjustmentsHasBeenSet; } /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline void SetStepAdjustments(const Aws::Vector& value) { m_stepAdjustmentsHasBeenSet = true; m_stepAdjustments = value; } /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline void SetStepAdjustments(Aws::Vector&& value) { m_stepAdjustmentsHasBeenSet = true; m_stepAdjustments = std::move(value); } /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline ScalingPolicy& WithStepAdjustments(const Aws::Vector& value) { SetStepAdjustments(value); return *this;} /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline ScalingPolicy& WithStepAdjustments(Aws::Vector&& value) { SetStepAdjustments(std::move(value)); return *this;} /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline ScalingPolicy& AddStepAdjustments(const StepAdjustment& value) { m_stepAdjustmentsHasBeenSet = true; m_stepAdjustments.push_back(value); return *this; } /** *

A set of adjustments that enable you to scale based on the size of the alarm * breach.

*/ inline ScalingPolicy& AddStepAdjustments(StepAdjustment&& value) { m_stepAdjustmentsHasBeenSet = true; m_stepAdjustments.push_back(std::move(value)); return *this; } /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline const Aws::String& GetMetricAggregationType() const{ return m_metricAggregationType; } /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline bool MetricAggregationTypeHasBeenSet() const { return m_metricAggregationTypeHasBeenSet; } /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline void SetMetricAggregationType(const Aws::String& value) { m_metricAggregationTypeHasBeenSet = true; m_metricAggregationType = value; } /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline void SetMetricAggregationType(Aws::String&& value) { m_metricAggregationTypeHasBeenSet = true; m_metricAggregationType = std::move(value); } /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline void SetMetricAggregationType(const char* value) { m_metricAggregationTypeHasBeenSet = true; m_metricAggregationType.assign(value); } /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline ScalingPolicy& WithMetricAggregationType(const Aws::String& value) { SetMetricAggregationType(value); return *this;} /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline ScalingPolicy& WithMetricAggregationType(Aws::String&& value) { SetMetricAggregationType(std::move(value)); return *this;} /** *

The aggregation type for the CloudWatch metrics. The valid values are * Minimum, Maximum, and Average.

*/ inline ScalingPolicy& WithMetricAggregationType(const char* value) { SetMetricAggregationType(value); return *this;} /** *

The estimated time, in seconds, until a newly launched instance can * contribute to the CloudWatch metrics.

*/ inline int GetEstimatedInstanceWarmup() const{ return m_estimatedInstanceWarmup; } /** *

The estimated time, in seconds, until a newly launched instance can * contribute to the CloudWatch metrics.

*/ inline bool EstimatedInstanceWarmupHasBeenSet() const { return m_estimatedInstanceWarmupHasBeenSet; } /** *

The estimated time, in seconds, until a newly launched instance can * contribute to the CloudWatch metrics.

*/ inline void SetEstimatedInstanceWarmup(int value) { m_estimatedInstanceWarmupHasBeenSet = true; m_estimatedInstanceWarmup = value; } /** *

The estimated time, in seconds, until a newly launched instance can * contribute to the CloudWatch metrics.

*/ inline ScalingPolicy& WithEstimatedInstanceWarmup(int value) { SetEstimatedInstanceWarmup(value); return *this;} /** *

The CloudWatch alarms related to the policy.

*/ inline const Aws::Vector& GetAlarms() const{ return m_alarms; } /** *

The CloudWatch alarms related to the policy.

*/ inline bool AlarmsHasBeenSet() const { return m_alarmsHasBeenSet; } /** *

The CloudWatch alarms related to the policy.

*/ inline void SetAlarms(const Aws::Vector& value) { m_alarmsHasBeenSet = true; m_alarms = value; } /** *

The CloudWatch alarms related to the policy.

*/ inline void SetAlarms(Aws::Vector&& value) { m_alarmsHasBeenSet = true; m_alarms = std::move(value); } /** *

The CloudWatch alarms related to the policy.

*/ inline ScalingPolicy& WithAlarms(const Aws::Vector& value) { SetAlarms(value); return *this;} /** *

The CloudWatch alarms related to the policy.

*/ inline ScalingPolicy& WithAlarms(Aws::Vector&& value) { SetAlarms(std::move(value)); return *this;} /** *

The CloudWatch alarms related to the policy.

*/ inline ScalingPolicy& AddAlarms(const Alarm& value) { m_alarmsHasBeenSet = true; m_alarms.push_back(value); return *this; } /** *

The CloudWatch alarms related to the policy.

*/ inline ScalingPolicy& AddAlarms(Alarm&& value) { m_alarmsHasBeenSet = true; m_alarms.push_back(std::move(value)); return *this; } /** *

A target tracking scaling policy.

*/ inline const TargetTrackingConfiguration& GetTargetTrackingConfiguration() const{ return m_targetTrackingConfiguration; } /** *

A target tracking scaling policy.

*/ inline bool TargetTrackingConfigurationHasBeenSet() const { return m_targetTrackingConfigurationHasBeenSet; } /** *

A target tracking scaling policy.

*/ inline void SetTargetTrackingConfiguration(const TargetTrackingConfiguration& value) { m_targetTrackingConfigurationHasBeenSet = true; m_targetTrackingConfiguration = value; } /** *

A target tracking scaling policy.

*/ inline void SetTargetTrackingConfiguration(TargetTrackingConfiguration&& value) { m_targetTrackingConfigurationHasBeenSet = true; m_targetTrackingConfiguration = std::move(value); } /** *

A target tracking scaling policy.

*/ inline ScalingPolicy& WithTargetTrackingConfiguration(const TargetTrackingConfiguration& value) { SetTargetTrackingConfiguration(value); return *this;} /** *

A target tracking scaling policy.

*/ inline ScalingPolicy& WithTargetTrackingConfiguration(TargetTrackingConfiguration&& value) { SetTargetTrackingConfiguration(std::move(value)); return *this;} /** *

Indicates whether the policy is enabled (true) or disabled * (false).

*/ inline bool GetEnabled() const{ return m_enabled; } /** *

Indicates whether the policy is enabled (true) or disabled * (false).

*/ inline bool EnabledHasBeenSet() const { return m_enabledHasBeenSet; } /** *

Indicates whether the policy is enabled (true) or disabled * (false).

*/ inline void SetEnabled(bool value) { m_enabledHasBeenSet = true; m_enabled = value; } /** *

Indicates whether the policy is enabled (true) or disabled * (false).

*/ inline ScalingPolicy& WithEnabled(bool value) { SetEnabled(value); return *this;} private: Aws::String m_autoScalingGroupName; bool m_autoScalingGroupNameHasBeenSet; Aws::String m_policyName; bool m_policyNameHasBeenSet; Aws::String m_policyARN; bool m_policyARNHasBeenSet; Aws::String m_policyType; bool m_policyTypeHasBeenSet; Aws::String m_adjustmentType; bool m_adjustmentTypeHasBeenSet; int m_minAdjustmentStep; bool m_minAdjustmentStepHasBeenSet; int m_minAdjustmentMagnitude; bool m_minAdjustmentMagnitudeHasBeenSet; int m_scalingAdjustment; bool m_scalingAdjustmentHasBeenSet; int m_cooldown; bool m_cooldownHasBeenSet; Aws::Vector m_stepAdjustments; bool m_stepAdjustmentsHasBeenSet; Aws::String m_metricAggregationType; bool m_metricAggregationTypeHasBeenSet; int m_estimatedInstanceWarmup; bool m_estimatedInstanceWarmupHasBeenSet; Aws::Vector m_alarms; bool m_alarmsHasBeenSet; TargetTrackingConfiguration m_targetTrackingConfiguration; bool m_targetTrackingConfigurationHasBeenSet; bool m_enabled; bool m_enabledHasBeenSet; }; } // namespace Model } // namespace AutoScaling } // namespace Aws