@Generated(value="software.amazon.awssdk:codegen") public final class RunInstancesRequest extends Ec2Request implements ToCopyableBuilder<RunInstancesRequest.Builder,RunInstancesRequest>
Contains the parameters for RunInstances.
Modifier and Type | Class and Description |
---|---|
static interface |
RunInstancesRequest.Builder |
Modifier and Type | Method and Description |
---|---|
String |
additionalInfo()
Reserved.
|
List<BlockDeviceMapping> |
blockDeviceMappings()
One or more block device mapping entries.
|
static RunInstancesRequest.Builder |
builder() |
String |
clientToken()
Unique, case-sensitive identifier you provide to ensure the idempotency of the request.
|
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. |
Boolean |
ebsOptimized()
Indicates whether the instance is optimized for Amazon EBS I/O.
|
List<ElasticGpuSpecification> |
elasticGpuSpecification()
An Elastic GPU to associate with the instance.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz)
Used to retrieve the value of a field from any class that extends
SdkRequest . |
int |
hashCode() |
IamInstanceProfileSpecification |
iamInstanceProfile()
The IAM instance profile.
|
String |
imageId()
The ID of the AMI, which you can get by calling DescribeImages.
|
ShutdownBehavior |
instanceInitiatedShutdownBehavior()
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
|
String |
instanceInitiatedShutdownBehaviorAsString()
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
|
InstanceType |
instanceType()
The instance type.
|
String |
instanceTypeAsString()
The instance type.
|
Integer |
ipv6AddressCount()
[EC2-VPC] A number of IPv6 addresses to associate with the primary network interface.
|
List<InstanceIpv6Address> |
ipv6Addresses()
[EC2-VPC] Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network
interface.
|
String |
kernelId()
The ID of the kernel.
|
String |
keyName()
The name of the key pair.
|
Integer |
maxCount()
The maximum number of instances to launch.
|
Integer |
minCount()
The minimum number of instances to launch.
|
Boolean |
monitoring()
The monitoring for the instance.
|
List<InstanceNetworkInterfaceSpecification> |
networkInterfaces()
One or more network interfaces.
|
Placement |
placement()
The placement for the instance.
|
String |
privateIpAddress()
[EC2-VPC] The primary IPv4 address.
|
String |
ramdiskId()
The ID of the RAM disk.
|
List<String> |
securityGroupIds()
One or more security group IDs.
|
List<String> |
securityGroups()
[EC2-Classic, default VPC] One or more security group names.
|
static Class<? extends RunInstancesRequest.Builder> |
serializableBuilderClass() |
String |
subnetId()
[EC2-VPC] The ID of the subnet to launch the instance into.
|
List<TagSpecification> |
tagSpecifications()
The tags to apply to the resources during launch.
|
RunInstancesRequest.Builder |
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.
|
String |
toString() |
String |
userData()
The user data to make available to the instance.
|
overrideConfiguration
copy
public List<BlockDeviceMapping> blockDeviceMappings()
One or more block device mapping entries. You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
public String imageId()
The ID of the AMI, which you can get by calling DescribeImages.
public InstanceType instanceType()
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
If the service returns an enum value that is not available in the current SDK version, instanceType
will
return InstanceType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
instanceTypeAsString()
.
Default: m1.small
InstanceType
public String instanceTypeAsString()
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
Default: m1.small
If the service returns an enum value that is not available in the current SDK version, instanceType
will
return InstanceType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available from
instanceTypeAsString()
.
Default: m1.small
InstanceType
public Integer ipv6AddressCount()
[EC2-VPC] A number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
public List<InstanceIpv6Address> ipv6Addresses()
[EC2-VPC] Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
public 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.
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 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.
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 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.
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 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.
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 Boolean monitoring()
The monitoring for the instance.
public Placement placement()
The placement for the instance.
public 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.
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 List<String> securityGroupIds()
One or more security group IDs. You can create a security group using CreateSecurityGroup.
Default: Amazon EC2 uses the default security group.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
Default: Amazon EC2 uses the default security group.
public List<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.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
Default: Amazon EC2 uses the default security group.
public String subnetId()
[EC2-VPC] The ID of the subnet to launch the instance into.
public String userData()
The user data to make available to the instance. For more information, see Running Commands on Your Linux Instance at Launch (Linux) and Adding User Data (Windows). If you are using a command line tool, base64-encoding is performed for you, and you can load the text from a file. Otherwise, you must provide base64-encoded text.
public String additionalInfo()
Reserved.
public 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
Constraints: Maximum 64 ASCII characters
public 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. To change this attribute to false
after launch, use
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. To change this attribute to false
after launch,
use 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 ebsOptimized()
Indicates whether the instance is optimized for Amazon 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
Default: false
public IamInstanceProfileSpecification iamInstanceProfile()
The IAM instance profile.
public 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
If the service returns an enum value that is not available in the current SDK version,
instanceInitiatedShutdownBehavior
will return ShutdownBehavior.UNKNOWN_TO_SDK_VERSION
. The raw
value returned by the service is available from instanceInitiatedShutdownBehaviorAsString()
.
Default: stop
ShutdownBehavior
public String instanceInitiatedShutdownBehaviorAsString()
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
If the service returns an enum value that is not available in the current SDK version,
instanceInitiatedShutdownBehavior
will return ShutdownBehavior.UNKNOWN_TO_SDK_VERSION
. The raw
value returned by the service is available from instanceInitiatedShutdownBehaviorAsString()
.
Default: stop
ShutdownBehavior
public List<InstanceNetworkInterfaceSpecification> networkInterfaces()
One or more network interfaces.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
public String privateIpAddress()
[EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.
Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.
Only one private IP address can be designated as primary. You can't specify this option if you've specified the option to designate a private IP address as the primary IP address in a network interface specification. You cannot specify this option if you're launching more than one instance in the request.
public List<ElasticGpuSpecification> elasticGpuSpecification()
An Elastic GPU to associate with the instance.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
public List<TagSpecification> tagSpecifications()
The tags to apply to the resources during launch. You can tag instances and volumes. The specified tags are applied to all instances or volumes that are created during launch.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
public RunInstancesRequest.Builder toBuilder()
ToCopyableBuilder
toBuilder
in interface ToCopyableBuilder<RunInstancesRequest.Builder,RunInstancesRequest>
toBuilder
in class Ec2Request
public static RunInstancesRequest.Builder builder()
public static Class<? extends RunInstancesRequest.Builder> serializableBuilderClass()
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
SdkRequest
SdkRequest
. The field name
specified should match the member name from the corresponding service-2.json model specified in the
codegen-resources folder for a given service. The class specifies what class to cast the returned value to.
If the returned value is also a modeled class, the SdkRequest.getValueForField(String, Class)
method will
again be available.getValueForField
in class SdkRequest
fieldName
- The name of the member to be retrieved.clazz
- The class to cast the returned object to.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.