@Generated(value="software.amazon.awssdk:codegen") public final class RunInstancesRequest extends Ec2Request implements ToCopyableBuilder<RunInstancesRequest.Builder,RunInstancesRequest>
| 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() |
CapacityReservationSpecification |
capacityReservationSpecification()
Information about the Capacity Reservation targeting option.
|
String |
clientToken()
Unique, case-sensitive identifier you provide to ensure the idempotency of the request.
|
CpuOptionsRequest |
cpuOptions()
The CPU options for the instance.
|
CreditSpecificationRequest |
creditSpecification()
The credit option for CPU usage of the instance.
|
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.
|
List<ElasticInferenceAccelerator> |
elasticInferenceAccelerators()
An elastic inference accelerator.
|
boolean |
equals(Object obj) |
<T> Optional<T> |
getValueForField(String fieldName,
Class<T> clazz) |
int |
hashCode() |
HibernationOptionsRequest |
hibernationOptions()
Indicates whether an instance is enabled for hibernation.
|
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).
|
InstanceMarketOptionsRequest |
instanceMarketOptions()
The market (purchasing) option for the instances.
|
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.
|
LaunchTemplateSpecification |
launchTemplate()
The launch template to use to launch the instances.
|
List<LicenseConfigurationRequest> |
licenseSpecifications()
The license configurations.
|
Integer |
maxCount()
The maximum number of instances to launch.
|
Integer |
minCount()
The minimum number of instances to launch.
|
RunInstancesMonitoringEnabled |
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<SdkField<?>> |
sdkFields() |
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() |
String |
toString()
Returns a string representation of this object.
|
String |
userData()
The user data to make available to the instance.
|
overrideConfigurationclone, finalize, getClass, notify, notifyAll, wait, wait, waitcopypublic 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. An AMI is required to launch an instance and must be specified here or in a launch template.
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
InstanceTypepublic 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
InstanceTypepublic 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.
You cannot specify this option and the network interfaces option in the same request.
You cannot specify this option and the network interfaces option in the same request.
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.
You cannot specify this option and the network interfaces option in the same request.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
You cannot specify this option and the network interfaces option in the same request.
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 RunInstancesMonitoringEnabled 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.
You cannot specify this option and the network interfaces option in the same request.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
Default: Amazon EC2 uses the default security group.
You cannot specify this option and the network interfaces option in the same request.
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.
You cannot specify this option and the network interfaces option in the same request.
Default: Amazon EC2 uses the default security group.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
You cannot specify this option and the network interfaces option in the same request.
Default: Amazon EC2 uses the default security group.
public String subnetId()
[EC2-VPC] The ID of the subnet to launch the instance into.
You cannot specify this option and the network interfaces option in the same request.
You cannot specify this option and the network interfaces option in the same request.
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
ShutdownBehaviorpublic 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
ShutdownBehaviorpublic List<InstanceNetworkInterfaceSpecification> networkInterfaces()
One or more network interfaces.
You cannot specify this option and the network interfaces option in the same request.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
You cannot specify this option and the network interfaces option in the same request.
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.
You cannot specify this option and the network interfaces option in the same 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.
You cannot specify this option and the network interfaces option in the same 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<ElasticInferenceAccelerator> elasticInferenceAccelerators()
An elastic inference accelerator.
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 only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
public LaunchTemplateSpecification launchTemplate()
The launch template to use to launch the instances. Any parameters that you specify in RunInstances override the same parameters in the launch template. You can specify either the name or ID of a launch template, but not both.
public InstanceMarketOptionsRequest instanceMarketOptions()
The market (purchasing) option for the instances.
For RunInstances, persistent Spot Instance requests are only supported when
InstanceInterruptionBehavior is set to either hibernate or stop.
For RunInstances, persistent Spot Instance requests are only supported when
InstanceInterruptionBehavior is set to either hibernate or stop.
public CreditSpecificationRequest creditSpecification()
The credit option for CPU usage of the instance. Valid values are standard and
unlimited. To change this attribute after launch, use ModifyInstanceCreditSpecification. For
more information, see Burstable
Performance Instances in the Amazon Elastic Compute Cloud User Guide.
Default: standard (T2 instances) or unlimited (T3 instances)
standard and
unlimited. To change this attribute after launch, use
ModifyInstanceCreditSpecification. For more information, see Burstable
Performance Instances in the Amazon Elastic Compute Cloud User Guide.
Default: standard (T2 instances) or unlimited (T3 instances)
public CpuOptionsRequest cpuOptions()
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide.
public CapacityReservationSpecification capacityReservationSpecification()
Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's
Capacity Reservation preference defaults to open, which enables it to run in any open Capacity
Reservation that has matching attributes (instance type, platform, Availability Zone).
open, which enables it to run in any
open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).public HibernationOptionsRequest hibernationOptions()
Indicates whether an instance is enabled for hibernation. For more information, see Hibernate Your Instance in the Amazon Elastic Compute Cloud User Guide.
public List<LicenseConfigurationRequest> licenseSpecifications()
The license configurations.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
public RunInstancesRequest.Builder toBuilder()
toBuilder in interface ToCopyableBuilder<RunInstancesRequest.Builder,RunInstancesRequest>toBuilder in class Ec2Requestpublic static RunInstancesRequest.Builder builder()
public static Class<? extends RunInstancesRequest.Builder> serializableBuilderClass()
public String toString()
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
getValueForField in class SdkRequestCopyright © 2019. All rights reserved.