amazonka-ec2-0.2.1: Amazon Elastic Compute Cloud SDK.

Safe HaskellNone
LanguageHaskell2010

Network.AWS.EC2.RunInstances

Contents

Description

Launches the specified number of instances using an AMI for which you have permissions.

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 for Linux.

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 forLinux.

You can provide optional user data when launching an instance. For more information, see Instance Metadata in the Amazon Elastic Compute Cloud UserGuide for Linux.

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 InstanceImmediately Terminates, and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide for Linux.

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-RunInstances.html

Synopsis

Request

Request constructor

Request lenses

riClientToken :: Lens' RunInstances (Maybe Text) Source

Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide for Linux.

Constraints: Maximum 64 ASCII characters

riDisableApiTermination :: Lens' RunInstances (Maybe Bool) Source

If you set this parameter to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. If you set this parameter to true and then later want to be able to terminate the instance, you must first change the value of the disableApiTermination attribute to false using ModifyInstanceAttribute. Alternatively, if you set InstanceInitiatedShutdownBehavior to terminate, you can terminate the instance by running the shutdown command from the instance.

Default: false

riEbsOptimized :: Lens' RunInstances (Maybe Bool) Source

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 Amazon EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS-optimized instance.

Default: false

riImageId :: Lens' RunInstances Text Source

The ID of the AMI, which you can get by calling DescribeImages.

riInstanceInitiatedShutdownBehavior :: Lens' RunInstances (Maybe ShutdownBehavior) Source

Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop

riInstanceType :: Lens' RunInstances (Maybe InstanceType) Source

The instance type. For more information, see Instance Types in the AmazonElastic Compute Cloud User Guide for Linux.

Default: 'm1.small'

riKernelId :: Lens' RunInstances (Maybe Text) Source

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 Guidefor Linux.

riKeyName :: Lens' RunInstances (Maybe Text) Source

The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.

If you launch an instance without specifying a key pair, you can't connect to the instance.

riMaxCount :: Lens' RunInstances Int Source

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 MinCount.

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.

riMinCount :: Lens' RunInstances Int Source

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.

riPlacement :: Lens' RunInstances (Maybe Placement) Source

The placement for the instance.

riPrivateIpAddress :: Lens' RunInstances (Maybe Text) Source

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 'PrivateIpAddresses.n.Primary' is set to true and 'PrivateIpAddresses.n.PrivateIpAddress' is set to an IP address.

Default: We select an IP address from the IP address range of the subnet.

riRamdiskId :: Lens' RunInstances (Maybe Text) Source

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 Guidefor Linux.

riSecurityGroupIds :: Lens' RunInstances [Text] Source

One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.

riSecurityGroups :: Lens' RunInstances [Text] Source

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.

riSubnetId :: Lens' RunInstances (Maybe Text) Source

EC2-VPC
The ID of the subnet to launch the instance into.

riUserData :: Lens' RunInstances (Maybe Text) Source

The Base64-encoded MIME user data for the instances.

Response

Response constructor

Response lenses

rirGroups :: Lens' RunInstancesResponse [GroupIdentifier] Source

One or more security groups.

rirOwnerId :: Lens' RunInstancesResponse Text Source

The ID of the AWS account that owns the reservation.

rirRequesterId :: Lens' RunInstancesResponse (Maybe Text) Source

The ID of the requester that launched the instances on your behalf (for example, AWS Management Console or Auto Scaling).