Interface RunInstancesRequest.Builder
-
- All Superinterfaces:
AwsRequest.Builder
,Buildable
,CopyableBuilder<RunInstancesRequest.Builder,RunInstancesRequest>
,Ec2Request.Builder
,SdkBuilder<RunInstancesRequest.Builder,RunInstancesRequest>
,SdkPojo
,SdkRequest.Builder
- Enclosing class:
- RunInstancesRequest
public static interface RunInstancesRequest.Builder extends Ec2Request.Builder, SdkPojo, CopyableBuilder<RunInstancesRequest.Builder,RunInstancesRequest>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RunInstancesRequest.Builder
additionalInfo(String additionalInfo)
Reserved.RunInstancesRequest.Builder
blockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)
The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch.RunInstancesRequest.Builder
blockDeviceMappings(Consumer<BlockDeviceMapping.Builder>... blockDeviceMappings)
The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch.RunInstancesRequest.Builder
blockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch.default RunInstancesRequest.Builder
capacityReservationSpecification(Consumer<CapacityReservationSpecification.Builder> capacityReservationSpecification)
Information about the Capacity Reservation targeting option.RunInstancesRequest.Builder
capacityReservationSpecification(CapacityReservationSpecification capacityReservationSpecification)
Information about the Capacity Reservation targeting option.RunInstancesRequest.Builder
clientToken(String clientToken)
Unique, case-sensitive identifier you provide to ensure the idempotency of the request.default RunInstancesRequest.Builder
cpuOptions(Consumer<CpuOptionsRequest.Builder> cpuOptions)
The CPU options for the instance.RunInstancesRequest.Builder
cpuOptions(CpuOptionsRequest cpuOptions)
The CPU options for the instance.default RunInstancesRequest.Builder
creditSpecification(Consumer<CreditSpecificationRequest.Builder> creditSpecification)
The credit option for CPU usage of the burstable performance instance.RunInstancesRequest.Builder
creditSpecification(CreditSpecificationRequest creditSpecification)
The credit option for CPU usage of the burstable performance instance.RunInstancesRequest.Builder
disableApiStop(Boolean disableApiStop)
Indicates whether an instance is enabled for stop protection.RunInstancesRequest.Builder
disableApiTermination(Boolean disableApiTermination)
If you set this parameter totrue
, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can.RunInstancesRequest.Builder
dryRun(Boolean dryRun)
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response.RunInstancesRequest.Builder
ebsOptimized(Boolean ebsOptimized)
Indicates whether the instance is optimized for Amazon EBS I/O.RunInstancesRequest.Builder
elasticGpuSpecification(Collection<ElasticGpuSpecification> elasticGpuSpecification)
Deprecated.RunInstancesRequest.Builder
elasticGpuSpecification(Consumer<ElasticGpuSpecification.Builder>... elasticGpuSpecification)
Deprecated.RunInstancesRequest.Builder
elasticGpuSpecification(ElasticGpuSpecification... elasticGpuSpecification)
Deprecated.RunInstancesRequest.Builder
elasticInferenceAccelerators(Collection<ElasticInferenceAccelerator> elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance.RunInstancesRequest.Builder
elasticInferenceAccelerators(Consumer<ElasticInferenceAccelerator.Builder>... elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance.RunInstancesRequest.Builder
elasticInferenceAccelerators(ElasticInferenceAccelerator... elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance.RunInstancesRequest.Builder
enablePrimaryIpv6(Boolean enablePrimaryIpv6)
If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address.default RunInstancesRequest.Builder
enclaveOptions(Consumer<EnclaveOptionsRequest.Builder> enclaveOptions)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.RunInstancesRequest.Builder
enclaveOptions(EnclaveOptionsRequest enclaveOptions)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.default RunInstancesRequest.Builder
hibernationOptions(Consumer<HibernationOptionsRequest.Builder> hibernationOptions)
Indicates whether an instance is enabled for hibernation.RunInstancesRequest.Builder
hibernationOptions(HibernationOptionsRequest hibernationOptions)
Indicates whether an instance is enabled for hibernation.default RunInstancesRequest.Builder
iamInstanceProfile(Consumer<IamInstanceProfileSpecification.Builder> iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.RunInstancesRequest.Builder
iamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.RunInstancesRequest.Builder
imageId(String imageId)
The ID of the AMI.RunInstancesRequest.Builder
instanceInitiatedShutdownBehavior(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.Builder
instanceInitiatedShutdownBehavior(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 RunInstancesRequest.Builder
instanceMarketOptions(Consumer<InstanceMarketOptionsRequest.Builder> instanceMarketOptions)
The market (purchasing) option for the instances.RunInstancesRequest.Builder
instanceMarketOptions(InstanceMarketOptionsRequest instanceMarketOptions)
The market (purchasing) option for the instances.RunInstancesRequest.Builder
instanceType(String instanceType)
The instance type.RunInstancesRequest.Builder
instanceType(InstanceType instanceType)
The instance type.RunInstancesRequest.Builder
ipv6AddressCount(Integer ipv6AddressCount)
The number of IPv6 addresses to associate with the primary network interface.RunInstancesRequest.Builder
ipv6Addresses(Collection<InstanceIpv6Address> ipv6Addresses)
The IPv6 addresses from the range of the subnet to associate with the primary network interface.RunInstancesRequest.Builder
ipv6Addresses(Consumer<InstanceIpv6Address.Builder>... ipv6Addresses)
The IPv6 addresses from the range of the subnet to associate with the primary network interface.RunInstancesRequest.Builder
ipv6Addresses(InstanceIpv6Address... ipv6Addresses)
The IPv6 addresses from the range of the subnet to associate with the primary network interface.RunInstancesRequest.Builder
kernelId(String kernelId)
The ID of the kernel.RunInstancesRequest.Builder
keyName(String keyName)
The name of the key pair.default RunInstancesRequest.Builder
launchTemplate(Consumer<LaunchTemplateSpecification.Builder> launchTemplate)
The launch template to use to launch the instances.RunInstancesRequest.Builder
launchTemplate(LaunchTemplateSpecification launchTemplate)
The launch template to use to launch the instances.RunInstancesRequest.Builder
licenseSpecifications(Collection<LicenseConfigurationRequest> licenseSpecifications)
The license configurations.RunInstancesRequest.Builder
licenseSpecifications(Consumer<LicenseConfigurationRequest.Builder>... licenseSpecifications)
The license configurations.RunInstancesRequest.Builder
licenseSpecifications(LicenseConfigurationRequest... licenseSpecifications)
The license configurations.default RunInstancesRequest.Builder
maintenanceOptions(Consumer<InstanceMaintenanceOptionsRequest.Builder> maintenanceOptions)
The maintenance and recovery options for the instance.RunInstancesRequest.Builder
maintenanceOptions(InstanceMaintenanceOptionsRequest maintenanceOptions)
The maintenance and recovery options for the instance.RunInstancesRequest.Builder
maxCount(Integer maxCount)
The maximum number of instances to launch.default RunInstancesRequest.Builder
metadataOptions(Consumer<InstanceMetadataOptionsRequest.Builder> metadataOptions)
The metadata options for the instance.RunInstancesRequest.Builder
metadataOptions(InstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance.RunInstancesRequest.Builder
minCount(Integer minCount)
The minimum number of instances to launch.default RunInstancesRequest.Builder
monitoring(Consumer<RunInstancesMonitoringEnabled.Builder> monitoring)
Specifies whether detailed monitoring is enabled for the instance.RunInstancesRequest.Builder
monitoring(RunInstancesMonitoringEnabled monitoring)
Specifies whether detailed monitoring is enabled for the instance.RunInstancesRequest.Builder
networkInterfaces(Collection<InstanceNetworkInterfaceSpecification> networkInterfaces)
The network interfaces to associate with the instance.RunInstancesRequest.Builder
networkInterfaces(Consumer<InstanceNetworkInterfaceSpecification.Builder>... networkInterfaces)
The network interfaces to associate with the instance.RunInstancesRequest.Builder
networkInterfaces(InstanceNetworkInterfaceSpecification... networkInterfaces)
The network interfaces to associate with the instance.RunInstancesRequest.Builder
overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)
RunInstancesRequest.Builder
overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
default RunInstancesRequest.Builder
placement(Consumer<Placement.Builder> placement)
The placement for the instance.RunInstancesRequest.Builder
placement(Placement placement)
The placement for the instance.default RunInstancesRequest.Builder
privateDnsNameOptions(Consumer<PrivateDnsNameOptionsRequest.Builder> privateDnsNameOptions)
The options for the instance hostname.RunInstancesRequest.Builder
privateDnsNameOptions(PrivateDnsNameOptionsRequest privateDnsNameOptions)
The options for the instance hostname.RunInstancesRequest.Builder
privateIpAddress(String privateIpAddress)
The primary IPv4 address.RunInstancesRequest.Builder
ramdiskId(String ramdiskId)
The ID of the RAM disk to select.RunInstancesRequest.Builder
securityGroupIds(String... securityGroupIds)
The IDs of the security groups.RunInstancesRequest.Builder
securityGroupIds(Collection<String> securityGroupIds)
The IDs of the security groups.RunInstancesRequest.Builder
securityGroups(String... securityGroups)
[Default VPC] The names of the security groups.RunInstancesRequest.Builder
securityGroups(Collection<String> securityGroups)
[Default VPC] The names of the security groups.RunInstancesRequest.Builder
subnetId(String subnetId)
The ID of the subnet to launch the instance into.RunInstancesRequest.Builder
tagSpecifications(Collection<TagSpecification> tagSpecifications)
The tags to apply to the resources that are created during instance launch.RunInstancesRequest.Builder
tagSpecifications(Consumer<TagSpecification.Builder>... tagSpecifications)
The tags to apply to the resources that are created during instance launch.RunInstancesRequest.Builder
tagSpecifications(TagSpecification... tagSpecifications)
The tags to apply to the resources that are created during instance launch.RunInstancesRequest.Builder
userData(String userData)
The user data script to make available to the instance.-
Methods inherited from interface software.amazon.awssdk.awscore.AwsRequest.Builder
overrideConfiguration
-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.services.ec2.model.Ec2Request.Builder
build
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
-
-
-
Method Detail
-
blockDeviceMappings
RunInstancesRequest.Builder blockDeviceMappings(Collection<BlockDeviceMapping> blockDeviceMappings)
The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see Block device mappings in the Amazon EC2 User Guide.
- Parameters:
blockDeviceMappings
- The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see Block device mappings in the Amazon EC2 User Guide.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
blockDeviceMappings
RunInstancesRequest.Builder blockDeviceMappings(BlockDeviceMapping... blockDeviceMappings)
The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see Block device mappings in the Amazon EC2 User Guide.
- Parameters:
blockDeviceMappings
- The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see Block device mappings in the Amazon EC2 User Guide.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
blockDeviceMappings
RunInstancesRequest.Builder blockDeviceMappings(Consumer<BlockDeviceMapping.Builder>... blockDeviceMappings)
The block device mapping, which defines the EBS volumes and instance store volumes to attach to the instance at launch. For more information, see Block device mappings in the Amazon EC2 User Guide.
This is a convenience method that creates an instance of theBlockDeviceMapping.Builder
avoiding the need to create one manually viaBlockDeviceMapping.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#blockDeviceMappings(List
.) - Parameters:
blockDeviceMappings
- a consumer that will call methods onBlockDeviceMapping.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#blockDeviceMappings(java.util.Collection
)
-
imageId
RunInstancesRequest.Builder imageId(String imageId)
The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.
- Parameters:
imageId
- The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
instanceType
RunInstancesRequest.Builder instanceType(String instanceType)
The instance type. For more information, see Instance types in the Amazon EC2 User Guide.
- Parameters:
instanceType
- The instance type. For more information, see Instance types in the Amazon EC2 User Guide.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
InstanceType
,InstanceType
-
instanceType
RunInstancesRequest.Builder instanceType(InstanceType instanceType)
The instance type. For more information, see Instance types in the Amazon EC2 User Guide.
- Parameters:
instanceType
- The instance type. For more information, see Instance types in the Amazon EC2 User Guide.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
InstanceType
,InstanceType
-
ipv6AddressCount
RunInstancesRequest.Builder ipv6AddressCount(Integer ipv6AddressCount)
The 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.
- Parameters:
ipv6AddressCount
- The 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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
ipv6Addresses
RunInstancesRequest.Builder ipv6Addresses(Collection<InstanceIpv6Address> ipv6Addresses)
The 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.
- Parameters:
ipv6Addresses
- The 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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
ipv6Addresses
RunInstancesRequest.Builder ipv6Addresses(InstanceIpv6Address... ipv6Addresses)
The 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.
- Parameters:
ipv6Addresses
- The 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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
ipv6Addresses
RunInstancesRequest.Builder ipv6Addresses(Consumer<InstanceIpv6Address.Builder>... ipv6Addresses)
The 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.
This is a convenience method that creates an instance of theInstanceIpv6Address.Builder
avoiding the need to create one manually viaInstanceIpv6Address.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#ipv6Addresses(List
.) - Parameters:
ipv6Addresses
- a consumer that will call methods onInstanceIpv6Address.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#ipv6Addresses(java.util.Collection
)
-
kernelId
RunInstancesRequest.Builder kernelId(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 EC2 User Guide.
- Parameters:
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 EC2 User Guide.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
keyName
RunInstancesRequest.Builder keyName(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.
- Parameters:
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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
maxCount
RunInstancesRequest.Builder maxCount(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.
- 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 aboveMinCount
.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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
minCount
RunInstancesRequest.Builder minCount(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.
- 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:
- Returns a reference to this object so that method calls can be chained together.
-
monitoring
RunInstancesRequest.Builder monitoring(RunInstancesMonitoringEnabled monitoring)
Specifies whether detailed monitoring is enabled for the instance.
- Parameters:
monitoring
- Specifies whether detailed monitoring is enabled for the instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
monitoring
default RunInstancesRequest.Builder monitoring(Consumer<RunInstancesMonitoringEnabled.Builder> monitoring)
Specifies whether detailed monitoring is enabled for the instance.
This is a convenience method that creates an instance of theRunInstancesMonitoringEnabled.Builder
avoiding the need to create one manually viaRunInstancesMonitoringEnabled.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tomonitoring(RunInstancesMonitoringEnabled)
.- Parameters:
monitoring
- a consumer that will call methods onRunInstancesMonitoringEnabled.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
monitoring(RunInstancesMonitoringEnabled)
-
placement
RunInstancesRequest.Builder placement(Placement placement)
The placement for the instance.
- Parameters:
placement
- The placement for the instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
placement
default RunInstancesRequest.Builder placement(Consumer<Placement.Builder> placement)
The placement for the instance.
This is a convenience method that creates an instance of thePlacement.Builder
avoiding the need to create one manually viaPlacement.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toplacement(Placement)
.- Parameters:
placement
- a consumer that will call methods onPlacement.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
placement(Placement)
-
ramdiskId
RunInstancesRequest.Builder ramdiskId(String ramdiskId)
The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide.
- Parameters:
ramdiskId
- The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, go to the Amazon Web Services Resource Center and search for the kernel ID.We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see PV-GRUB in the Amazon EC2 User Guide.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
securityGroupIds
RunInstancesRequest.Builder securityGroupIds(Collection<String> securityGroupIds)
The IDs of the security groups. You can create a security group using CreateSecurityGroup.
If you specify a network interface, you must specify any security groups as part of the network interface.
- Parameters:
securityGroupIds
- The IDs of the security groups. You can create a security group using CreateSecurityGroup.If you specify a network interface, you must specify any security groups as part of the network interface.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
securityGroupIds
RunInstancesRequest.Builder securityGroupIds(String... securityGroupIds)
The IDs of the security groups. You can create a security group using CreateSecurityGroup.
If you specify a network interface, you must specify any security groups as part of the network interface.
- Parameters:
securityGroupIds
- The IDs of the security groups. You can create a security group using CreateSecurityGroup.If you specify a network interface, you must specify any security groups as part of the network interface.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
securityGroups
RunInstancesRequest.Builder securityGroups(Collection<String> securityGroups)
[Default VPC] The names of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface.
Default: Amazon EC2 uses the default security group.
- Parameters:
securityGroups
- [Default VPC] The names of the security groups.If you specify a network interface, you must specify any security groups as part of the network interface.
Default: Amazon EC2 uses the default security group.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
securityGroups
RunInstancesRequest.Builder securityGroups(String... securityGroups)
[Default VPC] The names of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface.
Default: Amazon EC2 uses the default security group.
- Parameters:
securityGroups
- [Default VPC] The names of the security groups.If you specify a network interface, you must specify any security groups as part of the network interface.
Default: Amazon EC2 uses the default security group.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
subnetId
RunInstancesRequest.Builder subnetId(String subnetId)
The ID of the subnet to launch the instance into.
If you specify a network interface, you must specify any subnets as part of the network interface.
- Parameters:
subnetId
- The ID of the subnet to launch the instance into.If you specify a network interface, you must specify any subnets as part of the network interface.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
userData
RunInstancesRequest.Builder userData(String userData)
The user data script to make available to the instance. For more information, see Run commands on your Linux instance at launch and Run commands on your Windows instance at launch. 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. User data is limited to 16 KB.
- Parameters:
userData
- The user data script to make available to the instance. For more information, see Run commands on your Linux instance at launch and Run commands on your Windows instance at launch. 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. User data is limited to 16 KB.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
additionalInfo
RunInstancesRequest.Builder additionalInfo(String additionalInfo)
Reserved.
- Parameters:
additionalInfo
- Reserved.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
clientToken
RunInstancesRequest.Builder clientToken(String clientToken)
Unique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.
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. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.For more information, see Ensuring Idempotency.
Constraints: Maximum 64 ASCII characters
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
disableApiTermination
RunInstancesRequest.Builder disableApiTermination(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 after launch, use ModifyInstanceAttribute. Alternatively, if you setInstanceInitiatedShutdownBehavior
toterminate
, you can terminate the instance by running the shutdown command from the instance.Default:
false
- Parameters:
disableApiTermination
- If you set this parameter totrue
, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute. Alternatively, if you setInstanceInitiatedShutdownBehavior
toterminate
, you can terminate the instance by running the shutdown command from the instance.Default:
false
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
dryRun
RunInstancesRequest.Builder dryRun(Boolean dryRun)
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation
. Otherwise, it isUnauthorizedOperation
.- Parameters:
dryRun
- Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response isDryRunOperation
. Otherwise, it isUnauthorizedOperation
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
ebsOptimized
RunInstancesRequest.Builder ebsOptimized(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
- Parameters:
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
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
iamInstanceProfile
RunInstancesRequest.Builder iamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.
- Parameters:
iamInstanceProfile
- The name or Amazon Resource Name (ARN) of an IAM instance profile.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
iamInstanceProfile
default RunInstancesRequest.Builder iamInstanceProfile(Consumer<IamInstanceProfileSpecification.Builder> iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.
This is a convenience method that creates an instance of theIamInstanceProfileSpecification.Builder
avoiding the need to create one manually viaIamInstanceProfileSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toiamInstanceProfile(IamInstanceProfileSpecification)
.- Parameters:
iamInstanceProfile
- a consumer that will call methods onIamInstanceProfileSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
iamInstanceProfile(IamInstanceProfileSpecification)
-
instanceInitiatedShutdownBehavior
RunInstancesRequest.Builder instanceInitiatedShutdownBehavior(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
- 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:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
ShutdownBehavior
,ShutdownBehavior
-
instanceInitiatedShutdownBehavior
RunInstancesRequest.Builder instanceInitiatedShutdownBehavior(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
- 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:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
ShutdownBehavior
,ShutdownBehavior
-
networkInterfaces
RunInstancesRequest.Builder networkInterfaces(Collection<InstanceNetworkInterfaceSpecification> networkInterfaces)
The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
- Parameters:
networkInterfaces
- The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
networkInterfaces
RunInstancesRequest.Builder networkInterfaces(InstanceNetworkInterfaceSpecification... networkInterfaces)
The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
- Parameters:
networkInterfaces
- The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
networkInterfaces
RunInstancesRequest.Builder networkInterfaces(Consumer<InstanceNetworkInterfaceSpecification.Builder>... networkInterfaces)
The network interfaces to associate with the instance. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
This is a convenience method that creates an instance of theInstanceNetworkInterfaceSpecification.Builder
avoiding the need to create one manually viaInstanceNetworkInterfaceSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#networkInterfaces(List
.) - Parameters:
networkInterfaces
- a consumer that will call methods onInstanceNetworkInterfaceSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#networkInterfaces(java.util.Collection
)
-
privateIpAddress
RunInstancesRequest.Builder privateIpAddress(String privateIpAddress)
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.
- Parameters:
privateIpAddress
- 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.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
elasticGpuSpecification
RunInstancesRequest.Builder elasticGpuSpecification(Collection<ElasticGpuSpecification> elasticGpuSpecification)
Deprecated.
Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
- Parameters:
elasticGpuSpecification
- Deprecated.Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
elasticGpuSpecification
RunInstancesRequest.Builder elasticGpuSpecification(ElasticGpuSpecification... elasticGpuSpecification)
Deprecated.
Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
- Parameters:
elasticGpuSpecification
- Deprecated.Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
elasticGpuSpecification
RunInstancesRequest.Builder elasticGpuSpecification(Consumer<ElasticGpuSpecification.Builder>... elasticGpuSpecification)
Deprecated.
Amazon Elastic Graphics reached end of life on January 8, 2024. For workloads that require graphics acceleration, we recommend that you use Amazon EC2 G4ad, G4dn, or G5 instances.
ElasticGpuSpecification.Builder
avoiding the need to create one manually viaElasticGpuSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#elasticGpuSpecification(List
.) - Parameters:
elasticGpuSpecification
- a consumer that will call methods onElasticGpuSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#elasticGpuSpecification(java.util.Collection
)
-
elasticInferenceAccelerators
RunInstancesRequest.Builder elasticInferenceAccelerators(Collection<ElasticInferenceAccelerator> elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
You cannot specify accelerators from different generations in the same request.
Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
- Parameters:
elasticInferenceAccelerators
- An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.You cannot specify accelerators from different generations in the same request.
Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
elasticInferenceAccelerators
RunInstancesRequest.Builder elasticInferenceAccelerators(ElasticInferenceAccelerator... elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
You cannot specify accelerators from different generations in the same request.
Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
- Parameters:
elasticInferenceAccelerators
- An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.You cannot specify accelerators from different generations in the same request.
Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
elasticInferenceAccelerators
RunInstancesRequest.Builder elasticInferenceAccelerators(Consumer<ElasticInferenceAccelerator.Builder>... elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance. Elastic inference accelerators are a resource you can attach to your Amazon EC2 instances to accelerate your Deep Learning (DL) inference workloads.
You cannot specify accelerators from different generations in the same request.
Starting April 15, 2023, Amazon Web Services will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS, or Amazon EC2. However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service.
ElasticInferenceAccelerator.Builder
avoiding the need to create one manually viaElasticInferenceAccelerator.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#elasticInferenceAccelerators(List
.) - Parameters:
elasticInferenceAccelerators
- a consumer that will call methods onElasticInferenceAccelerator.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#elasticInferenceAccelerators(java.util.Collection
)
-
tagSpecifications
RunInstancesRequest.Builder tagSpecifications(Collection<TagSpecification> tagSpecifications)
The tags to apply to the resources that are created during instance launch.
You can specify tags for the following resources only:
-
Instances
-
Volumes
-
Spot Instance requests
-
Network interfaces
To tag a resource after it has been created, see CreateTags.
- Parameters:
tagSpecifications
- The tags to apply to the resources that are created during instance launch.You can specify tags for the following resources only:
-
Instances
-
Volumes
-
Spot Instance requests
-
Network interfaces
To tag a resource after it has been created, see CreateTags.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
tagSpecifications
RunInstancesRequest.Builder tagSpecifications(TagSpecification... tagSpecifications)
The tags to apply to the resources that are created during instance launch.
You can specify tags for the following resources only:
-
Instances
-
Volumes
-
Spot Instance requests
-
Network interfaces
To tag a resource after it has been created, see CreateTags.
- Parameters:
tagSpecifications
- The tags to apply to the resources that are created during instance launch.You can specify tags for the following resources only:
-
Instances
-
Volumes
-
Spot Instance requests
-
Network interfaces
To tag a resource after it has been created, see CreateTags.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
tagSpecifications
RunInstancesRequest.Builder tagSpecifications(Consumer<TagSpecification.Builder>... tagSpecifications)
The tags to apply to the resources that are created during instance launch.
You can specify tags for the following resources only:
-
Instances
-
Volumes
-
Spot Instance requests
-
Network interfaces
To tag a resource after it has been created, see CreateTags.
This is a convenience method that creates an instance of theTagSpecification.Builder
avoiding the need to create one manually viaTagSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#tagSpecifications(List
.) - Parameters:
tagSpecifications
- a consumer that will call methods onTagSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#tagSpecifications(java.util.Collection
)
-
-
launchTemplate
RunInstancesRequest.Builder launchTemplate(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.
- Parameters:
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.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
launchTemplate
default RunInstancesRequest.Builder launchTemplate(Consumer<LaunchTemplateSpecification.Builder> 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.
This is a convenience method that creates an instance of theLaunchTemplateSpecification.Builder
avoiding the need to create one manually viaLaunchTemplateSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tolaunchTemplate(LaunchTemplateSpecification)
.- Parameters:
launchTemplate
- a consumer that will call methods onLaunchTemplateSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
launchTemplate(LaunchTemplateSpecification)
-
instanceMarketOptions
RunInstancesRequest.Builder instanceMarketOptions(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
orstop
.- Parameters:
instanceMarketOptions
- The market (purchasing) option for the instances.For RunInstances, persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either
hibernate
orstop
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
instanceMarketOptions
default RunInstancesRequest.Builder instanceMarketOptions(Consumer<InstanceMarketOptionsRequest.Builder> instanceMarketOptions)
The market (purchasing) option for the instances.
For RunInstances, persistent Spot Instance requests are only supported when InstanceInterruptionBehavior is set to either
This is a convenience method that creates an instance of thehibernate
orstop
.InstanceMarketOptionsRequest.Builder
avoiding the need to create one manually viaInstanceMarketOptionsRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toinstanceMarketOptions(InstanceMarketOptionsRequest)
.- Parameters:
instanceMarketOptions
- a consumer that will call methods onInstanceMarketOptionsRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
instanceMarketOptions(InstanceMarketOptionsRequest)
-
creditSpecification
RunInstancesRequest.Builder creditSpecification(CreditSpecificationRequest creditSpecification)
The credit option for CPU usage of the burstable performance instance. Valid values are
standard
andunlimited
. To change this attribute after launch, use ModifyInstanceCreditSpecification. For more information, see Burstable performance instances in the Amazon EC2 User Guide.Default:
standard
(T2 instances) orunlimited
(T3/T3a/T4g instances)For T3 instances with
host
tenancy, onlystandard
is supported.- Parameters:
creditSpecification
- The credit option for CPU usage of the burstable performance instance. Valid values arestandard
andunlimited
. To change this attribute after launch, use ModifyInstanceCreditSpecification. For more information, see Burstable performance instances in the Amazon EC2 User Guide.Default:
standard
(T2 instances) orunlimited
(T3/T3a/T4g instances)For T3 instances with
host
tenancy, onlystandard
is supported.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
creditSpecification
default RunInstancesRequest.Builder creditSpecification(Consumer<CreditSpecificationRequest.Builder> creditSpecification)
The credit option for CPU usage of the burstable performance instance. Valid values are
standard
andunlimited
. To change this attribute after launch, use ModifyInstanceCreditSpecification. For more information, see Burstable performance instances in the Amazon EC2 User Guide.Default:
standard
(T2 instances) orunlimited
(T3/T3a/T4g instances)For T3 instances with
This is a convenience method that creates an instance of thehost
tenancy, onlystandard
is supported.CreditSpecificationRequest.Builder
avoiding the need to create one manually viaCreditSpecificationRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tocreditSpecification(CreditSpecificationRequest)
.- Parameters:
creditSpecification
- a consumer that will call methods onCreditSpecificationRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
creditSpecification(CreditSpecificationRequest)
-
cpuOptions
RunInstancesRequest.Builder cpuOptions(CpuOptionsRequest cpuOptions)
The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide.
- Parameters:
cpuOptions
- The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
cpuOptions
default RunInstancesRequest.Builder cpuOptions(Consumer<CpuOptionsRequest.Builder> cpuOptions)
The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide.
This is a convenience method that creates an instance of theCpuOptionsRequest.Builder
avoiding the need to create one manually viaCpuOptionsRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tocpuOptions(CpuOptionsRequest)
.- Parameters:
cpuOptions
- a consumer that will call methods onCpuOptionsRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
cpuOptions(CpuOptionsRequest)
-
capacityReservationSpecification
RunInstancesRequest.Builder capacityReservationSpecification(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).- Parameters:
capacityReservationSpecification
- Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults toopen
, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
capacityReservationSpecification
default RunInstancesRequest.Builder capacityReservationSpecification(Consumer<CapacityReservationSpecification.Builder> capacityReservationSpecification)
Information about the Capacity Reservation targeting option. If you do not specify this parameter, the instance's Capacity Reservation preference defaults to
This is a convenience method that creates an instance of theopen
, which enables it to run in any open Capacity Reservation that has matching attributes (instance type, platform, Availability Zone).CapacityReservationSpecification.Builder
avoiding the need to create one manually viaCapacityReservationSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tocapacityReservationSpecification(CapacityReservationSpecification)
.- Parameters:
capacityReservationSpecification
- a consumer that will call methods onCapacityReservationSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
capacityReservationSpecification(CapacityReservationSpecification)
-
hibernationOptions
RunInstancesRequest.Builder hibernationOptions(HibernationOptionsRequest hibernationOptions)
Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites. For more information, see Hibernate your instance in the Amazon EC2 User Guide.
You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.
- Parameters:
hibernationOptions
- Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites. For more information, see Hibernate your instance in the Amazon EC2 User Guide.You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
hibernationOptions
default RunInstancesRequest.Builder hibernationOptions(Consumer<HibernationOptionsRequest.Builder> hibernationOptions)
Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the hibernation prerequisites. For more information, see Hibernate your instance in the Amazon EC2 User Guide.
You can't enable hibernation and Amazon Web Services Nitro Enclaves on the same instance.
This is a convenience method that creates an instance of theHibernationOptionsRequest.Builder
avoiding the need to create one manually viaHibernationOptionsRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tohibernationOptions(HibernationOptionsRequest)
.- Parameters:
hibernationOptions
- a consumer that will call methods onHibernationOptionsRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
hibernationOptions(HibernationOptionsRequest)
-
licenseSpecifications
RunInstancesRequest.Builder licenseSpecifications(Collection<LicenseConfigurationRequest> licenseSpecifications)
The license configurations.
- Parameters:
licenseSpecifications
- The license configurations.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
licenseSpecifications
RunInstancesRequest.Builder licenseSpecifications(LicenseConfigurationRequest... licenseSpecifications)
The license configurations.
- Parameters:
licenseSpecifications
- The license configurations.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
licenseSpecifications
RunInstancesRequest.Builder licenseSpecifications(Consumer<LicenseConfigurationRequest.Builder>... licenseSpecifications)
The license configurations.
This is a convenience method that creates an instance of theLicenseConfigurationRequest.Builder
avoiding the need to create one manually viaLicenseConfigurationRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#licenseSpecifications(List
.) - Parameters:
licenseSpecifications
- a consumer that will call methods onLicenseConfigurationRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#licenseSpecifications(java.util.Collection
)
-
metadataOptions
RunInstancesRequest.Builder metadataOptions(InstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance. For more information, see Instance metadata and user data.
- Parameters:
metadataOptions
- The metadata options for the instance. For more information, see Instance metadata and user data.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
metadataOptions
default RunInstancesRequest.Builder metadataOptions(Consumer<InstanceMetadataOptionsRequest.Builder> metadataOptions)
The metadata options for the instance. For more information, see Instance metadata and user data.
This is a convenience method that creates an instance of theInstanceMetadataOptionsRequest.Builder
avoiding the need to create one manually viaInstanceMetadataOptionsRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tometadataOptions(InstanceMetadataOptionsRequest)
.- Parameters:
metadataOptions
- a consumer that will call methods onInstanceMetadataOptionsRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
metadataOptions(InstanceMetadataOptionsRequest)
-
enclaveOptions
RunInstancesRequest.Builder enclaveOptions(EnclaveOptionsRequest enclaveOptions)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro Enclaves? in the Amazon Web Services Nitro Enclaves User Guide.
You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.
- Parameters:
enclaveOptions
- Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro Enclaves? in the Amazon Web Services Nitro Enclaves User Guide.You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
enclaveOptions
default RunInstancesRequest.Builder enclaveOptions(Consumer<EnclaveOptionsRequest.Builder> enclaveOptions)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves. For more information, see What is Amazon Web Services Nitro Enclaves? in the Amazon Web Services Nitro Enclaves User Guide.
You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.
This is a convenience method that creates an instance of theEnclaveOptionsRequest.Builder
avoiding the need to create one manually viaEnclaveOptionsRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toenclaveOptions(EnclaveOptionsRequest)
.- Parameters:
enclaveOptions
- a consumer that will call methods onEnclaveOptionsRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
enclaveOptions(EnclaveOptionsRequest)
-
privateDnsNameOptions
RunInstancesRequest.Builder privateDnsNameOptions(PrivateDnsNameOptionsRequest privateDnsNameOptions)
The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.
- Parameters:
privateDnsNameOptions
- The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
privateDnsNameOptions
default RunInstancesRequest.Builder privateDnsNameOptions(Consumer<PrivateDnsNameOptionsRequest.Builder> privateDnsNameOptions)
The options for the instance hostname. The default values are inherited from the subnet. Applies only if creating a network interface, not attaching an existing one.
This is a convenience method that creates an instance of thePrivateDnsNameOptionsRequest.Builder
avoiding the need to create one manually viaPrivateDnsNameOptionsRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed toprivateDnsNameOptions(PrivateDnsNameOptionsRequest)
.- Parameters:
privateDnsNameOptions
- a consumer that will call methods onPrivateDnsNameOptionsRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
privateDnsNameOptions(PrivateDnsNameOptionsRequest)
-
maintenanceOptions
RunInstancesRequest.Builder maintenanceOptions(InstanceMaintenanceOptionsRequest maintenanceOptions)
The maintenance and recovery options for the instance.
- Parameters:
maintenanceOptions
- The maintenance and recovery options for the instance.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
maintenanceOptions
default RunInstancesRequest.Builder maintenanceOptions(Consumer<InstanceMaintenanceOptionsRequest.Builder> maintenanceOptions)
The maintenance and recovery options for the instance.
This is a convenience method that creates an instance of theInstanceMaintenanceOptionsRequest.Builder
avoiding the need to create one manually viaInstanceMaintenanceOptionsRequest.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tomaintenanceOptions(InstanceMaintenanceOptionsRequest)
.- Parameters:
maintenanceOptions
- a consumer that will call methods onInstanceMaintenanceOptionsRequest.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
maintenanceOptions(InstanceMaintenanceOptionsRequest)
-
disableApiStop
RunInstancesRequest.Builder disableApiStop(Boolean disableApiStop)
Indicates whether an instance is enabled for stop protection. For more information, see Stop protection.
- Parameters:
disableApiStop
- Indicates whether an instance is enabled for stop protection. For more information, see Stop protection.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
enablePrimaryIpv6
RunInstancesRequest.Builder enablePrimaryIpv6(Boolean enablePrimaryIpv6)
If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.
- Parameters:
enablePrimaryIpv6
- If you’re launching an instance into a dual-stack or IPv6-only subnet, you can enable assigning a primary IPv6 address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if an instance relies on its IPv6 address not changing. When you launch the instance, Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
overrideConfiguration
RunInstancesRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
-
overrideConfiguration
RunInstancesRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)
- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
-
-