RunInstances
GET /?Action=RunInstances
Description
Creates new instances, and then launches them.
This action enables you to create a specified number of instances using an OMI which you are allowed to use, and then to automatically launch them.
The instances remain in the pending
state until they are created and ready to be used. Once automatically launched, they are in the running
state.
To check the state of your instance, call the DescribeInstances method.
If not specified, the security group used by the service is the default one.
The metadata server enables you to get the public key provided when the instance is launched. Official OMIs contain a script to get this public key and put it inside the instance to provide secure access without password.
Body parameter
Required: false
Name: RunInstancesRequest
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
BlockDeviceMapping.N |
One or more block device mappings of the instance. |
false |
|||
ClientToken |
A unique identifier which enables you to manage the idempotency. |
false |
string |
||
DisableApiTermination |
If |
false |
boolean |
||
DryRun |
If |
false |
boolean |
||
EbsOptimized |
If |
false |
boolean |
||
ImageId |
The ID of the OMI. You can find the list of OMIs by calling the DescribeImages method. |
true |
string |
||
InstanceInitiatedShutdownBehavior |
The instance behavior when you stop it. By default or if set to |
false |
string |
||
InstanceType |
The type of instance ( |
false |
string |
||
KeyName |
The name of the keypair. |
false |
string |
||
MaxCount |
The maximum number of instances you want to launch. If all the instances cannot be created, the largest possible number of instances above MinCount are created and launched. |
true |
integer |
||
MinCount |
The minimum number of instances you want to launch. If this number of instances cannot be created, FCU does not create and launch any instance. |
true |
integer |
||
NetworkInterface.N |
One or more network interfaces. If you specify this parameter, you must define one network interface as the primary one of the instance with 0 as its device index. |
false |
|||
Placement |
A specific placement where you want to create the instances (tenancy options). |
false |
|||
PrivateIpAddress |
In a VPC, the unique primary IP address. The IP address must come from the IP address range of the subnet. |
false |
string |
||
PrivateIpAddresses |
In a VPC, the list of primary IP addresses when you create several instances. The IP addresses must come from the IP address range of the subnet. |
false |
string |
||
SecurityGroup.N |
One or more security group names. |
false |
string |
||
SecurityGroupId.N |
One or more security group IDs. |
false |
string |
||
SubnetId |
In a VPC, the ID of the subnet in which you want to launch the instance. |
false |
string |
||
UserData |
Data or a script used to add a specific configuration to the instance when launching it. If you are not using a command line tool, this must be base64-encoded. |
false |
string |
Responses
HTTP Code 200
HTTP Code | Description | Schema |
---|---|---|
200 |
Reservation |
Response 200
Name | Description | Required | Schema | Default | Example |
---|---|---|---|---|---|
groupSet.N |
One or more security groups. |
false |
|||
instancesSet.N |
One or more instances. |
false |
|||
ownerId |
The ID of the account which has reserved the instances. |
false |
string |
||
requestId |
The ID of the request. |
false |
string |
||
requesterId |
The ID of the requester. |
false |
string |
||
reservationId |
Zero or more reservations, giving you information about your request. |
false |
string |