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.
When you launch an instance, it enters the pending
state. After the instance
is ready for you, it enters the running
state. To check the state of
your instance, call DescribeInstances.
If you don't specify a security group when launching an instance, Amazon EC2 uses the default security group. For more information, see Security Groups in the Amazon Elastic Compute Cloud User Guide.
[EC2-VPC only accounts] If you don't specify a subnet in the request, we choose a default subnet from your default VPC for you.
[EC2-Classic accounts] If you're launching into EC2-Classic and you don't specify an Availability Zone, we choose one for you.
Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide.
You can provide optional user data when launching an instance. For more information, see Instance Metadata in the Amazon Elastic Compute Cloud User Guide.
If any of the AMIs have a product code attached for which the user has not subscribed,
RunInstances
fails.
T2 instance types can only be launched into a VPC. If you do not have a default VPC,
or if you do not specify a subnet ID in the request, RunInstances
fails.
For more information about troubleshooting, see What To Do If An Instance Immediately Terminates, and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.dll
Version: (assembly version)
public class RunInstancesRequest : AmazonEC2Request IRequestEvents
The RunInstancesRequest type exposes the following members
Name | Description | |
---|---|---|
RunInstancesRequest() | Empty constructor used to set properties independently even when a simple constructor is available | |
RunInstancesRequest(string, int, int) | Instantiates RunInstancesRequest with the parameterized properties |
Name | Type | Description | |
---|---|---|---|
AdditionalInfo | System.String |
Gets and sets the property AdditionalInfo.
Reserved. |
|
BlockDeviceMappings | System.Collections.Generic.List<Amazon.EC2.Model.BlockDeviceMapping> |
Gets and sets the property BlockDeviceMappings.
The block device mapping. |
|
ClientToken | System.String |
Gets and sets the property ClientToken.
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency. Constraints: Maximum 64 ASCII characters |
|
DisableApiTermination | System.Boolean |
Gets and sets the property DisableApiTermination.
If you set this parameter to
Default: |
|
EbsOptimized | System.Boolean |
Gets and sets the property EbsOptimized.
Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.
Default: |
|
IamInstanceProfile | Amazon.EC2.Model.IamInstanceProfileSpecification |
Gets and sets the property IamInstanceProfile.
The IAM instance profile. |
|
ImageId | System.String |
Gets and sets the property ImageId.
The ID of the AMI, which you can get by calling DescribeImages. |
|
InstanceInitiatedShutdownBehavior | Amazon.EC2.ShutdownBehavior |
Gets and sets the property InstanceInitiatedShutdownBehavior.
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: |
|
InstanceType | Amazon.EC2.InstanceType |
Gets and sets the property InstanceType.
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: |
|
KernelId | System.String |
Gets and sets the property KernelId.
The ID of the kernel. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide. |
|
KeyName | System.String |
Gets and sets the property KeyName.
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair. If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in. |
|
MaxCount | System.Int32 |
Gets and sets the property MaxCount.
The maximum number of instances to launch. If you specify more instances than Amazon
EC2 can launch in the target Availability Zone, Amazon EC2 launches the largest possible
number of instances above Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 General FAQ. |
|
MinCount | System.Int32 |
Gets and sets the property MinCount.
The minimum number of instances to launch. If you specify a minimum that is more instances than Amazon EC2 can launch in the target Availability Zone, Amazon EC2 launches no instances. Constraints: Between 1 and the maximum number you're allowed for the specified instance type. For more information about the default limits, and how to request an increase, see How many instances can I run in Amazon EC2 in the Amazon EC2 General FAQ. |
|
Monitoring | System.Boolean |
Gets and sets the property Monitoring.
The monitoring for the instance. |
|
NetworkInterfaces | System.Collections.Generic.List<Amazon.EC2.Model.InstanceNetworkInterfaceSpecification> |
Gets and sets the property NetworkInterfaces.
One or more network interfaces. |
|
Placement | Amazon.EC2.Model.Placement |
Gets and sets the property Placement.
The placement for the instance. |
|
PrivateIpAddress | System.String |
Gets and sets the property PrivateIpAddress.
[EC2-VPC] The primary IP address. You must specify a value from the IP address range of the subnet.
Only one private IP address can be designated as primary. Therefore, you can't specify
this parameter if Default: We select an IP address from the IP address range of the subnet. |
|
RamdiskId | System.String |
Gets and sets the property RamdiskId.
The ID of the RAM disk. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon Elastic Compute Cloud User Guide. |
|
SecurityGroupIds | System.Collections.Generic.List<System.String> |
Gets and sets the property SecurityGroupIds.
One or more security group IDs. You can create a security group using CreateSecurityGroup. Default: Amazon EC2 uses the default security group. |
|
SecurityGroups | System.Collections.Generic.List<System.String> |
Gets and sets the property SecurityGroups.
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. Default: Amazon EC2 uses the default security group. |
|
SubnetId | System.String |
Gets and sets the property SubnetId.
[EC2-VPC] The ID of the subnet to launch the instance into. |
|
UserData | System.String |
Gets and sets the property UserData.
The Base64-encoded MIME user data for the instances. |
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8
.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8