LaunchInstances - Amazon EC2 Auto Scaling

LaunchInstances

Launches a specified number of instances in an Auto Scaling group. Returns instance IDs and other details if launch is successful or error details if launch is unsuccessful.

Request Parameters

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

AutoScalingGroupName

The name of the Auto Scaling group to launch instances into.

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: Yes

AvailabilityZoneIds.member.N

A list of Availability Zone IDs where instances should be launched. Must match or be included in the group's AZ configuration. You cannot specify both AvailabilityZones and AvailabilityZoneIds. Required for multi-AZ groups, optional for single-AZ groups.

Type: Array of strings

Array Members: Maximum 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

AvailabilityZones.member.N

The Availability Zones for the instance launch. Must match or be included in the Auto Scaling group's Availability Zone configuration. Either AvailabilityZones or SubnetIds must be specified for groups with multiple Availability Zone configurations.

Type: Array of strings

Array Members: Maximum 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

ClientToken

A unique, case-sensitive identifier to ensure idempotency of the request.

Type: String

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

Pattern: [A-Za-z0-9\-_\/]+

Required: Yes

RequestedCapacity

The number of instances to launch. Although this value can exceed 100 for instance weights, the actual instance count is limited to 100 instances per launch.

Type: Integer

Valid Range: Minimum value of 1.

Required: Yes

RetryStrategy

Specifies whether to retry asynchronously if the synchronous launch fails. Valid values are NONE (default, no async retry) and RETRY_WITH_GROUP_CONFIGURATION (increase desired capacity and retry with group configuration).

Type: String

Valid Values: retry-with-group-configuration | none

Required: No

SubnetIds.member.N

The subnet IDs for the instance launch. Either AvailabilityZones or SubnetIds must be specified. If both are specified, the subnets must reside in the specified Availability Zones.

Type: Array of strings

Array Members: Maximum 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

Response Elements

The following elements are returned by the service.

AutoScalingGroupName

The name of the Auto Scaling group where the instances were launched.

Type: String

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

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

ClientToken

The idempotency token used for the request, either customer-specified or auto-generated.

Type: String

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

Pattern: [A-Za-z0-9\-_\/]+

Errors.member.N

A list of errors encountered during the launch attempt including details about failed instance launches with their corresponding error codes and messages.

Type: Array of LaunchInstancesError objects

Instances.member.N

A list of successfully launched instances including details such as instance type, Availability Zone, subnet, lifecycle state, and instance IDs.

Type: Array of InstanceCollection objects

Errors

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

IdempotentParameterMismatch

Indicates that the parameters in the current request do not match the parameters from a previous request with the same client token within the idempotency window.

HTTP Status Code: 400

ResourceContention

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

message

HTTP Status Code: 500

See Also

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