Adjusts the desired size of the AutoScalingGroup by initiating scaling activities. When reducing the size of the group, it is not possible to define which EC2 instances will be terminated. This applies to any Auto Scaling decisions that might result in terminating instances.
There are two common use cases for SetDesiredCapacity : one for users of the Auto Scaling triggering system, and another for developers who write their own triggering systems. Both use cases relate to the concept of cooldown.
In the first case, if you use the Auto Scaling triggering system, SetDesiredCapacity changes the size of your Auto Scaling group without regard to the cooldown period. This could be useful, for example, if Auto Scaling did something unexpected for some reason. If your cooldown period is 10 minutes, Auto Scaling would normally reject requests to change the size of the group for that entire 10 minute period. The SetDesiredCapacity command allows you to circumvent this restriction and change the size of the group before the end of the cooldown period.
In the second case, if you write your own triggering system, you can use SetDesiredCapacity to control the size of your Auto Scaling group. If you want the same cooldown functionality that Auto Scaling offers, you can configure SetDesiredCapacity to honor cooldown by setting the HonorCooldown parameter to true .
Assembly: AWSSDK (in AWSSDK.dll) Version: 1.4.10.0 (1.4.10.0)
Syntax
| C# | Visual Basic | Visual C++ |
public class SetDesiredCapacityRequest : AmazonWebServiceRequest
Public Class SetDesiredCapacityRequest _ Inherits AmazonWebServiceRequest
public ref class SetDesiredCapacityRequest : public AmazonWebServiceRequest
Members
| All Members | Constructors | Properties | Methods |
| Member | Description | |
|---|---|---|
| SetDesiredCapacityRequest()()()() | Initializes a new instance of the SetDesiredCapacityRequest class | |
| AutoScalingGroupName |
The name of the AutoScalingGroup.
Constraints: | |
| DesiredCapacity |
The new capacity setting for the AutoScalingGroup.
| |
| Equals(Object) | (Inherited from Object.) | |
| GetHashCode()()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetType()()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| HonorCooldown |
By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the
Auto Scaling group is in cooldown.
| |
| ToString()()()() | (Inherited from Object.) | |
| WithAutoScalingGroupName(String) |
Sets the AutoScalingGroupName property
| |
| WithDesiredCapacity(Int32) |
Sets the DesiredCapacity property
| |
| WithHonorCooldown(Boolean) |
Sets the HonorCooldown property
|
Inheritance Hierarchy
Amazon.Runtime..::..AmazonWebServiceRequest
Amazon.AutoScaling.Model..::..SetDesiredCapacityRequest