Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
   /*
    * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
    * 
    * Licensed under the Apache License, Version 2.0 (the "License").
    * You may not use this file except in compliance with the License.
    * A copy of the License is located at
    * 
    *  http://aws.amazon.com/apache2.0
    * 
   * or in the "license" file accompanying this file. This file is distributed
   * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
   * express or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   */
  package com.amazonaws.services.ec2.model;
  
  
Container for the parameters to the RunInstances operation.

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 .

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 .

  
The ID of the AMI, which you can get by calling DescribeImages.
  
      private String imageId;

    
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.

  
      private Integer minCount;

    
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.

 
     private Integer maxCount;

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

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

 
     private String keyName;

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

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

Default: Amazon EC2 uses the default security group.

 
The Base64-encoded MIME user data for the instances.
 
     private String userData;

    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

 
     private String instanceType;

    
The placement for the instance.
 
     private Placement placement;

    
The ID of the kernel. <important>

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. </important>

 
     private String kernelId;

    
The ID of the RAM disk. <important>

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. </important>

 
     private String ramdiskId;

    
The block device mapping.
 
The monitoring for the instance.
 
     private Boolean monitoring;

    
[EC2-VPC] The ID of the subnet to launch the instance into.
 
     private String subnetId;

    
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

 
     private Boolean disableApiTermination;

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

Default: stop

Constraints:
Allowed Values: stop, terminate

 
     private String instanceInitiatedShutdownBehavior;

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

 
     private String privateIpAddress;

    
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Constraints: Maximum 64 ASCII characters

 
     private String clientToken;

    
Reserved.
 
     private String additionalInfo;

    
One or more network interfaces.
 
The IAM instance profile.
 
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

 
     private Boolean ebsOptimized;

    
Default constructor for a new RunInstancesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public RunInstancesRequest() {}
    
    
Constructs a new RunInstancesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
imageId The ID of the AMI, which you can get by calling DescribeImages.
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.

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

 
     public RunInstancesRequest(String imageIdInteger minCountInteger maxCount) {
         setImageId(imageId);
         setMinCount(minCount);
         setMaxCount(maxCount);
     }

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

Returns:
The ID of the AMI, which you can get by calling DescribeImages.
 
     public String getImageId() {
         return ;
     }
    
    
The ID of the AMI, which you can get by calling DescribeImages.

Parameters:
imageId The ID of the AMI, which you can get by calling DescribeImages.
 
     public void setImageId(String imageId) {
         this. = imageId;
     }
    
    
The ID of the AMI, which you can get by calling DescribeImages.

Returns a reference to this object so that method calls can be chained together.

Parameters:
imageId The ID of the AMI, which you can get by calling DescribeImages.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withImageId(String imageId) {
         this. = imageId;
         return this;
     }

    
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.

Returns:
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.

 
     public Integer getMinCount() {
         return ;
     }
    
    
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.

