public class RunInstancesRequest extends AmazonWebServiceRequest implements java.io.Serializable, java.lang.Cloneable, DryRunSupportedRequest<RunInstancesRequest>
Contains the parameters for RunInstances.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
additionalInfo
Reserved.
|
private SdkInternalList<BlockDeviceMapping> |
blockDeviceMappings
The block device mapping.
|
private java.lang.String |
clientToken
Unique, case-sensitive identifier you provide to ensure the idempotency
of the request.
|
private java.lang.Boolean |
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. |
private java.lang.Boolean |
ebsOptimized
Indicates whether the instance is optimized for EBS I/O.
|
private IamInstanceProfileSpecification |
iamInstanceProfile
The IAM instance profile.
|
private java.lang.String |
imageId
The ID of the AMI, which you can get by calling DescribeImages.
|
private java.lang.String |
instanceInitiatedShutdownBehavior
Indicates whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for system
shutdown).
|
private java.lang.String |
instanceType
The instance type.
|
private java.lang.String |
kernelId
The ID of the kernel.
|
private java.lang.String |
keyName
The name of the key pair.
|
private java.lang.Integer |
maxCount
The maximum number of instances to launch.
|
private java.lang.Integer |
minCount
The minimum number of instances to launch.
|
private java.lang.Boolean |
monitoring
The monitoring for the instance.
|
private SdkInternalList<InstanceNetworkInterfaceSpecification> |
networkInterfaces
One or more network interfaces.
|
private Placement |
placement
The placement for the instance.
|
private java.lang.String |
privateIpAddress
[EC2-VPC] The primary IP address.
|
private java.lang.String |
ramdiskId
The ID of the RAM disk.
|
private SdkInternalList<java.lang.String> |
securityGroupIds
One or more security group IDs.
|
private SdkInternalList<java.lang.String> |
securityGroups
[EC2-Classic, default VPC] One or more security group names.
|
private java.lang.String |
subnetId
[EC2-VPC] The ID of the subnet to launch the instance into.
|
private java.lang.String |
userData
Data to configure the instance, or a script to run during instance
launch.
|
NOOP
Constructor and Description |
---|
RunInstancesRequest()
Default constructor for RunInstancesRequest object.
|
RunInstancesRequest(java.lang.String imageId,
java.lang.Integer minCount,
java.lang.Integer maxCount)
Constructs a new RunInstancesRequest object.
|
Modifier and Type | Method and Description |
---|---|
RunInstancesRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAdditionalInfo()
Reserved.
|
java.util.List<BlockDeviceMapping> |
getBlockDeviceMappings()
The block device mapping.
|
java.lang.String |
getClientToken()
Unique, case-sensitive identifier you provide to ensure the idempotency
of the request.
|
java.lang.Boolean |
getDisableApiTermination()
If you set this parameter to
true , you can't terminate the
instance using the Amazon EC2 console, CLI, or API; otherwise, you can. |
Request<RunInstancesRequest> |
getDryRunRequest()
This method is intended for internal use only.
|
java.lang.Boolean |
getEbsOptimized()
Indicates whether the instance is optimized for EBS I/O.
|
IamInstanceProfileSpecification |
getIamInstanceProfile()
The IAM instance profile.
|
java.lang.String |
getImageId()
The ID of the AMI, which you can get by calling DescribeImages.
|
java.lang.String |
getInstanceInitiatedShutdownBehavior()
Indicates whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for system
shutdown).
|
java.lang.String |
getInstanceType()
The instance type.
|
java.lang.String |
getKernelId()
The ID of the kernel.
|
java.lang.String |
getKeyName()
The name of the key pair.
|
java.lang.Integer |
getMaxCount()
The maximum number of instances to launch.
|
java.lang.Integer |
getMinCount()
The minimum number of instances to launch.
|
java.lang.Boolean |
getMonitoring()
The monitoring for the instance.
|
java.util.List<InstanceNetworkInterfaceSpecification> |
getNetworkInterfaces()
One or more network interfaces.
|
Placement |
getPlacement()
The placement for the instance.
|
java.lang.String |
getPrivateIpAddress()
[EC2-VPC] The primary IP address.
|
java.lang.String |
getRamdiskId()
The ID of the RAM disk.
|
java.util.List<java.lang.String> |
getSecurityGroupIds()
One or more security group IDs.
|
java.util.List<java.lang.String> |
getSecurityGroups()
[EC2-Classic, default VPC] One or more security group names.
|
java.lang.String |
getSubnetId()
[EC2-VPC] The ID of the subnet to launch the instance into.
|
java.lang.String |
getUserData()
Data to configure the instance, or a script to run during instance
launch.
|
int |
hashCode() |
java.lang.Boolean |
isDisableApiTermination()
If you set this parameter to
true , you can't terminate the
instance using the Amazon EC2 console, CLI, or API; otherwise, you can. |
java.lang.Boolean |
isEbsOptimized()
Indicates whether the instance is optimized for EBS I/O.
|
java.lang.Boolean |
isMonitoring()
The monitoring for the instance.
|
void |
setAdditionalInfo(java.lang.String additionalInfo)
Reserved.
|
void |
setBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
The block device mapping.
|
void |
setClientToken(java.lang.String clientToken)
Unique, case-sensitive identifier you provide to ensure the idempotency
of the request.
|
void |
setDisableApiTermination(java.lang.Boolean 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. |
void |
setEbsOptimized(java.lang.Boolean ebsOptimized)
Indicates whether the instance is optimized for EBS I/O.
|
void |
setIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile)
The IAM instance profile.
|
void |
setImageId(java.lang.String imageId)
The ID of the AMI, which you can get by calling DescribeImages.
|
void |
setInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for system
shutdown).
|
void |
setInstanceInitiatedShutdownBehavior(java.lang.String instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for system
shutdown).
|
void |
setInstanceType(InstanceType instanceType)
The instance type.
|
void |
setInstanceType(java.lang.String instanceType)
The instance type.
|
void |
setKernelId(java.lang.String kernelId)
The ID of the kernel.
|
void |
setKeyName(java.lang.String keyName)
The name of the key pair.
|
void |
setMaxCount(java.lang.Integer maxCount)
The maximum number of instances to launch.
|
void |
setMinCount(java.lang.Integer minCount)
The minimum number of instances to launch.
|
void |
setMonitoring(java.lang.Boolean monitoring)
The monitoring for the instance.
|
void |
setNetworkInterfaces(java.util.Collection<InstanceNetworkInterfaceSpecification> networkInterfaces)
One or more network interfaces.
|
void |
setPlacement(Placement placement)
The placement for the instance.
|
void |
setPrivateIpAddress(java.lang.String privateIpAddress)
[EC2-VPC] The primary IP address.
|
void |
setRamdiskId(java.lang.String ramdiskId)
The ID of the RAM disk.
|
void |
setSecurityGroupIds(java.util.Collection<java.lang.String> securityGroupIds)
One or more security group IDs.
|
void |
setSecurityGroups(java.util.Collection<java.lang.String> securityGroups)
[EC2-Classic, default VPC] One or more security group names.
|
void |
setSubnetId(java.lang.String subnetId)
[EC2-VPC] The ID of the subnet to launch the instance into.
|
void |
setUserData(java.lang.String userData)
Data to configure the instance, or a script to run during instance
launch.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
RunInstancesRequest |
withAdditionalInfo(java.lang.String additionalInfo)
Reserved.
|
RunInstancesRequest |
withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
The block device mapping.
|
RunInstancesRequest |
withBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
The block device mapping.
|
RunInstancesRequest |
withClientToken(java.lang.String clientToken)
Unique, case-sensitive identifier you provide to ensure the idempotency
of the request.
|
RunInstancesRequest |
withDisableApiTermination(java.lang.Boolean 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. |
RunInstancesRequest |
withEbsOptimized(java.lang.Boolean ebsOptimized)
Indicates whether the instance is optimized for EBS I/O.
|
RunInstancesRequest |
withIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile)
The IAM instance profile.
|
RunInstancesRequest |
withImageId(java.lang.String imageId)
The ID of the AMI, which you can get by calling DescribeImages.
|
RunInstancesRequest |
withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for system
shutdown).
|
RunInstancesRequest |
withInstanceInitiatedShutdownBehavior(java.lang.String instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate
shutdown from the instance (using the operating system command for system
shutdown).
|
RunInstancesRequest |
withInstanceType(InstanceType instanceType)
The instance type.
|
RunInstancesRequest |
withInstanceType(java.lang.String instanceType)
The instance type.
|
RunInstancesRequest |
withKernelId(java.lang.String kernelId)
The ID of the kernel.
|
RunInstancesRequest |
withKeyName(java.lang.String keyName)
The name of the key pair.
|
RunInstancesRequest |
withMaxCount(java.lang.Integer maxCount)
The maximum number of instances to launch.
|
RunInstancesRequest |
withMinCount(java.lang.Integer minCount)
The minimum number of instances to launch.
|
RunInstancesRequest |
withMonitoring(java.lang.Boolean monitoring)
The monitoring for the instance.
|
RunInstancesRequest |
withNetworkInterfaces(java.util.Collection<InstanceNetworkInterfaceSpecification> networkInterfaces)
One or more network interfaces.
|
RunInstancesRequest |
withNetworkInterfaces(InstanceNetworkInterfaceSpecification... networkInterfaces)
One or more network interfaces.
|
RunInstancesRequest |
withPlacement(Placement placement)
The placement for the instance.
|
RunInstancesRequest |
withPrivateIpAddress(java.lang.String privateIpAddress)
[EC2-VPC] The primary IP address.
|
RunInstancesRequest |
withRamdiskId(java.lang.String ramdiskId)
The ID of the RAM disk.
|
RunInstancesRequest |
withSecurityGroupIds(java.util.Collection<java.lang.String> securityGroupIds)
One or more security group IDs.
|
RunInstancesRequest |
withSecurityGroupIds(java.lang.String... securityGroupIds)
One or more security group IDs.
|
RunInstancesRequest |
withSecurityGroups(java.util.Collection<java.lang.String> securityGroups)
[EC2-Classic, default VPC] One or more security group names.
|
RunInstancesRequest |
withSecurityGroups(java.lang.String... securityGroups)
[EC2-Classic, default VPC] One or more security group names.
|
RunInstancesRequest |
withSubnetId(java.lang.String subnetId)
[EC2-VPC] The ID of the subnet to launch the instance into.
|
RunInstancesRequest |
withUserData(java.lang.String userData)
Data to configure the instance, or a script to run during instance
launch.
|
copyBaseTo, getCloneRoot, getCloneSource, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestCredentialsProvider, getRequestMetricCollector, getSdkClientExecutionTimeout, getSdkRequestTimeout, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestCredentialsProvider, setRequestMetricCollector, setSdkClientExecutionTimeout, setSdkRequestTimeout, withGeneralProgressListener, withRequestMetricCollector, withSdkClientExecutionTimeout, withSdkRequestTimeout
private java.lang.String imageId
The ID of the AMI, which you can get by calling DescribeImages.
private java.lang.Integer 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.
private java.lang.Integer 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 FAQ.
private java.lang.String 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.
private SdkInternalList<java.lang.String> 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.
private SdkInternalList<java.lang.String> securityGroupIds
One or more security group IDs. You can create a security group using CreateSecurityGroup.
Default: Amazon EC2 uses the default security group.
private java.lang.String userData
Data to configure the instance, or a script to run during instance launch. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). For API calls, the text must be base64-encoded. For command line tools, the encoding is performed for you, and you can load the text from a file.
private java.lang.String instanceType
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
private Placement placement
The placement for the instance.
private java.lang.String 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.
private java.lang.String 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.
private SdkInternalList<BlockDeviceMapping> blockDeviceMappings
The block device mapping.
private java.lang.Boolean monitoring
The monitoring for the instance.
private java.lang.String subnetId
[EC2-VPC] The ID of the subnet to launch the instance into.
private java.lang.Boolean 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
private java.lang.String 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
private java.lang.String 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.
private java.lang.String 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
private java.lang.String additionalInfo
Reserved.
private SdkInternalList<InstanceNetworkInterfaceSpecification> networkInterfaces
One or more network interfaces.
private IamInstanceProfileSpecification iamInstanceProfile
The IAM instance profile.
private java.lang.Boolean 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: false
public RunInstancesRequest()
public RunInstancesRequest(java.lang.String imageId, java.lang.Integer minCount, java.lang.Integer maxCount)
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 FAQ.
public void setImageId(java.lang.String imageId)
The ID of the AMI, which you can get by calling DescribeImages.
imageId
- The ID of the AMI, which you can get by calling
DescribeImages.public java.lang.String getImageId()
The ID of the AMI, which you can get by calling DescribeImages.
public RunInstancesRequest withImageId(java.lang.String imageId)
The ID of the AMI, which you can get by calling DescribeImages.
imageId
- The ID of the AMI, which you can get by calling
DescribeImages.public void setMinCount(java.lang.Integer 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.
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 java.lang.Integer getMinCount()
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.
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 withMinCount(java.lang.Integer 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.
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 setMaxCount(java.lang.Integer 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 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 FAQ.
public java.lang.Integer getMaxCount()
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 FAQ.
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 FAQ.
public RunInstancesRequest withMaxCount(java.lang.Integer 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 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 FAQ.
public void setKeyName(java.lang.String 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.
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.
public java.lang.String getKeyName()
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.
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.
public RunInstancesRequest withKeyName(java.lang.String 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.
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.
public java.util.List<java.lang.String> getSecurityGroups()
[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.
Default: Amazon EC2 uses the default security group.
public void setSecurityGroups(java.util.Collection<java.lang.String> 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.
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 RunInstancesRequest withSecurityGroups(java.lang.String... 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.
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.
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 RunInstancesRequest withSecurityGroups(java.util.Collection<java.lang.String> 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.
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 java.util.List<java.lang.String> getSecurityGroupIds()
One or more security group IDs. You can create a security group using CreateSecurityGroup.
Default: Amazon EC2 uses the default security group.
Default: Amazon EC2 uses the default security group.
public void setSecurityGroupIds(java.util.Collection<java.lang.String> securityGroupIds)
One or more security group IDs. You can create a security group using CreateSecurityGroup.
Default: Amazon EC2 uses the default security group.
securityGroupIds
- One or more security group IDs. You can create a security group
using CreateSecurityGroup.
Default: Amazon EC2 uses the default security group.
public RunInstancesRequest withSecurityGroupIds(java.lang.String... securityGroupIds)
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.
securityGroupIds
- One or more security group IDs. You can create a security group
using CreateSecurityGroup.
Default: Amazon EC2 uses the default security group.
public RunInstancesRequest withSecurityGroupIds(java.util.Collection<java.lang.String> securityGroupIds)
One or more security group IDs. You can create a security group using CreateSecurityGroup.
Default: Amazon EC2 uses the default security group.
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 setUserData(java.lang.String userData)
Data to configure the instance, or a script to run during instance launch. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). For API calls, the text must be base64-encoded. For command line tools, the encoding is performed for you, and you can load the text from a file.
userData
- Data to configure the instance, or a script to run during instance
launch. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and
Adding User Data (Windows). For API calls, the text must be
base64-encoded. For command line tools, the encoding is performed
for you, and you can load the text from a file.public java.lang.String getUserData()
Data to configure the instance, or a script to run during instance launch. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). For API calls, the text must be base64-encoded. For command line tools, the encoding is performed for you, and you can load the text from a file.
public RunInstancesRequest withUserData(java.lang.String userData)
Data to configure the instance, or a script to run during instance launch. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). For API calls, the text must be base64-encoded. For command line tools, the encoding is performed for you, and you can load the text from a file.
userData
- Data to configure the instance, or a script to run during instance
launch. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and
Adding User Data (Windows). For API calls, the text must be
base64-encoded. For command line tools, the encoding is performed
for you, and you can load the text from a file.public void setInstanceType(java.lang.String instanceType)
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
instanceType
- The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User
Guide.
Default: m1.small
InstanceType
public java.lang.String getInstanceType()
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
Default: m1.small
InstanceType
public RunInstancesRequest withInstanceType(java.lang.String instanceType)
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
instanceType
- The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User
Guide.
Default: m1.small
InstanceType
public void setInstanceType(InstanceType instanceType)
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
instanceType
- The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User
Guide.
Default: m1.small
InstanceType
public RunInstancesRequest withInstanceType(InstanceType instanceType)
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
instanceType
- The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User
Guide.
Default: m1.small
InstanceType
public void setPlacement(Placement placement)
The placement for the instance.
placement
- The placement for the instance.public Placement getPlacement()
The placement for the instance.
public RunInstancesRequest withPlacement(Placement placement)
The placement for the instance.
placement
- The placement for the instance.public void setKernelId(java.lang.String 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.
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.
public java.lang.String getKernelId()
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.
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.
public RunInstancesRequest withKernelId(java.lang.String 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.
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.
public void setRamdiskId(java.lang.String 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.
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.
public java.lang.String getRamdiskId()
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.
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.
public RunInstancesRequest withRamdiskId(java.lang.String 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.
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.
public java.util.List<BlockDeviceMapping> getBlockDeviceMappings()
The block device mapping.
public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
The block device mapping.
blockDeviceMappings
- The block device mapping.public RunInstancesRequest withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
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.
blockDeviceMappings
- The block device mapping.public RunInstancesRequest withBlockDeviceMappings(java.util.Collection<BlockDeviceMapping> blockDeviceMappings)
The block device mapping.
blockDeviceMappings
- The block device mapping.public void setMonitoring(java.lang.Boolean monitoring)
The monitoring for the instance.
monitoring
- The monitoring for the instance.public java.lang.Boolean getMonitoring()
The monitoring for the instance.
public RunInstancesRequest withMonitoring(java.lang.Boolean monitoring)
The monitoring for the instance.
monitoring
- The monitoring for the instance.public java.lang.Boolean isMonitoring()
The monitoring for the instance.
public void setSubnetId(java.lang.String subnetId)
[EC2-VPC] The ID of the subnet to launch the instance into.
subnetId
- [EC2-VPC] The ID of the subnet to launch the instance into.public java.lang.String getSubnetId()
[EC2-VPC] The ID of the subnet to launch the instance into.
public RunInstancesRequest withSubnetId(java.lang.String subnetId)
[EC2-VPC] The ID of the subnet to launch the instance into.
subnetId
- [EC2-VPC] The ID of the subnet to launch the instance into.public void setDisableApiTermination(java.lang.Boolean 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
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 java.lang.Boolean getDisableApiTermination()
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
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 RunInstancesRequest withDisableApiTermination(java.lang.Boolean 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
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 java.lang.Boolean isDisableApiTermination()
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
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 setInstanceInitiatedShutdownBehavior(java.lang.String 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
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
ShutdownBehavior
public java.lang.String getInstanceInitiatedShutdownBehavior()
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
Default: stop
ShutdownBehavior
public RunInstancesRequest withInstanceInitiatedShutdownBehavior(java.lang.String 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
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
ShutdownBehavior
public void setInstanceInitiatedShutdownBehavior(ShutdownBehavior 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
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
ShutdownBehavior
public RunInstancesRequest withInstanceInitiatedShutdownBehavior(ShutdownBehavior 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
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
ShutdownBehavior
public void setPrivateIpAddress(java.lang.String 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.
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 java.lang.String getPrivateIpAddress()
[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.
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 RunInstancesRequest withPrivateIpAddress(java.lang.String 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.
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 setClientToken(java.lang.String 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
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 java.lang.String getClientToken()
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.
Constraints: Maximum 64 ASCII characters
Constraints: Maximum 64 ASCII characters
public RunInstancesRequest withClientToken(java.lang.String 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
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 setAdditionalInfo(java.lang.String additionalInfo)
Reserved.
additionalInfo
- Reserved.public java.lang.String getAdditionalInfo()
Reserved.
public RunInstancesRequest withAdditionalInfo(java.lang.String additionalInfo)
Reserved.
additionalInfo
- Reserved.public java.util.List<InstanceNetworkInterfaceSpecification> getNetworkInterfaces()
One or more network interfaces.
public void setNetworkInterfaces(java.util.Collection<InstanceNetworkInterfaceSpecification> networkInterfaces)
One or more network interfaces.
networkInterfaces
- One or more network interfaces.public RunInstancesRequest withNetworkInterfaces(InstanceNetworkInterfaceSpecification... networkInterfaces)
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.
networkInterfaces
- One or more network interfaces.public RunInstancesRequest withNetworkInterfaces(java.util.Collection<InstanceNetworkInterfaceSpecification> networkInterfaces)
One or more network interfaces.
networkInterfaces
- One or more network interfaces.public void setIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile)
The IAM instance profile.
iamInstanceProfile
- The IAM instance profile.public IamInstanceProfileSpecification getIamInstanceProfile()
The IAM instance profile.
public RunInstancesRequest withIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile)
The IAM instance profile.
iamInstanceProfile
- The IAM instance profile.public void setEbsOptimized(java.lang.Boolean 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: false
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: false
public java.lang.Boolean getEbsOptimized()
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: false
Default: false
public RunInstancesRequest withEbsOptimized(java.lang.Boolean 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: false
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: false
public java.lang.Boolean isEbsOptimized()
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: false
Default: false
public Request<RunInstancesRequest> getDryRunRequest()
getDryRunRequest
in interface DryRunSupportedRequest<RunInstancesRequest>
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public RunInstancesRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()