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.

This is the response object from the PutScalingPolicy operation.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceResponse
    Amazon.ApplicationAutoScaling.Model.PutScalingPolicyResponse

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

Syntax

C#
public class PutScalingPolicyResponse : AmazonWebServiceResponse

The PutScalingPolicyResponse type exposes the following members

Constructors

NameDescription
Public Method PutScalingPolicyResponse()

Properties

NameTypeDescription
Public Property Alarms System.Collections.Generic.List<Amazon.ApplicationAutoScaling.Model.Alarm>

Gets and sets the property Alarms.

The CloudWatch alarms created for the target tracking policy.

Public Property ContentLength System.Int64 Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property HttpStatusCode System.Net.HttpStatusCode Inherited from Amazon.Runtime.AmazonWebServiceResponse.
Public Property PolicyARN System.String

Gets and sets the property PolicyARN.

The Amazon Resource Name (ARN) of the resulting scaling policy.

Public Property ResponseMetadata Amazon.Runtime.ResponseMetadata Inherited from Amazon.Runtime.AmazonWebServiceResponse.

Examples

This example applies a scaling policy to an Amazon ECS service called web-app in the default cluster. The policy increases the desired count of the service by 200%, with a cool down period of 60 seconds.

To apply a scaling policy to an Amazon ECS service


var response = client.PutScalingPolicy(new PutScalingPolicyRequest 
{
    PolicyName = "web-app-cpu-gt-75",
    PolicyType = "StepScaling",
    ResourceId = "service/default/web-app",
    ScalableDimension = "ecs:service:DesiredCount",
    ServiceNamespace = "ecs",
    StepScalingPolicyConfiguration = new StepScalingPolicyConfiguration {
        AdjustmentType = "PercentChangeInCapacity",
        Cooldown = 60,
        StepAdjustments = new List {
            new StepAdjustment {
                MetricIntervalLowerBound = 0,
                ScalingAdjustment = 200
            }
        }
    }
});

string policyARN = response.PolicyARN;

            

This example applies a scaling policy to an Amazon EC2 Spot fleet. The policy increases the target capacity of the spot fleet by 200%, with a cool down period of 180 seconds.",

To apply a scaling policy to an Amazon EC2 Spot fleet


var response = client.PutScalingPolicy(new PutScalingPolicyRequest 
{
    PolicyName = "fleet-cpu-gt-75",
    PolicyType = "StepScaling",
    ResourceId = "spot-fleet-request/sfr-45e69d8a-be48-4539-bbf3-3464e99c50c3",
    ScalableDimension = "ec2:spot-fleet-request:TargetCapacity",
    ServiceNamespace = "ec2",
    StepScalingPolicyConfiguration = new StepScalingPolicyConfiguration {
        AdjustmentType = "PercentChangeInCapacity",
        Cooldown = 180,
        StepAdjustments = new List {
            new StepAdjustment {
                MetricIntervalLowerBound = 0,
                ScalingAdjustment = 200
            }
        }
    }
});

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