Menu
Auto Scaling
API Reference (API Version 2011-01-01)

UpdateAutoScalingGroup

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:

  • If you specify a new value for MinSize without specifying a value for DesiredCapacity, and the new MinSize is larger than the current size of the group, we implicitly call SetDesiredCapacity to set the size of the group to the new value of MinSize.

  • If you specify a new value for MaxSize without specifying a value for DesiredCapacity, and the new MaxSize is smaller than the current size of the group, we implicitly call SetDesiredCapacity to set the size of the group to the new value of MaxSize.

  • All other optional parameters are left unchanged if not specified.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

AutoScalingGroupName

The name of the Auto Scaling group.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: Yes

AvailabilityZones.member.N

One or more Availability Zones for the group.

Type: array of Strings

Array Members: Minimum number of 1 item.

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

DefaultCooldown

The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. The default is 300.

For more information, see Auto Scaling Cooldowns in the Auto Scaling User Guide.

Type: Integer

Required: No

DesiredCapacity

The number of EC2 instances that should be running in the Auto Scaling group. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.

Type: Integer

Required: No

HealthCheckGracePeriod

The amount of time, in seconds, that Auto Scaling waits before checking the health status of an EC2 instance that has come into service. The default is 0.

For more information, see Health Checks in the Auto Scaling User Guide.

Type: Integer

Required: No

HealthCheckType

The service to use for the health checks. The valid values are EC2 and ELB.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 32.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

LaunchConfigurationName

The name of the launch configuration.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1600.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

MaxSize

The maximum size of the Auto Scaling group.

Type: Integer

Required: No

MinSize

The minimum size of the Auto Scaling group.

Type: Integer

Required: No

NewInstancesProtectedFromScaleIn

Indicates whether newly launched instances are protected from termination by Auto Scaling when scaling in.

Type: Boolean

Required: No

PlacementGroup

The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups in the Amazon Elastic Compute Cloud User Guide.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

TerminationPolicies.member.N

A standalone termination policy or a list of termination policies used to select the instance to terminate. The policies are executed in the order that they are listed.

For more information, see Controlling Which Instances Auto Scaling Terminates During Scale In in the Auto Scaling User Guide.

Type: array of Strings

Length Constraints: Minimum length of 1. Maximum length of 1600.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

VPCZoneIdentifier

The ID of the subnet, if you are launching into a VPC. You can specify several subnets in a comma-separated list.

When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the subnets' Availability Zones match the values you specify for AvailabilityZones.

For more information, see Launching Auto Scaling Instances in a VPC in the Auto Scaling User Guide.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2047.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

Errors

For information about the errors that are common to all actions, see Common Errors.

ResourceContention

You already have a pending update to an Auto Scaling resource (for example, a group, instance, or load balancer).

HTTP Status Code: 500

ScalingActivityInProgress

The operation can't be performed because there are scaling activities in progress.

HTTP Status Code: 400

Examples

Example 1: Update existing Auto Scaling group with ELB health check

Sample Request

Copy
https://autoscaling.amazonaws.com/?Action=UpdateAutoScalingGroup &HealthCheckType=ELB &HealthCheckGracePeriod=300 &AutoScalingGroupName=my-asg &Version=2011-01-01 &AUTHPARAMS

Example 2: Update existing Auto Scaling group with a new Availability Zone

Sample Request

Copy
https://autoscaling.amazonaws.com/?Action=UpdateAutoScalingGroup &AutoScalingGroupName=my-asg-lbs &AvailabilityZones.member.1=us-east-1a &AvailabilityZones.member.2=us-east-1b &AvailabilityZones.member.3=us-east-1c &MinSize=3 &Version=2011-01-01 &AUTHPARAMS

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: