@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class RequestLaunchTemplateData extends Object implements Serializable, Cloneable
The information to include in the launch template.
You must specify at least one parameter for the launch template data.
Constructor and Description |
---|
RequestLaunchTemplateData() |
Modifier and Type | Method and Description |
---|---|
RequestLaunchTemplateData |
clone() |
boolean |
equals(Object obj) |
List<LaunchTemplateBlockDeviceMappingRequest> |
getBlockDeviceMappings()
The block device mapping.
|
LaunchTemplateCapacityReservationSpecificationRequest |
getCapacityReservationSpecification()
The Capacity Reservation targeting option.
|
LaunchTemplateCpuOptionsRequest |
getCpuOptions()
The CPU options for the instance.
|
CreditSpecificationRequest |
getCreditSpecification()
The credit option for CPU usage of the instance.
|
Boolean |
getDisableApiStop()
Indicates whether to enable the instance for stop protection.
|
Boolean |
getDisableApiTermination()
If you set this parameter to
true , you can't terminate the instance using the Amazon EC2 console,
CLI, or API; otherwise, you can. |
Boolean |
getEbsOptimized()
Indicates whether the instance is optimized for Amazon EBS I/O.
|
List<ElasticGpuSpecification> |
getElasticGpuSpecifications()
Deprecated.
|
List<LaunchTemplateElasticInferenceAccelerator> |
getElasticInferenceAccelerators()
An elastic inference accelerator to associate with the instance.
|
LaunchTemplateEnclaveOptionsRequest |
getEnclaveOptions()
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
|
LaunchTemplateHibernationOptionsRequest |
getHibernationOptions()
Indicates whether an instance is enabled for hibernation.
|
LaunchTemplateIamInstanceProfileSpecificationRequest |
getIamInstanceProfile()
The name or Amazon Resource Name (ARN) of an IAM instance profile.
|
String |
getImageId()
The ID of the AMI in the format
ami-17characters00000 . |
String |
getInstanceInitiatedShutdownBehavior()
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
|
LaunchTemplateInstanceMarketOptionsRequest |
getInstanceMarketOptions()
The market (purchasing) option for the instances.
|
InstanceRequirementsRequest |
getInstanceRequirements()
The attributes for the instance types.
|
String |
getInstanceType()
The instance type.
|
String |
getKernelId()
The ID of the kernel.
|
String |
getKeyName()
The name of the key pair.
|
List<LaunchTemplateLicenseConfigurationRequest> |
getLicenseSpecifications()
The license configurations.
|
LaunchTemplateInstanceMaintenanceOptionsRequest |
getMaintenanceOptions()
The maintenance options for the instance.
|
LaunchTemplateInstanceMetadataOptionsRequest |
getMetadataOptions()
The metadata options for the instance.
|
LaunchTemplatesMonitoringRequest |
getMonitoring()
The monitoring for the instance.
|
List<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> |
getNetworkInterfaces()
The network interfaces for the instance.
|
LaunchTemplatePlacementRequest |
getPlacement()
The placement for the instance.
|
LaunchTemplatePrivateDnsNameOptionsRequest |
getPrivateDnsNameOptions()
The options for the instance hostname.
|
String |
getRamDiskId()
The ID of the RAM disk.
|
List<String> |
getSecurityGroupIds()
The IDs of the security groups.
|
List<String> |
getSecurityGroups()
The names of the security groups.
|
List<LaunchTemplateTagSpecificationRequest> |
getTagSpecifications()
The tags to apply to the resources that are created during instance launch.
|
String |
getUserData()
The user data to make available to the instance.
|
int |
hashCode() |
Boolean |
isDisableApiStop()
Indicates whether to enable the instance for stop protection.
|
Boolean |
isDisableApiTermination()
If you set this parameter to
true , you can't terminate the instance using the Amazon EC2 console,
CLI, or API; otherwise, you can. |
Boolean |
isEbsOptimized()
Indicates whether the instance is optimized for Amazon EBS I/O.
|
void |
setBlockDeviceMappings(Collection<LaunchTemplateBlockDeviceMappingRequest> blockDeviceMappings)
The block device mapping.
|
void |
setCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification)
The Capacity Reservation targeting option.
|
void |
setCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions)
The CPU options for the instance.
|
void |
setCreditSpecification(CreditSpecificationRequest creditSpecification)
The credit option for CPU usage of the instance.
|
void |
setDisableApiStop(Boolean disableApiStop)
Indicates whether to enable the instance for stop protection.
|
void |
setDisableApiTermination(Boolean disableApiTermination)
If you set this parameter to
true , you can't terminate the instance using the Amazon EC2 console,
CLI, or API; otherwise, you can. |
void |
setEbsOptimized(Boolean ebsOptimized)
Indicates whether the instance is optimized for Amazon EBS I/O.
|
void |
setElasticGpuSpecifications(Collection<ElasticGpuSpecification> elasticGpuSpecifications)
Deprecated.
|
void |
setElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance.
|
void |
setEnclaveOptions(LaunchTemplateEnclaveOptionsRequest enclaveOptions)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
|
void |
setHibernationOptions(LaunchTemplateHibernationOptionsRequest hibernationOptions)
Indicates whether an instance is enabled for hibernation.
|
void |
setIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.
|
void |
setImageId(String imageId)
The ID of the AMI in the format
ami-17characters00000 . |
void |
setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
|
void |
setInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions)
The market (purchasing) option for the instances.
|
void |
setInstanceRequirements(InstanceRequirementsRequest instanceRequirements)
The attributes for the instance types.
|
void |
setInstanceType(String instanceType)
The instance type.
|
void |
setKernelId(String kernelId)
The ID of the kernel.
|
void |
setKeyName(String keyName)
The name of the key pair.
|
void |
setLicenseSpecifications(Collection<LaunchTemplateLicenseConfigurationRequest> licenseSpecifications)
The license configurations.
|
void |
setMaintenanceOptions(LaunchTemplateInstanceMaintenanceOptionsRequest maintenanceOptions)
The maintenance options for the instance.
|
void |
setMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance.
|
void |
setMonitoring(LaunchTemplatesMonitoringRequest monitoring)
The monitoring for the instance.
|
void |
setNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
The network interfaces for the instance.
|
void |
setPlacement(LaunchTemplatePlacementRequest placement)
The placement for the instance.
|
void |
setPrivateDnsNameOptions(LaunchTemplatePrivateDnsNameOptionsRequest privateDnsNameOptions)
The options for the instance hostname.
|
void |
setRamDiskId(String ramDiskId)
The ID of the RAM disk.
|
void |
setSecurityGroupIds(Collection<String> securityGroupIds)
The IDs of the security groups.
|
void |
setSecurityGroups(Collection<String> securityGroups)
The names of the security groups.
|
void |
setTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources that are created during instance launch.
|
void |
setUserData(String userData)
The user data to make available to the instance.
|
String |
toString()
Returns a string representation of this object.
|
RequestLaunchTemplateData |
withBlockDeviceMappings(Collection<LaunchTemplateBlockDeviceMappingRequest> blockDeviceMappings)
The block device mapping.
|
RequestLaunchTemplateData |
withBlockDeviceMappings(LaunchTemplateBlockDeviceMappingRequest... blockDeviceMappings)
The block device mapping.
|
RequestLaunchTemplateData |
withCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification)
The Capacity Reservation targeting option.
|
RequestLaunchTemplateData |
withCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions)
The CPU options for the instance.
|
RequestLaunchTemplateData |
withCreditSpecification(CreditSpecificationRequest creditSpecification)
The credit option for CPU usage of the instance.
|
RequestLaunchTemplateData |
withDisableApiStop(Boolean disableApiStop)
Indicates whether to enable the instance for stop protection.
|
RequestLaunchTemplateData |
withDisableApiTermination(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. |
RequestLaunchTemplateData |
withEbsOptimized(Boolean ebsOptimized)
Indicates whether the instance is optimized for Amazon EBS I/O.
|
RequestLaunchTemplateData |
withElasticGpuSpecifications(Collection<ElasticGpuSpecification> elasticGpuSpecifications)
Deprecated.
|
RequestLaunchTemplateData |
withElasticGpuSpecifications(ElasticGpuSpecification... elasticGpuSpecifications)
Deprecated.
|
RequestLaunchTemplateData |
withElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance.
|
RequestLaunchTemplateData |
withElasticInferenceAccelerators(LaunchTemplateElasticInferenceAccelerator... elasticInferenceAccelerators)
An elastic inference accelerator to associate with the instance.
|
RequestLaunchTemplateData |
withEnclaveOptions(LaunchTemplateEnclaveOptionsRequest enclaveOptions)
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
|
RequestLaunchTemplateData |
withHibernationOptions(LaunchTemplateHibernationOptionsRequest hibernationOptions)
Indicates whether an instance is enabled for hibernation.
|
RequestLaunchTemplateData |
withIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.
|
RequestLaunchTemplateData |
withImageId(String imageId)
The ID of the AMI in the format
ami-17characters00000 . |
RequestLaunchTemplateData |
withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
|
RequestLaunchTemplateData |
withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
|
RequestLaunchTemplateData |
withInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions)
The market (purchasing) option for the instances.
|
RequestLaunchTemplateData |
withInstanceRequirements(InstanceRequirementsRequest instanceRequirements)
The attributes for the instance types.
|
RequestLaunchTemplateData |
withInstanceType(InstanceType instanceType)
The instance type.
|
RequestLaunchTemplateData |
withInstanceType(String instanceType)
The instance type.
|
RequestLaunchTemplateData |
withKernelId(String kernelId)
The ID of the kernel.
|
RequestLaunchTemplateData |
withKeyName(String keyName)
The name of the key pair.
|
RequestLaunchTemplateData |
withLicenseSpecifications(Collection<LaunchTemplateLicenseConfigurationRequest> licenseSpecifications)
The license configurations.
|
RequestLaunchTemplateData |
withLicenseSpecifications(LaunchTemplateLicenseConfigurationRequest... licenseSpecifications)
The license configurations.
|
RequestLaunchTemplateData |
withMaintenanceOptions(LaunchTemplateInstanceMaintenanceOptionsRequest maintenanceOptions)
The maintenance options for the instance.
|
RequestLaunchTemplateData |
withMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance.
|
RequestLaunchTemplateData |
withMonitoring(LaunchTemplatesMonitoringRequest monitoring)
The monitoring for the instance.
|
RequestLaunchTemplateData |
withNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
The network interfaces for the instance.
|
RequestLaunchTemplateData |
withNetworkInterfaces(LaunchTemplateInstanceNetworkInterfaceSpecificationRequest... networkInterfaces)
The network interfaces for the instance.
|
RequestLaunchTemplateData |
withPlacement(LaunchTemplatePlacementRequest placement)
The placement for the instance.
|
RequestLaunchTemplateData |
withPrivateDnsNameOptions(LaunchTemplatePrivateDnsNameOptionsRequest privateDnsNameOptions)
The options for the instance hostname.
|
RequestLaunchTemplateData |
withRamDiskId(String ramDiskId)
The ID of the RAM disk.
|
RequestLaunchTemplateData |
withSecurityGroupIds(Collection<String> securityGroupIds)
The IDs of the security groups.
|
RequestLaunchTemplateData |
withSecurityGroupIds(String... securityGroupIds)
The IDs of the security groups.
|
RequestLaunchTemplateData |
withSecurityGroups(Collection<String> securityGroups)
The names of the security groups.
|
RequestLaunchTemplateData |
withSecurityGroups(String... securityGroups)
The names of the security groups.
|
RequestLaunchTemplateData |
withTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources that are created during instance launch.
|
RequestLaunchTemplateData |
withTagSpecifications(LaunchTemplateTagSpecificationRequest... tagSpecifications)
The tags to apply to the resources that are created during instance launch.
|
RequestLaunchTemplateData |
withUserData(String userData)
The user data to make available to the instance.
|
public void setKernelId(String kernelId)
The ID of the kernel.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
kernelId
- The ID of the kernel. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
public String getKernelId()
The ID of the kernel.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
public RequestLaunchTemplateData withKernelId(String kernelId)
The ID of the kernel.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
kernelId
- The ID of the kernel. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
public void setEbsOptimized(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.
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.public Boolean getEbsOptimized()
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.
public RequestLaunchTemplateData withEbsOptimized(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.
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.public Boolean isEbsOptimized()
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.
public void setIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.
iamInstanceProfile
- The name or Amazon Resource Name (ARN) of an IAM instance profile.public LaunchTemplateIamInstanceProfileSpecificationRequest getIamInstanceProfile()
The name or Amazon Resource Name (ARN) of an IAM instance profile.
public RequestLaunchTemplateData withIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile)
The name or Amazon Resource Name (ARN) of an IAM instance profile.
iamInstanceProfile
- The name or Amazon Resource Name (ARN) of an IAM instance profile.public List<LaunchTemplateBlockDeviceMappingRequest> getBlockDeviceMappings()
The block device mapping.
public void setBlockDeviceMappings(Collection<LaunchTemplateBlockDeviceMappingRequest> blockDeviceMappings)
The block device mapping.
blockDeviceMappings
- The block device mapping.public RequestLaunchTemplateData withBlockDeviceMappings(LaunchTemplateBlockDeviceMappingRequest... blockDeviceMappings)
The block device mapping.
NOTE: This method appends the values to the existing list (if any). Use
setBlockDeviceMappings(java.util.Collection)
or withBlockDeviceMappings(java.util.Collection)
if you want to override the existing values.
blockDeviceMappings
- The block device mapping.public RequestLaunchTemplateData withBlockDeviceMappings(Collection<LaunchTemplateBlockDeviceMappingRequest> blockDeviceMappings)
The block device mapping.
blockDeviceMappings
- The block device mapping.public List<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> getNetworkInterfaces()
The network interfaces for the instance.
public void setNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
The network interfaces for the instance.
networkInterfaces
- The network interfaces for the instance.public RequestLaunchTemplateData withNetworkInterfaces(LaunchTemplateInstanceNetworkInterfaceSpecificationRequest... networkInterfaces)
The network interfaces for the instance.
NOTE: This method appends the values to the existing list (if any). Use
setNetworkInterfaces(java.util.Collection)
or withNetworkInterfaces(java.util.Collection)
if
you want to override the existing values.
networkInterfaces
- The network interfaces for the instance.public RequestLaunchTemplateData withNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
The network interfaces for the instance.
networkInterfaces
- The network interfaces for the instance.public void setImageId(String imageId)
The ID of the AMI in the format ami-17characters00000
.
Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems Manager parameter will resolve to an AMI ID on launch.
To reference a public parameter:
resolve:ssm:public-parameter
To reference a parameter stored in the same account:
resolve:ssm:parameter-name
resolve:ssm:parameter-name:version-number
resolve:ssm:parameter-name:label
To reference a parameter shared from another Amazon Web Services account:
resolve:ssm:parameter-ARN
resolve:ssm:parameter-ARN:version-number
resolve:ssm:parameter-ARN:label
For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.
If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following:
Only EC2 Fleets of type instant
support specifying a Systems Manager parameter.
For EC2 Fleets of type maintain
or request
, or for Spot Fleets, you must specify the
AMI ID.
imageId
- The ID of the AMI in the format ami-17characters00000
.
Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems Manager parameter will resolve to an AMI ID on launch.
To reference a public parameter:
resolve:ssm:public-parameter
To reference a parameter stored in the same account:
resolve:ssm:parameter-name
resolve:ssm:parameter-name:version-number
resolve:ssm:parameter-name:label
To reference a parameter shared from another Amazon Web Services account:
resolve:ssm:parameter-ARN
resolve:ssm:parameter-ARN:version-number
resolve:ssm:parameter-ARN:label
For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.
If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following:
Only EC2 Fleets of type instant
support specifying a Systems Manager parameter.
For EC2 Fleets of type maintain
or request
, or for Spot Fleets, you must specify
the AMI ID.
public String getImageId()
The ID of the AMI in the format ami-17characters00000
.
Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems Manager parameter will resolve to an AMI ID on launch.
To reference a public parameter:
resolve:ssm:public-parameter
To reference a parameter stored in the same account:
resolve:ssm:parameter-name
resolve:ssm:parameter-name:version-number
resolve:ssm:parameter-name:label
To reference a parameter shared from another Amazon Web Services account:
resolve:ssm:parameter-ARN
resolve:ssm:parameter-ARN:version-number
resolve:ssm:parameter-ARN:label
For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.
If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following:
Only EC2 Fleets of type instant
support specifying a Systems Manager parameter.
For EC2 Fleets of type maintain
or request
, or for Spot Fleets, you must specify the
AMI ID.
ami-17characters00000
.
Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems Manager parameter will resolve to an AMI ID on launch.
To reference a public parameter:
resolve:ssm:public-parameter
To reference a parameter stored in the same account:
resolve:ssm:parameter-name
resolve:ssm:parameter-name:version-number
resolve:ssm:parameter-name:label
To reference a parameter shared from another Amazon Web Services account:
resolve:ssm:parameter-ARN
resolve:ssm:parameter-ARN:version-number
resolve:ssm:parameter-ARN:label
For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.
If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following:
Only EC2 Fleets of type instant
support specifying a Systems Manager parameter.
For EC2 Fleets of type maintain
or request
, or for Spot Fleets, you must
specify the AMI ID.
public RequestLaunchTemplateData withImageId(String imageId)
The ID of the AMI in the format ami-17characters00000
.
Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems Manager parameter will resolve to an AMI ID on launch.
To reference a public parameter:
resolve:ssm:public-parameter
To reference a parameter stored in the same account:
resolve:ssm:parameter-name
resolve:ssm:parameter-name:version-number
resolve:ssm:parameter-name:label
To reference a parameter shared from another Amazon Web Services account:
resolve:ssm:parameter-ARN
resolve:ssm:parameter-ARN:version-number
resolve:ssm:parameter-ARN:label
For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.
If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following:
Only EC2 Fleets of type instant
support specifying a Systems Manager parameter.
For EC2 Fleets of type maintain
or request
, or for Spot Fleets, you must specify the
AMI ID.
imageId
- The ID of the AMI in the format ami-17characters00000
.
Alternatively, you can specify a Systems Manager parameter, using one of the following formats. The Systems Manager parameter will resolve to an AMI ID on launch.
To reference a public parameter:
resolve:ssm:public-parameter
To reference a parameter stored in the same account:
resolve:ssm:parameter-name
resolve:ssm:parameter-name:version-number
resolve:ssm:parameter-name:label
To reference a parameter shared from another Amazon Web Services account:
resolve:ssm:parameter-ARN
resolve:ssm:parameter-ARN:version-number
resolve:ssm:parameter-ARN:label
For more information, see Use a Systems Manager parameter instead of an AMI ID in the Amazon EC2 User Guide.
If the launch template will be used for an EC2 Fleet or Spot Fleet, note the following:
Only EC2 Fleets of type instant
support specifying a Systems Manager parameter.
For EC2 Fleets of type maintain
or request
, or for Spot Fleets, you must specify
the AMI ID.
public void setInstanceType(String instanceType)
The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide.
If you specify InstanceType
, you can't specify InstanceRequirements
.
instanceType
- The instance type. For more information, see Amazon EC2 instance
types in the Amazon EC2 User Guide.
If you specify InstanceType
, you can't specify InstanceRequirements
.
InstanceType
public String getInstanceType()
The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide.
If you specify InstanceType
, you can't specify InstanceRequirements
.
If you specify InstanceType
, you can't specify InstanceRequirements
.
InstanceType
public RequestLaunchTemplateData withInstanceType(String instanceType)
The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide.
If you specify InstanceType
, you can't specify InstanceRequirements
.
instanceType
- The instance type. For more information, see Amazon EC2 instance
types in the Amazon EC2 User Guide.
If you specify InstanceType
, you can't specify InstanceRequirements
.
InstanceType
public RequestLaunchTemplateData withInstanceType(InstanceType instanceType)
The instance type. For more information, see Amazon EC2 instance types in the Amazon EC2 User Guide.
If you specify InstanceType
, you can't specify InstanceRequirements
.
instanceType
- The instance type. For more information, see Amazon EC2 instance
types in the Amazon EC2 User Guide.
If you specify InstanceType
, you can't specify InstanceRequirements
.
InstanceType
public void setKeyName(String keyName)
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
keyName
- The name of the key pair. You can create a key pair using CreateKeyPair or
ImportKeyPair.<
/p> 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 String getKeyName()
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
public RequestLaunchTemplateData withKeyName(String keyName)
The name of the key pair. You can create a key pair using CreateKeyPair or ImportKeyPair.
If you do not specify a key pair, you can't connect to the instance unless you choose an AMI that is configured to allow users another way to log in.
keyName
- The name of the key pair. You can create a key pair using CreateKeyPair or
ImportKeyPair.<
/p> 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 void setMonitoring(LaunchTemplatesMonitoringRequest monitoring)
The monitoring for the instance.
monitoring
- The monitoring for the instance.public LaunchTemplatesMonitoringRequest getMonitoring()
The monitoring for the instance.
public RequestLaunchTemplateData withMonitoring(LaunchTemplatesMonitoringRequest monitoring)
The monitoring for the instance.
monitoring
- The monitoring for the instance.public void setPlacement(LaunchTemplatePlacementRequest placement)
The placement for the instance.
placement
- The placement for the instance.public LaunchTemplatePlacementRequest getPlacement()
The placement for the instance.
public RequestLaunchTemplateData withPlacement(LaunchTemplatePlacementRequest placement)
The placement for the instance.
placement
- The placement for the instance.public void setRamDiskId(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 User provided kernels in the Amazon EC2 User Guide.
ramDiskId
- The ID of the RAM disk. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
public String getRamDiskId()
The ID of the RAM disk.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
public RequestLaunchTemplateData withRamDiskId(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 User provided kernels in the Amazon EC2 User Guide.
ramDiskId
- The ID of the RAM disk. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User provided kernels in the Amazon EC2 User Guide.
public void setDisableApiTermination(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 set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.
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 set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.public Boolean getDisableApiTermination()
If you set this parameter to true
, you can't terminate the instance using the Amazon EC2 console,
CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute. Alternatively, if you set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.
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 set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.public RequestLaunchTemplateData withDisableApiTermination(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 set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.
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 set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.public Boolean isDisableApiTermination()
If you set this parameter to true
, you can't terminate the instance using the Amazon EC2 console,
CLI, or API; otherwise, you can. To change this attribute after launch, use ModifyInstanceAttribute. Alternatively, if you set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.
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 set InstanceInitiatedShutdownBehavior
to
terminate
, you can terminate the instance by running the shutdown command from the instance.public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
instanceInitiatedShutdownBehavior
- Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
Default: stop
ShutdownBehavior
public String getInstanceInitiatedShutdownBehavior()
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
Default: stop
ShutdownBehavior
public RequestLaunchTemplateData withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
instanceInitiatedShutdownBehavior
- Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
Default: stop
ShutdownBehavior
public RequestLaunchTemplateData withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior)
Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).
Default: stop
instanceInitiatedShutdownBehavior
- Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
operating system command for system shutdown).
Default: stop
ShutdownBehavior
public void setUserData(String userData)
The user data to make available to the instance. You must provide base64-encoded text. User data is limited to 16 KB. For more information, see Run commands on your Amazon EC2 instance at launch in the Amazon EC2 User Guide.
If you are creating the launch template for use with Batch, the user data must be provided in the MIME multi-part archive format. For more information, see Amazon EC2 user data in launch templates in the Batch User Guide.
userData
- The user data to make available to the instance. You must provide base64-encoded text. User data is
limited to 16 KB. For more information, see Run commands on your Amazon EC2
instance at launch in the Amazon EC2 User Guide.
If you are creating the launch template for use with Batch, the user data must be provided in the MIME multi-part archive format. For more information, see Amazon EC2 user data in launch templates in the Batch User Guide.
public String getUserData()
The user data to make available to the instance. You must provide base64-encoded text. User data is limited to 16 KB. For more information, see Run commands on your Amazon EC2 instance at launch in the Amazon EC2 User Guide.
If you are creating the launch template for use with Batch, the user data must be provided in the MIME multi-part archive format. For more information, see Amazon EC2 user data in launch templates in the Batch User Guide.
If you are creating the launch template for use with Batch, the user data must be provided in the MIME multi-part archive format. For more information, see Amazon EC2 user data in launch templates in the Batch User Guide.
public RequestLaunchTemplateData withUserData(String userData)
The user data to make available to the instance. You must provide base64-encoded text. User data is limited to 16 KB. For more information, see Run commands on your Amazon EC2 instance at launch in the Amazon EC2 User Guide.
If you are creating the launch template for use with Batch, the user data must be provided in the MIME multi-part archive format. For more information, see Amazon EC2 user data in launch templates in the Batch User Guide.
userData
- The user data to make available to the instance. You must provide base64-encoded text. User data is
limited to 16 KB. For more information, see Run commands on your Amazon EC2
instance at launch in the Amazon EC2 User Guide.
If you are creating the launch template for use with Batch, the user data must be provided in the MIME multi-part archive format. For more information, see Amazon EC2 user data in launch templates in the Batch User Guide.
public List<LaunchTemplateTagSpecificationRequest> getTagSpecifications()
The tags to apply to the resources that are created during instance launch. These tags are not applied to the launch template.
public void setTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources that are created during instance launch. These tags are not applied to the launch template.
tagSpecifications
- The tags to apply to the resources that are created during instance launch. These tags are not applied to
the launch template.public RequestLaunchTemplateData withTagSpecifications(LaunchTemplateTagSpecificationRequest... tagSpecifications)
The tags to apply to the resources that are created during instance launch. These tags are not applied to the launch template.
NOTE: This method appends the values to the existing list (if any). Use
setTagSpecifications(java.util.Collection)
or withTagSpecifications(java.util.Collection)
if
you want to override the existing values.
tagSpecifications
- The tags to apply to the resources that are created during instance launch. These tags are not applied to
the launch template.public RequestLaunchTemplateData withTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources that are created during instance launch. These tags are not applied to the launch template.
tagSpecifications
- The tags to apply to the resources that are created during instance launch. These tags are not applied to
the launch template.public List<ElasticGpuSpecification> getElasticGpuSpecifications()
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.
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.
public void setElasticGpuSpecifications(Collection<ElasticGpuSpecification> elasticGpuSpecifications)
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.
elasticGpuSpecifications
- 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.
public RequestLaunchTemplateData withElasticGpuSpecifications(ElasticGpuSpecification... elasticGpuSpecifications)
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.
NOTE: This method appends the values to the existing list (if any). Use
setElasticGpuSpecifications(java.util.Collection)
or
withElasticGpuSpecifications(java.util.Collection)
if you want to override the existing values.
elasticGpuSpecifications
- 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.
public RequestLaunchTemplateData withElasticGpuSpecifications(Collection<ElasticGpuSpecification> elasticGpuSpecifications)
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.
elasticGpuSpecifications
- 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.
public List<LaunchTemplateElasticInferenceAccelerator> getElasticInferenceAccelerators()
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.
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.
public void setElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> 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.
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.
public RequestLaunchTemplateData withElasticInferenceAccelerators(LaunchTemplateElasticInferenceAccelerator... 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.
NOTE: This method appends the values to the existing list (if any). Use
setElasticInferenceAccelerators(java.util.Collection)
or
withElasticInferenceAccelerators(java.util.Collection)
if you want to override the existing values.
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.
public RequestLaunchTemplateData withElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> 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.
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.
public List<String> getSecurityGroupIds()
The IDs of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public void setSecurityGroupIds(Collection<String> securityGroupIds)
The IDs of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
securityGroupIds
- The IDs of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public RequestLaunchTemplateData withSecurityGroupIds(String... securityGroupIds)
The IDs of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
NOTE: This method appends the values to the existing list (if any). Use
setSecurityGroupIds(java.util.Collection)
or withSecurityGroupIds(java.util.Collection)
if you
want to override the existing values.
securityGroupIds
- The IDs of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public RequestLaunchTemplateData withSecurityGroupIds(Collection<String> securityGroupIds)
The IDs of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
securityGroupIds
- The IDs of the security groups.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public List<String> getSecurityGroups()
The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public void setSecurityGroups(Collection<String> securityGroups)
The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
securityGroups
- The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public RequestLaunchTemplateData withSecurityGroups(String... securityGroups)
The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
NOTE: This method appends the values to the existing list (if any). Use
setSecurityGroups(java.util.Collection)
or withSecurityGroups(java.util.Collection)
if you want
to override the existing values.
securityGroups
- The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public RequestLaunchTemplateData withSecurityGroups(Collection<String> securityGroups)
The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
securityGroups
- The names of the security groups. For a nondefault VPC, you must use security group IDs instead.
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
public void setInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions)
The market (purchasing) option for the instances.
instanceMarketOptions
- The market (purchasing) option for the instances.public LaunchTemplateInstanceMarketOptionsRequest getInstanceMarketOptions()
The market (purchasing) option for the instances.
public RequestLaunchTemplateData withInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions)
The market (purchasing) option for the instances.
instanceMarketOptions
- The market (purchasing) option for the instances.public void setCreditSpecification(CreditSpecificationRequest creditSpecification)
The credit option for CPU usage of the instance. Valid only for T instances.
creditSpecification
- The credit option for CPU usage of the instance. Valid only for T instances.public CreditSpecificationRequest getCreditSpecification()
The credit option for CPU usage of the instance. Valid only for T instances.
public RequestLaunchTemplateData withCreditSpecification(CreditSpecificationRequest creditSpecification)
The credit option for CPU usage of the instance. Valid only for T instances.
creditSpecification
- The credit option for CPU usage of the instance. Valid only for T instances.public void setCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions)
The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide.
cpuOptions
- The CPU options for the instance. For more information, see Optimize CPU
options in the Amazon EC2 User Guide.public LaunchTemplateCpuOptionsRequest getCpuOptions()
The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide.
public RequestLaunchTemplateData withCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions)
The CPU options for the instance. For more information, see Optimize CPU options in the Amazon EC2 User Guide.
cpuOptions
- The CPU options for the instance. For more information, see Optimize CPU
options in the Amazon EC2 User Guide.public void setCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification)
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).
capacityReservationSpecification
- 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).public LaunchTemplateCapacityReservationSpecificationRequest getCapacityReservationSpecification()
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 RequestLaunchTemplateData withCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification)
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).
capacityReservationSpecification
- 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).public List<LaunchTemplateLicenseConfigurationRequest> getLicenseSpecifications()
The license configurations.
public void setLicenseSpecifications(Collection<LaunchTemplateLicenseConfigurationRequest> licenseSpecifications)
The license configurations.
licenseSpecifications
- The license configurations.public RequestLaunchTemplateData withLicenseSpecifications(LaunchTemplateLicenseConfigurationRequest... licenseSpecifications)
The license configurations.
NOTE: This method appends the values to the existing list (if any). Use
setLicenseSpecifications(java.util.Collection)
or
withLicenseSpecifications(java.util.Collection)
if you want to override the existing values.
licenseSpecifications
- The license configurations.public RequestLaunchTemplateData withLicenseSpecifications(Collection<LaunchTemplateLicenseConfigurationRequest> licenseSpecifications)
The license configurations.
licenseSpecifications
- The license configurations.public void setHibernationOptions(LaunchTemplateHibernationOptionsRequest 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 Amazon EC2 instance in the Amazon EC2 User Guide.
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 Amazon EC2
instance in the Amazon EC2 User Guide.public LaunchTemplateHibernationOptionsRequest getHibernationOptions()
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 Amazon EC2 instance in the Amazon EC2 User Guide.
public RequestLaunchTemplateData withHibernationOptions(LaunchTemplateHibernationOptionsRequest 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 Amazon EC2 instance in the Amazon EC2 User Guide.
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 Amazon EC2
instance in the Amazon EC2 User Guide.public void setMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance. For more information, see Instance metadata and user data in the Amazon EC2 User Guide.
metadataOptions
- The metadata options for the instance. For more information, see Instance metadata
and user data in the Amazon EC2 User Guide.public LaunchTemplateInstanceMetadataOptionsRequest getMetadataOptions()
The metadata options for the instance. For more information, see Instance metadata and user data in the Amazon EC2 User Guide.
public RequestLaunchTemplateData withMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance. For more information, see Instance metadata and user data in the Amazon EC2 User Guide.
metadataOptions
- The metadata options for the instance. For more information, see Instance metadata
and user data in the Amazon EC2 User Guide.public void setEnclaveOptions(LaunchTemplateEnclaveOptionsRequest 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.
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.
public LaunchTemplateEnclaveOptionsRequest getEnclaveOptions()
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.
You can't enable Amazon Web Services Nitro Enclaves and hibernation on the same instance.
public RequestLaunchTemplateData withEnclaveOptions(LaunchTemplateEnclaveOptionsRequest 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.
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.
public void setInstanceRequirements(InstanceRequirementsRequest instanceRequirements)
The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.
You must specify VCpuCount
and MemoryMiB
. All other attributes are optional. Any
unspecified optional attribute is set to its default.
When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:
AllowedInstanceTypes
- The instance types to include in the list. All other instance types are
ignored, even if they match your specified attributes.
ExcludedInstanceTypes
- The instance types to exclude from the list, even if they match your
specified attributes.
If you specify InstanceRequirements
, you can't specify InstanceType
.
Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot
Fleet to launch instances. If you plan to use the launch template in the launch instance
wizard, or with the RunInstances API or AWS::EC2::
Instance Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements
.
For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in the Amazon EC2 User Guide.
instanceRequirements
- The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify
instance types with these attributes.
You must specify VCpuCount
and MemoryMiB
. All other attributes are optional. Any
unspecified optional attribute is set to its default.
When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:
AllowedInstanceTypes
- The instance types to include in the list. All other instance types
are ignored, even if they match your specified attributes.
ExcludedInstanceTypes
- The instance types to exclude from the list, even if they match your
specified attributes.
If you specify InstanceRequirements
, you can't specify InstanceType
.
Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and
Spot Fleet to launch instances. If you plan to use the launch template in the launch instance
wizard, or with the RunInstances API
or AWS::EC2::Instance Amazon Web Services CloudFormation resource, you can't specify
InstanceRequirements
.
For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in the Amazon EC2 User Guide.
public InstanceRequirementsRequest getInstanceRequirements()
The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.
You must specify VCpuCount
and MemoryMiB
. All other attributes are optional. Any
unspecified optional attribute is set to its default.
When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:
AllowedInstanceTypes
- The instance types to include in the list. All other instance types are
ignored, even if they match your specified attributes.
ExcludedInstanceTypes
- The instance types to exclude from the list, even if they match your
specified attributes.
If you specify InstanceRequirements
, you can't specify InstanceType
.
Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot
Fleet to launch instances. If you plan to use the launch template in the launch instance
wizard, or with the RunInstances API or AWS::EC2::
Instance Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements
.
For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in the Amazon EC2 User Guide.
You must specify VCpuCount
and MemoryMiB
. All other attributes are optional.
Any unspecified optional attribute is set to its default.
When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:
AllowedInstanceTypes
- The instance types to include in the list. All other instance types
are ignored, even if they match your specified attributes.
ExcludedInstanceTypes
- The instance types to exclude from the list, even if they match your
specified attributes.
If you specify InstanceRequirements
, you can't specify InstanceType
.
Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and
Spot Fleet to launch instances. If you plan to use the launch template in the launch
instance wizard, or with the RunInstances API
or AWS::EC2::Instance Amazon Web Services CloudFormation resource, you can't specify
InstanceRequirements
.
For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in the Amazon EC2 User Guide.
public RequestLaunchTemplateData withInstanceRequirements(InstanceRequirementsRequest instanceRequirements)
The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.
You must specify VCpuCount
and MemoryMiB
. All other attributes are optional. Any
unspecified optional attribute is set to its default.
When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:
AllowedInstanceTypes
- The instance types to include in the list. All other instance types are
ignored, even if they match your specified attributes.
ExcludedInstanceTypes
- The instance types to exclude from the list, even if they match your
specified attributes.
If you specify InstanceRequirements
, you can't specify InstanceType
.
Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot
Fleet to launch instances. If you plan to use the launch template in the launch instance
wizard, or with the RunInstances API or AWS::EC2::
Instance Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements
.
For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in the Amazon EC2 User Guide.
instanceRequirements
- The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify
instance types with these attributes.
You must specify VCpuCount
and MemoryMiB
. All other attributes are optional. Any
unspecified optional attribute is set to its default.
When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:
AllowedInstanceTypes
- The instance types to include in the list. All other instance types
are ignored, even if they match your specified attributes.
ExcludedInstanceTypes
- The instance types to exclude from the list, even if they match your
specified attributes.
If you specify InstanceRequirements
, you can't specify InstanceType
.
Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and
Spot Fleet to launch instances. If you plan to use the launch template in the launch instance
wizard, or with the RunInstances API
or AWS::EC2::Instance Amazon Web Services CloudFormation resource, you can't specify
InstanceRequirements
.
For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in the Amazon EC2 User Guide.
public void setPrivateDnsNameOptions(LaunchTemplatePrivateDnsNameOptionsRequest privateDnsNameOptions)
The options for the instance hostname. The default values are inherited from the subnet.
privateDnsNameOptions
- The options for the instance hostname. The default values are inherited from the subnet.public LaunchTemplatePrivateDnsNameOptionsRequest getPrivateDnsNameOptions()
The options for the instance hostname. The default values are inherited from the subnet.
public RequestLaunchTemplateData withPrivateDnsNameOptions(LaunchTemplatePrivateDnsNameOptionsRequest privateDnsNameOptions)
The options for the instance hostname. The default values are inherited from the subnet.
privateDnsNameOptions
- The options for the instance hostname. The default values are inherited from the subnet.public void setMaintenanceOptions(LaunchTemplateInstanceMaintenanceOptionsRequest maintenanceOptions)
The maintenance options for the instance.
maintenanceOptions
- The maintenance options for the instance.public LaunchTemplateInstanceMaintenanceOptionsRequest getMaintenanceOptions()
The maintenance options for the instance.
public RequestLaunchTemplateData withMaintenanceOptions(LaunchTemplateInstanceMaintenanceOptionsRequest maintenanceOptions)
The maintenance options for the instance.
maintenanceOptions
- The maintenance options for the instance.public void setDisableApiStop(Boolean disableApiStop)
Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection for your instance in the Amazon EC2 User Guide.
disableApiStop
- Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection
for your instance in the Amazon EC2 User Guide.public Boolean getDisableApiStop()
Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection for your instance in the Amazon EC2 User Guide.
public RequestLaunchTemplateData withDisableApiStop(Boolean disableApiStop)
Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection for your instance in the Amazon EC2 User Guide.
disableApiStop
- Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection
for your instance in the Amazon EC2 User Guide.public Boolean isDisableApiStop()
Indicates whether to enable the instance for stop protection. For more information, see Enable stop protection for your instance in the Amazon EC2 User Guide.
public String toString()
toString
in class Object
Object.toString()
public RequestLaunchTemplateData clone()