Parameters:
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.

 
     public void setMinCount(Integer minCount) {
         this. = 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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withMinCount(Integer minCount) {
         this. = minCount;
         return this;
     }

    
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.

Returns:
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.

 
     public Integer getMaxCount() {
         return ;
     }
    
    
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.

Parameters:
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 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.

 
     public void setMaxCount(Integer maxCount) {
         this. = 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 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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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 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.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withMaxCount(Integer maxCount) {
         this. = maxCount;
         return this;
     }

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

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

Returns:
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair. <important>

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

 
     public String getKeyName() {
         return ;
     }
    
    
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair. <important>

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

Parameters:
keyName The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair. <important>

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

 
     public void setKeyName(String keyName) {
         this. = keyName;
     }
    
    
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair. <important>

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

Returns a reference to this object so that method calls can be chained together.

Parameters:
keyName The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair. <important>

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

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withKeyName(String keyName) {
         this. = keyName;
         return this;
     }

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

Returns:
[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.

 
     public java.util.List<StringgetSecurityGroups() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
[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.

Parameters:
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.

 
     public void setSecurityGroups(java.util.Collection<StringsecurityGroups) {
         if (securityGroups == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringsecurityGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(securityGroups.size());
         securityGroupsCopy.addAll(securityGroups);
         this. = securityGroupsCopy;
     }
    
    
[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.

NOTE: This method appends the values to the existing list (if any). Use setSecurityGroups(java.util.Collection) or withSecurityGroups(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withSecurityGroups(String... securityGroups) {
         if (getSecurityGroups() == nullsetSecurityGroups(new java.util.ArrayList<String>(securityGroups.length));
         for (String value : securityGroups) {
             getSecurityGroups().add(value);
         }
         return this;
     }
    
    
[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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withSecurityGroups(java.util.Collection<StringsecurityGroups) {
         if (securityGroups == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringsecurityGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(securityGroups.size());
             securityGroupsCopy.addAll(securityGroups);
             this. = securityGroupsCopy;
         }
 
         return this;
     }

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

Default: Amazon EC2 uses the default security group.

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

Default: Amazon EC2 uses the default security group.

 
     public java.util.List<StringgetSecurityGroupIds() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.

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

Default: Amazon EC2 uses the default security group.

 
     public void setSecurityGroupIds(java.util.Collection<StringsecurityGroupIds) {
         if (securityGroupIds == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<StringsecurityGroupIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(securityGroupIds.size());
         securityGroupIdsCopy.addAll(securityGroupIds);
         this. = securityGroupIdsCopy;
     }
    
    
One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.

NOTE: This method appends the values to the existing list (if any). Use setSecurityGroupIds(java.util.Collection) or withSecurityGroupIds(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

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

Default: Amazon EC2 uses the default security group.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withSecurityGroupIds(String... securityGroupIds) {
         if (getSecurityGroupIds() == nullsetSecurityGroupIds(new java.util.ArrayList<String>(securityGroupIds.length));
         for (String value : securityGroupIds) {
             getSecurityGroupIds().add(value);
         }
         return this;
     }
    
    
One or more security group IDs. You can create a security group using CreateSecurityGroup.

Default: Amazon EC2 uses the default security group.

Returns a reference to this object so that method calls can be chained together.

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

Default: Amazon EC2 uses the default security group.

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withSecurityGroupIds(java.util.Collection<StringsecurityGroupIds) {
         if (securityGroupIds == null) {
             this. = null;
         } else {
             com.amazonaws.internal.ListWithAutoConstructFlag<StringsecurityGroupIdsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(securityGroupIds.size());
             securityGroupIdsCopy.addAll(securityGroupIds);
             this. = securityGroupIdsCopy;
         }
 
         return this;
     }

    
The Base64-encoded MIME user data for the instances.

Returns:
The Base64-encoded MIME user data for the instances.
 
     public String getUserData() {
         return ;
     }
    
    
The Base64-encoded MIME user data for the instances.

Parameters:
userData The Base64-encoded MIME user data for the instances.
 
     public void setUserData(String userData) {
         this. = userData;
     }
    
    
The Base64-encoded MIME user data for the instances.

Returns a reference to this object so that method calls can be chained together.

Parameters:
userData The Base64-encoded MIME user data for the instances.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withUserData(String userData) {
         this. = userData;
         return this;
     }

    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Returns:
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

See also:
InstanceType
 
     public String getInstanceType() {
         return ;
     }
    
    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

See also:
InstanceType
 
     public void setInstanceType(String instanceType) {
         this. = instanceType;
     }
    
    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
 
     public RunInstancesRequest withInstanceType(String instanceType) {
         this. = instanceType;
         return this;
     }

    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

See also:
InstanceType
 
     public void setInstanceType(InstanceType instanceType) {
         this. = instanceType.toString();
     }
    
    
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: t1.micro, m1.small, m1.medium, m1.large, m1.xlarge, m3.medium, m3.large, m3.xlarge, m3.2xlarge, t2.micro, t2.small, t2.medium, m2.xlarge, m2.2xlarge, m2.4xlarge, cr1.8xlarge, i2.xlarge, i2.2xlarge, i2.4xlarge, i2.8xlarge, hi1.4xlarge, hs1.8xlarge, c1.medium, c1.xlarge, c3.large, c3.xlarge, c3.2xlarge, c3.4xlarge, c3.8xlarge, c4.large, c4.xlarge, c4.2xlarge, c4.4xlarge, c4.8xlarge, cc1.4xlarge, cc2.8xlarge, g2.2xlarge, cg1.4xlarge, r3.large, r3.xlarge, r3.2xlarge, r3.4xlarge, r3.8xlarge, d2.xlarge, d2.2xlarge, d2.4xlarge, d2.8xlarge

Parameters:
instanceType The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.

Default: m1.small

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
InstanceType
 
     public RunInstancesRequest withInstanceType(InstanceType instanceType) {
         this. = instanceType.toString();
         return this;
     }

    
The placement for the instance.

Returns:
The placement for the instance.
 
     public Placement getPlacement() {
         return ;
     }
    
    
The placement for the instance.

Parameters:
placement The placement for the instance.
 
     public void setPlacement(Placement placement) {
         this. = placement;
     }
    
    
The placement for the instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
placement The placement for the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withPlacement(Placement placement) {
         this. = placement;
         return this;
     }

    
The ID of the kernel. <important>

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. </important>

Returns:
The ID of the kernel. <important>

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. </important>

 
     public String getKernelId() {
         return ;
     }
    
    
The ID of the kernel. <important>

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. </important>

Parameters:
kernelId The ID of the kernel. <important>

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. </important>

 
     public void setKernelId(String kernelId) {
         this. = kernelId;
     }
    
    
The ID of the kernel. <important>

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. </important>

Returns a reference to this object so that method calls can be chained together.

Parameters:
kernelId The ID of the kernel. <important>

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. </important>

Returns:
A reference to this updated object so that method calls can be chained together.
 
     public RunInstancesRequest withKernelId(String kernelId) {
         this. = kernelId;
         return this;
     }

    
The ID of the RAM disk. <important>

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. </important>

Returns:
The ID of the RAM disk. <important>

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. </important>

 
     public String getRamdiskId() {
         return ;
     }
    
    
The ID of the RAM disk. <important>

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. </important>

Parameters:
ramdiskId The ID of the RAM disk. <important>

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. </important>

 
     public void setRamdiskId(String ramdiskId) {
         this. = ramdiskId;
     }
    
    
The ID of the RAM disk. <important>

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. </important>

Returns a reference to this object so that method calls can be chained together.

Parameters:
ramdiskId The ID of the RAM disk. <important>

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. </important>

Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withRamdiskId(String ramdiskId) {
        this. = ramdiskId;
        return this;
    }

    
The block device mapping.

Returns:
The block device mapping.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The block device mapping.

Parameters:
blockDeviceMappings The block device mapping.
    public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMappingblockDeviceMappings) {
        if (blockDeviceMappings == null) {
            this. = null;
            return;
        }
        blockDeviceMappingsCopy.addAll(blockDeviceMappings);
        this. = blockDeviceMappingsCopy;
    }
    
    
The block device mapping.

NOTE: This method appends the values to the existing list (if any). Use setBlockDeviceMappings(java.util.Collection) or withBlockDeviceMappings(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings The block device mapping.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) {
        if (getBlockDeviceMappings() == nullsetBlockDeviceMappings(new java.util.ArrayList<BlockDeviceMapping>(blockDeviceMappings.length));
        for (BlockDeviceMapping value : blockDeviceMappings) {
            getBlockDeviceMappings().add(value);
        }
        return this;
    }
    
    
The block device mapping.

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings The block device mapping.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (blockDeviceMappings == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMappingblockDeviceMappingsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<BlockDeviceMapping>(blockDeviceMappings.size());
            blockDeviceMappingsCopy.addAll(blockDeviceMappings);
            this. = blockDeviceMappingsCopy;
        }
        return this;
    }

    
The monitoring for the instance.

Returns:
The monitoring for the instance.
    public Boolean isMonitoring() {
        return ;
    }
    
    
The monitoring for the instance.

Parameters:
monitoring The monitoring for the instance.
    public void setMonitoring(Boolean monitoring) {
        this. = monitoring;
    }
    
    
The monitoring for the instance.

Returns a reference to this object so that method calls can be chained together.

Parameters:
monitoring The monitoring for the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withMonitoring(Boolean monitoring) {
        this. = monitoring;
        return this;
    }

    
The monitoring for the instance.

Returns:
The monitoring for the instance.
    public Boolean getMonitoring() {
        return ;
    }

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

Returns:
[EC2-VPC] The ID of the subnet to launch the instance into.
    public String getSubnetId() {
        return ;
    }
    
    
[EC2-VPC] The ID of the subnet to launch the instance into.

Parameters:
subnetId [EC2-VPC] The ID of the subnet to launch the instance into.
    public void setSubnetId(String subnetId) {
        this. = subnetId;
    }
    
    
[EC2-VPC] The ID of the subnet to launch the instance into.

Returns a reference to this object so that method calls can be chained together.

Parameters:
subnetId [EC2-VPC] The ID of the subnet to launch the instance into.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withSubnetId(String subnetId) {
        this. = subnetId;
        return this;
    }

    
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

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

    public Boolean isDisableApiTermination() {
        return ;
    }
    
    
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

Parameters:
disableApiTermination 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

    public void setDisableApiTermination(Boolean disableApiTermination) {
        this. = disableApiTermination;
    }
    
    
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

Returns a reference to this object so that method calls can be chained together.

Parameters:
disableApiTermination 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

Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withDisableApiTermination(Boolean disableApiTermination) {
        this. = disableApiTermination;
        return this;
    }

    
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

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

        return ;
    }

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

Default: stop

Constraints:
Allowed Values: stop, terminate

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

Default: stop

See also:
ShutdownBehavior
        return ;
    }
    
    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop

Constraints:
Allowed Values: stop, terminate

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

Default: stop

See also:
ShutdownBehavior
    public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior;
    }
    
    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: stop, terminate

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

Default: stop

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ShutdownBehavior
    public RunInstancesRequest withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior;
        return this;
    }

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

Default: stop

Constraints:
Allowed Values: stop, terminate

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

Default: stop

See also:
ShutdownBehavior
    public void setInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior.toString();
    }
    
    
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).

Default: stop

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: stop, terminate

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

Default: stop

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ShutdownBehavior
    public RunInstancesRequest withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) {
        this. = instanceInitiatedShutdownBehavior.toString();
        return this;
    }

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

Returns:
[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.

    public String getPrivateIpAddress() {
        return ;
    }
    
    
[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.

Parameters:
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 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.

    public void setPrivateIpAddress(String privateIpAddress) {
        this. = 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 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.

Returns a reference to this object so that method calls can be chained together.

Parameters:
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 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.

Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withPrivateIpAddress(String privateIpAddress) {
        this. = privateIpAddress;
        return this;
    }

    
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Constraints: Maximum 64 ASCII characters

Returns:
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Constraints: Maximum 64 ASCII characters

    public String getClientToken() {
        return ;
    }
    
    
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.

Constraints: Maximum 64 ASCII characters

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

    public void setClientToken(String clientToken) {
        this. = 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

Returns a reference to this object so that method calls can be chained together.

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

Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withClientToken(String clientToken) {
        this. = clientToken;
        return this;
    }

    
Reserved.

Returns:
Reserved.
    public String getAdditionalInfo() {
        return ;
    }
    
    
Reserved.

Parameters:
additionalInfo Reserved.
    public void setAdditionalInfo(String additionalInfo) {
        this. = additionalInfo;
    }
    
    
Reserved.

Returns a reference to this object so that method calls can be chained together.

Parameters:
additionalInfo Reserved.
Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withAdditionalInfo(String additionalInfo) {
        this. = additionalInfo;
        return this;
    }

    
One or more network interfaces.

Returns:
One or more network interfaces.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more network interfaces.

Parameters:
networkInterfaces One or more network interfaces.
        if (networkInterfaces == null) {
            this. = null;
            return;
        }
        networkInterfacesCopy.addAll(networkInterfaces);
        this. = networkInterfacesCopy;
    }
    
    
One or more network interfaces.

NOTE: This method appends the values to the existing list (if any). Use setNetworkInterfaces(java.util.Collection) or withNetworkInterfaces(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Parameters:
networkInterfaces One or more network interfaces.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (getNetworkInterfaces() == nullsetNetworkInterfaces(new java.util.ArrayList<InstanceNetworkInterfaceSpecification>(networkInterfaces.length));
        for (InstanceNetworkInterfaceSpecification value : networkInterfaces) {
            getNetworkInterfaces().add(value);
        }
        return this;
    }
    
    
One or more network interfaces.

Returns a reference to this object so that method calls can be chained together.

Parameters:
networkInterfaces One or more network interfaces.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (networkInterfaces == null) {
            this. = null;
        } else {
            networkInterfacesCopy.addAll(networkInterfaces);
            this. = networkInterfacesCopy;
        }
        return this;
    }

    
The IAM instance profile.

Returns:
The IAM instance profile.
        return ;
    }
    
    
The IAM instance profile.

Parameters:
iamInstanceProfile The IAM instance profile.
    public void setIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile) {
        this. = iamInstanceProfile;
    }
    
    
The IAM instance profile.

Returns a reference to this object so that method calls can be chained together.

Parameters:
iamInstanceProfile The IAM instance profile.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = iamInstanceProfile;
        return this;
    }

    
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

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

    public Boolean isEbsOptimized() {
        return ;
    }
    
    
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

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

    public void setEbsOptimized(Boolean ebsOptimized) {
        this. = 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 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

Returns a reference to this object so that method calls can be chained together.

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

Returns:
A reference to this updated object so that method calls can be chained together.
    public RunInstancesRequest withEbsOptimized(Boolean ebsOptimized) {
        this. = ebsOptimized;
        return this;
    }

    
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

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

    public Boolean getEbsOptimized() {
        return ;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        Request<RunInstancesRequestrequest = new RunInstancesRequestMarshaller().marshall(this);
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getImageId() != nullsb.append("ImageId: " + getImageId() + ",");
        if (getMinCount() != nullsb.append("MinCount: " + getMinCount() + ",");
        if (getMaxCount() != nullsb.append("MaxCount: " + getMaxCount() + ",");
        if (getKeyName() != nullsb.append("KeyName: " + getKeyName() + ",");
        if (getSecurityGroups() != nullsb.append("SecurityGroups: " + getSecurityGroups() + ",");
        if (getSecurityGroupIds() != nullsb.append("SecurityGroupIds: " + getSecurityGroupIds() + ",");
        if (getUserData() != nullsb.append("UserData: " + getUserData() + ",");
        if (getInstanceType() != nullsb.append("InstanceType: " + getInstanceType() + ",");
        if (getPlacement() != nullsb.append("Placement: " + getPlacement() + ",");
        if (getKernelId() != nullsb.append("KernelId: " + getKernelId() + ",");
        if (getRamdiskId() != nullsb.append("RamdiskId: " + getRamdiskId() + ",");
        if (getBlockDeviceMappings() != nullsb.append("BlockDeviceMappings: " + getBlockDeviceMappings() + ",");
        if (isMonitoring() != nullsb.append("Monitoring: " + isMonitoring() + ",");
        if (getSubnetId() != nullsb.append("SubnetId: " + getSubnetId() + ",");
        if (isDisableApiTermination() != nullsb.append("DisableApiTermination: " + isDisableApiTermination() + ",");
        if (getInstanceInitiatedShutdownBehavior() != nullsb.append("InstanceInitiatedShutdownBehavior: " + getInstanceInitiatedShutdownBehavior() + ",");
        if (getPrivateIpAddress() != nullsb.append("PrivateIpAddress: " + getPrivateIpAddress() + ",");
        if (getClientToken() != nullsb.append("ClientToken: " + getClientToken() + ",");
        if (getAdditionalInfo() != nullsb.append("AdditionalInfo: " + getAdditionalInfo() + ",");
        if (getNetworkInterfaces() != nullsb.append("NetworkInterfaces: " + getNetworkInterfaces() + ",");
        if (getIamInstanceProfile() != nullsb.append("IamInstanceProfile: " + getIamInstanceProfile() + ",");
        if (isEbsOptimized() != nullsb.append("EbsOptimized: " + isEbsOptimized() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); 
        hashCode = prime * hashCode + ((getMinCount() == null) ? 0 : getMinCount().hashCode()); 
        hashCode = prime * hashCode + ((getMaxCount() == null) ? 0 : getMaxCount().hashCode()); 
        hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode()); 
        hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); 
        hashCode = prime * hashCode + ((getSecurityGroupIds() == null) ? 0 : getSecurityGroupIds().hashCode()); 
        hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); 
        hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode()); 
        hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); 
        hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode()); 
        hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); 
        hashCode = prime * hashCode + ((isMonitoring() == null) ? 0 : isMonitoring().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); 
        hashCode = prime * hashCode + ((isDisableApiTermination() == null) ? 0 : isDisableApiTermination().hashCode()); 
        hashCode = prime * hashCode + ((getInstanceInitiatedShutdownBehavior() == null) ? 0 : getInstanceInitiatedShutdownBehavior().hashCode()); 
        hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode()); 
        hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); 
        hashCode = prime * hashCode + ((getAdditionalInfo() == null) ? 0 : getAdditionalInfo().hashCode()); 
        hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode()); 
        hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode()); 
        hashCode = prime * hashCode + ((isEbsOptimized() == null) ? 0 : isEbsOptimized().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof RunInstancesRequest == falsereturn false;
        RunInstancesRequest other = (RunInstancesRequest)obj;
        
        if (other.getImageId() == null ^ this.getImageId() == nullreturn false;
        if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == falsereturn false
        if (other.getMinCount() == null ^ this.getMinCount() == nullreturn false;
        if (other.getMinCount() != null && other.getMinCount().equals(this.getMinCount()) == falsereturn false
        if (other.getMaxCount() == null ^ this.getMaxCount() == nullreturn false;
        if (other.getMaxCount() != null && other.getMaxCount().equals(this.getMaxCount()) == falsereturn false
        if (other.getKeyName() == null ^ this.getKeyName() == nullreturn false;
        if (other.getKeyName() != null && other.getKeyName().equals(this.getKeyName()) == falsereturn false
        if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == nullreturn false;
        if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == falsereturn false
        if (other.getSecurityGroupIds() == null ^ this.getSecurityGroupIds() == nullreturn false;
        if (other.getSecurityGroupIds() != null && other.getSecurityGroupIds().equals(this.getSecurityGroupIds()) == falsereturn false
        if (other.getUserData() == null ^ this.getUserData() == nullreturn false;
        if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == falsereturn false
        if (other.getInstanceType() == null ^ this.getInstanceType() == nullreturn false;
        if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == falsereturn false
        if (other.getPlacement() == null ^ this.getPlacement() == nullreturn false;
        if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == falsereturn false
        if (other.getKernelId() == null ^ this.getKernelId() == nullreturn false;
        if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == falsereturn false
        if (other.getRamdiskId() == null ^ this.getRamdiskId() == nullreturn false;
        if (other.getRamdiskId() != null && other.getRamdiskId().equals(this.getRamdiskId()) == falsereturn false
        if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == nullreturn false;
        if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == falsereturn false
        if (other.isMonitoring() == null ^ this.isMonitoring() == nullreturn false;
        if (other.isMonitoring() != null && other.isMonitoring().equals(this.isMonitoring()) == falsereturn false
        if (other.getSubnetId() == null ^ this.getSubnetId() == nullreturn false;
        if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == falsereturn false
        if (other.isDisableApiTermination() == null ^ this.isDisableApiTermination() == nullreturn false;
        if (other.isDisableApiTermination() != null && other.isDisableApiTermination().equals(this.isDisableApiTermination()) == falsereturn false
        if (other.getInstanceInitiatedShutdownBehavior() == null ^ this.getInstanceInitiatedShutdownBehavior() == nullreturn false;
        if (other.getInstanceInitiatedShutdownBehavior() != null && other.getInstanceInitiatedShutdownBehavior().equals(this.getInstanceInitiatedShutdownBehavior()) == falsereturn false
        if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == nullreturn false;
        if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals(this.getPrivateIpAddress()) == falsereturn false
        if (other.getClientToken() == null ^ this.getClientToken() == nullreturn false;
        if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == falsereturn false
        if (other.getAdditionalInfo() == null ^ this.getAdditionalInfo() == nullreturn false;
        if (other.getAdditionalInfo() != null && other.getAdditionalInfo().equals(this.getAdditionalInfo()) == falsereturn false
        if (other.getNetworkInterfaces() == null ^ this.getNetworkInterfaces() == nullreturn false;
        if (other.getNetworkInterfaces() != null && other.getNetworkInterfaces().equals(this.getNetworkInterfaces()) == falsereturn false
        if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == nullreturn false;
        if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == falsereturn false
        if (other.isEbsOptimized() == null ^ this.isEbsOptimized() == nullreturn false;
        if (other.isEbsOptimized() != null && other.isEbsOptimized().equals(this.isEbsOptimized()) == falsereturn false
        return true;
    }
    
    @Override
    public RunInstancesRequest clone() {
        
            return (RunInstancesRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X