AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the PutScalingPolicy operation. Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameters you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.

If you exceed your maximum limit of step adjustments, which by default is 20 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.AutoScaling.AmazonAutoScalingRequest
      Amazon.AutoScaling.Model.PutScalingPolicyRequest

Namespace: Amazon.AutoScaling.Model
Assembly: AWSSDK.AutoScaling.dll
Version: 3.x.y.z

Syntax

C#
public class PutScalingPolicyRequest : AmazonAutoScalingRequest
         IAmazonWebServiceRequest

The PutScalingPolicyRequest type exposes the following members

Constructors

NameDescription
Public Method PutScalingPolicyRequest()

Properties

NameTypeDescription
Public Property AdjustmentType System.String

Gets and sets the property AdjustmentType.

The adjustment type. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

This parameter is supported if the policy type is SimpleScaling or StepScaling.

For more information, see Dynamic Scaling in the Auto Scaling User Guide.

Public Property AutoScalingGroupName System.String

Gets and sets the property AutoScalingGroupName.

The name or ARN of the group.

Public Property Cooldown System.Int32

Gets and sets the property Cooldown.

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start. If this parameter is not specified, the default cooldown period for the group applies.

This parameter is supported if the policy type is SimpleScaling.

For more information, see Auto Scaling Cooldowns in the Auto Scaling User Guide.

Public Property EstimatedInstanceWarmup System.Int32

Gets and sets the property EstimatedInstanceWarmup.

The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. The default is to use the value specified for the default cooldown period for the group.

This parameter is supported if the policy type is StepScaling or TargetTrackingScaling.

Public Property MetricAggregationType System.String

Gets and sets the property MetricAggregationType.

The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average.

This parameter is supported if the policy type is StepScaling.

Public Property MinAdjustmentMagnitude System.Int32

Gets and sets the property MinAdjustmentMagnitude.

The minimum number of instances to scale. If the value of AdjustmentType is PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least this many instances. Otherwise, the error is ValidationError.

This parameter is supported if the policy type is SimpleScaling or StepScaling.

Public Property MinAdjustmentStep System.Int32

Gets and sets the property MinAdjustmentStep.

Available for backward compatibility. Use MinAdjustmentMagnitude instead.

Public Property PolicyName System.String

Gets and sets the property PolicyName.

The name of the policy.

Public Property PolicyType System.String

Gets and sets the property PolicyType.

The policy type. The valid values are SimpleScaling, StepScaling, and TargetTrackingScaling. If the policy type is null, the value is treated as SimpleScaling.

Public Property ScalingAdjustment System.Int32

Gets and sets the property 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.

This parameter is required if the policy type is SimpleScaling and not supported otherwise.

Public Property StepAdjustments System.Collections.Generic.List<Amazon.AutoScaling.Model.StepAdjustment>

Gets and sets the property StepAdjustments.

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

This parameter is required if the policy type is StepScaling and not supported otherwise.

Public Property TargetTrackingConfiguration Amazon.AutoScaling.Model.TargetTrackingConfiguration

Gets and sets the property TargetTrackingConfiguration.

A target tracking policy.

This parameter is required if the policy type is TargetTrackingScaling and not supported otherwise.

Examples

This example adds the specified policy to the specified Auto Scaling group.

To add a scaling policy to an Auto Scaling group


var response = client.PutScalingPolicy(new PutScalingPolicyRequest 
{
    AdjustmentType = "ChangeInCapacity",
    AutoScalingGroupName = "my-auto-scaling-group",
    PolicyName = "ScaleIn",
    ScalingAdjustment = -1
});

string policyARN = response.PolicyARN;

            

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms