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.
Namespace: Amazon.ApplicationAutoScaling.Model
Assembly: AWSSDK.ApplicationAutoScaling.dll
Version: 3.x.y.z
public class PutScalingPolicyResponse : AmazonWebServiceResponse
The PutScalingPolicyResponse type exposes the following members
Name | Description | |
---|---|---|
![]() |
PutScalingPolicyResponse() |
Name | Type | Description | |
---|---|---|---|
![]() |
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. |
![]() |
ContentLength | System.Int64 | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
HttpStatusCode | System.Net.HttpStatusCode | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
![]() |
PolicyARN | System.String |
Gets and sets the property PolicyARN. The Amazon Resource Name (ARN) of the resulting scaling policy. |
![]() |
ResponseMetadata | Amazon.Runtime.ResponseMetadata | Inherited from Amazon.Runtime.AmazonWebServiceResponse. |
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.
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;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5