ec2-run-instances

ec2-run-instances AMI [-n INSTANCE_COUNT] [-g GROUP [-g GROUP ...]] [-k KEY]

Launches one or more instances of the specified AMI. An optional security group in which new instances should be launched may be specified. If no group is specified instances are launched in the default group. A keypair name may also be specified. If provided, the public key associated with this keypair will be made available to the instances at boot time.

A table containing the following information is returned:

Errors are displayed on stderr.

OptionDefinitionRequired?Example
-n INSTANCE_COUNTThe number of instances to launch. If not specified, a value of 1 will be assumed. If it is not possible to launch at least this many instances (due to a lack of capacity or funds), no instances will be launched. If specified as a range (min-max) AmazonĀ EC2 will try to launch as many instances as possible, up to max, but will launch no fewer than min instances. No-n 5
-g GROUPThe security group(s) within which the instance(s) should be run. This determines the ingress firewall rules that will be applied to the instances. By default instances will run in the user's default group. If more than one group is specified, the security policy of the instances will be the union of the security policies of the specified groups. No-g fooGroup
-k KEYThe keypair to make available to these instances at boot time.No-k fooKeyPair
$ ec2-run-instances ami-6ba54002 -n 5
INSTANCE i-3ea74257 ami-6ba54002 pending
INSTANCE i-31a74258 ami-6ba54002 pending
INSTANCE i-31a74259 ami-6ba54002 pending
INSTANCE i-31a7425a ami-6ba54002 pending
INSTANCE i-31a7425b ami-6ba54002 pending
INSTANCE i-31a7425c ami-6ba54002 pending