// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`PutScalingPolicy`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`auto_scaling_group_name(impl Into<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::auto_scaling_group_name) / [`set_auto_scaling_group_name(Option<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_auto_scaling_group_name):<br>required: **true**<br><p>The name of the Auto Scaling group.</p><br>
/// - [`policy_name(impl Into<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::policy_name) / [`set_policy_name(Option<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_policy_name):<br>required: **true**<br><p>The name of the policy.</p><br>
/// - [`policy_type(impl Into<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::policy_type) / [`set_policy_type(Option<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_policy_type):<br>required: **false**<br><p>One of the following policy types:</p> <ul> <li> <p><code>TargetTrackingScaling</code></p></li> <li> <p><code>StepScaling</code></p></li> <li> <p><code>SimpleScaling</code> (default)</p></li> <li> <p><code>PredictiveScaling</code></p></li> </ul><br>
/// - [`adjustment_type(impl Into<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::adjustment_type) / [`set_adjustment_type(Option<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_adjustment_type):<br>required: **false**<br><p>Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are <code>ChangeInCapacity</code>, <code>ExactCapacity</code>, and <code>PercentChangeInCapacity</code>.</p> <p>Required if the policy type is <code>StepScaling</code> or <code>SimpleScaling</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment">Scaling adjustment types</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p><br>
/// - [`min_adjustment_step(i32)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::min_adjustment_step) / [`set_min_adjustment_step(Option<i32>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_min_adjustment_step):<br>required: **false**<br><p>Available for backward compatibility. Use <code>MinAdjustmentMagnitude</code> instead.</p><br>
/// - [`min_adjustment_magnitude(i32)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::min_adjustment_magnitude) / [`set_min_adjustment_magnitude(Option<i32>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_min_adjustment_magnitude):<br>required: **false**<br><p>The minimum value to scale by when the adjustment type is <code>PercentChangeInCapacity</code>. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a <code>MinAdjustmentMagnitude</code> of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a <code>MinAdjustmentMagnitude</code> of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.</p> <p>Valid only if the policy type is <code>StepScaling</code> or <code>SimpleScaling</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment">Scaling adjustment types</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p><note> <p>Some Auto Scaling groups use instance weights. In this case, set the <code>MinAdjustmentMagnitude</code> to a value that is at least as large as your largest instance weight.</p> </note><br>
/// - [`scaling_adjustment(i32)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::scaling_adjustment) / [`set_scaling_adjustment(Option<i32>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_scaling_adjustment):<br>required: **false**<br><p>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. For exact capacity, you must specify a non-negative value.</p> <p>Required if the policy type is <code>SimpleScaling</code>. (Not used with any other policy type.)</p><br>
/// - [`cooldown(i32)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::cooldown) / [`set_cooldown(Option<i32>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_cooldown):<br>required: **false**<br><p>A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is specified here, it overrides the default cooldown.</p> <p>Valid only if the policy type is <code>SimpleScaling</code>. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html">Scaling cooldowns for Amazon EC2 Auto Scaling</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p> <p>Default: None</p><br>
/// - [`metric_aggregation_type(impl Into<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::metric_aggregation_type) / [`set_metric_aggregation_type(Option<String>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_metric_aggregation_type):<br>required: **false**<br><p>The aggregation type for the CloudWatch metrics. The valid values are <code>Minimum</code>, <code>Maximum</code>, and <code>Average</code>. If the aggregation type is null, the value is treated as <code>Average</code>.</p> <p>Valid only if the policy type is <code>StepScaling</code>.</p><br>
/// - [`step_adjustments(StepAdjustment)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::step_adjustments) / [`set_step_adjustments(Option<Vec::<StepAdjustment>>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_step_adjustments):<br>required: **false**<br><p>A set of adjustments that enable you to scale based on the size of the alarm breach.</p> <p>Required if the policy type is <code>StepScaling</code>. (Not used with any other policy type.)</p><br>
/// - [`estimated_instance_warmup(i32)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::estimated_instance_warmup) / [`set_estimated_instance_warmup(Option<i32>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_estimated_instance_warmup):<br>required: **false**<br><p><i>Not needed if the default instance warmup is defined for the group.</i></p> <p>The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a warm-up period is specified here, it overrides the default instance warmup.</p> <p>Valid only if the policy type is <code>TargetTrackingScaling</code> or <code>StepScaling</code>.</p><note> <p>The default is to use the value for the default instance warmup defined for the group. If default instance warmup is null, then <code>EstimatedInstanceWarmup</code> falls back to the value of default cooldown.</p> </note><br>
/// - [`target_tracking_configuration(TargetTrackingConfiguration)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::target_tracking_configuration) / [`set_target_tracking_configuration(Option<TargetTrackingConfiguration>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_target_tracking_configuration):<br>required: **false**<br><p>A target tracking scaling policy. Provides support for predefined or custom metrics.</p> <p>The following predefined metrics are available:</p> <ul> <li> <p><code>ASGAverageCPUUtilization</code></p></li> <li> <p><code>ASGAverageNetworkIn</code></p></li> <li> <p><code>ASGAverageNetworkOut</code></p></li> <li> <p><code>ALBRequestCountPerTarget</code></p></li> </ul> <p>If you specify <code>ALBRequestCountPerTarget</code> for the metric, you must specify the <code>ResourceLabel</code> property with the <code>PredefinedMetricSpecification</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_TargetTrackingConfiguration.html">TargetTrackingConfiguration</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p> <p>Required if the policy type is <code>TargetTrackingScaling</code>.</p><br>
/// - [`enabled(bool)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::enabled) / [`set_enabled(Option<bool>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_enabled):<br>required: **false**<br><p>Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enable-disable-scaling-policy.html">Disabling a scaling policy for an Auto Scaling group</a> in the <i>Amazon EC2 Auto Scaling User Guide</i>.</p><br>
/// - [`predictive_scaling_configuration(PredictiveScalingConfiguration)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::predictive_scaling_configuration) / [`set_predictive_scaling_configuration(Option<PredictiveScalingConfiguration>)`](crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::set_predictive_scaling_configuration):<br>required: **false**<br><p>A predictive scaling policy. Provides support for predefined and custom metrics.</p> <p>Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_PredictiveScalingConfiguration.html">PredictiveScalingConfiguration</a> in the <i>Amazon EC2 Auto Scaling API Reference</i>.</p> <p>Required if the policy type is <code>PredictiveScaling</code>.</p><br>
/// - On success, responds with [`PutScalingPolicyOutput`](crate::operation::put_scaling_policy::PutScalingPolicyOutput) with field(s):
/// - [`policy_arn(Option<String>)`](crate::operation::put_scaling_policy::PutScalingPolicyOutput::policy_arn): <p>The Amazon Resource Name (ARN) of the policy.</p>
/// - [`alarms(Option<Vec::<Alarm>>)`](crate::operation::put_scaling_policy::PutScalingPolicyOutput::alarms): <p>The CloudWatch alarms created for the target tracking scaling policy.</p>
/// - On failure, responds with [`SdkError<PutScalingPolicyError>`](crate::operation::put_scaling_policy::PutScalingPolicyError)
pub fn put_scaling_policy(&self) -> crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder {
crate::operation::put_scaling_policy::builders::PutScalingPolicyFluentBuilder::new(self.handle.clone())
}
}