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 scaling 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

The following example applies a target tracking scaling policy with a predefined metric specification to an Amazon ECS service called web-app in the default cluster. The policy keeps the average CPU utilization of the service at 75 percent, with scale-out and scale-in cooldown periods of 60 seconds.

To apply a target tracking scaling policy with a predefined metric specification


var client = new AmazonApplicationAutoScalingClient();
var response = client.PutScalingPolicy(new PutScalingPolicyRequest 
{
    PolicyName = "cpu75-target-tracking-scaling-policy",
    PolicyType = "TargetTrackingScaling",
    ResourceId = "service/default/web-app",
    ScalableDimension = "ecs:service:DesiredCount",
    ServiceNamespace = "ecs",
    TargetTrackingScalingPolicyConfiguration = new TargetTrackingScalingPolicyConfiguration {
        PredefinedMetricSpecification = new PredefinedMetricSpecification { PredefinedMetricType = "ECSServiceAverageCPUUtilization" },
        ScaleInCooldown = 60,
        ScaleOutCooldown = 60,
        TargetValue = 75
    }
});

List<Alarm> alarms = response.Alarms;
string policyARN = response.PolicyARN;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

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