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.

Updates the configuration for the specified Auto Scaling group.

The new settings take effect on any scaling activities after this call returns. Scaling activities that are currently in progress aren't affected.

To update an Auto Scaling group with a launch configuration with InstanceMonitoring set to false, you must first disable the collection of group metrics. Otherwise, you will get an error. If you have previously enabled the collection of group metrics, you can disable it using DisableMetricsCollection.

Note the following:

Note:

For PCL this operation is only available in asynchronous form. Please refer to UpdateAutoScalingGroupAsync.

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

Syntax

C#
public abstract UpdateAutoScalingGroupResponse UpdateAutoScalingGroup(
         UpdateAutoScalingGroupRequest request
)
Parameters
request
Type: Amazon.AutoScaling.Model.UpdateAutoScalingGroupRequest

Container for the necessary parameters to execute the UpdateAutoScalingGroup service method.

Return Value
The response from the UpdateAutoScalingGroup service method, as returned by AutoScaling.

Exceptions

ExceptionCondition
ResourceContentionException You already have a pending update to an Auto Scaling resource (for example, a group, instance, or load balancer).
ScalingActivityInProgressException The operation can't be performed because there are scaling activities in progress.

Examples

This example updates the launch configuration of the specified Auto Scaling group.

To update the launch configuration


var response = client.UpdateAutoScalingGroup(new UpdateAutoScalingGroupRequest 
{
    AutoScalingGroupName = "my-auto-scaling-group",
    LaunchConfigurationName = "new-launch-config"
});


            

This example updates the minimum size and maximum size of the specified Auto Scaling group.

To update the minimum and maximum size


var response = client.UpdateAutoScalingGroup(new UpdateAutoScalingGroupRequest 
{
    AutoScalingGroupName = "my-auto-scaling-group",
    MaxSize = 3,
    MinSize = 1
});


            

This example enables instance protection for the specified Auto Scaling group.

To enable instance protection


var response = client.UpdateAutoScalingGroup(new UpdateAutoScalingGroupRequest 
{
    AutoScalingGroupName = "my-auto-scaling-group",
    NewInstancesProtectedFromScaleIn = true
});


            

Version Information

.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

See Also