@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.
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 |
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()
An elastic GPU to associate with the instance.
|
List<LaunchTemplateElasticInferenceAccelerator> |
getElasticInferenceAccelerators()
The elastic inference accelerator for 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.
|
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.
|
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.
|
LaunchTemplateInstanceMetadataOptionsRequest |
getMetadataOptions()
The metadata options for the instance.
|
LaunchTemplatesMonitoringRequest |
getMonitoring()
The monitoring for the instance.
|
List<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> |
getNetworkInterfaces()
One or more network interfaces.
|
LaunchTemplatePlacementRequest |
getPlacement()
The placement for the instance.
|
String |
getRamDiskId()
The ID of the RAM disk.
|
List<String> |
getSecurityGroupIds()
One or more security group IDs.
|
List<String> |
getSecurityGroups()
[EC2-Classic, default VPC] One or more security group names.
|
List<LaunchTemplateTagSpecificationRequest> |
getTagSpecifications()
The tags to apply to the resources during launch.
|
String |
getUserData()
The user data to make available to the instance.
|
int |
hashCode() |
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 |
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)
An elastic GPU to associate with the instance.
|
void |
setElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> elasticInferenceAccelerators)
The elastic inference accelerator for 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.
|
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 |
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 |
setMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance.
|
void |
setMonitoring(LaunchTemplatesMonitoringRequest monitoring)
The monitoring for the instance.
|
void |
setNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
One or more network interfaces.
|
void |
setPlacement(LaunchTemplatePlacementRequest placement)
The placement for the instance.
|
void |
setRamDiskId(String ramDiskId)
The ID of the RAM disk.
|
void |
setSecurityGroupIds(Collection<String> securityGroupIds)
One or more security group IDs.
|
void |
setSecurityGroups(Collection<String> securityGroups)
[EC2-Classic, default VPC] One or more security group names.
|
void |
setTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources during 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 |
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)
An elastic GPU to associate with the instance.
|
RequestLaunchTemplateData |
withElasticGpuSpecifications(ElasticGpuSpecification... elasticGpuSpecifications)
An elastic GPU to associate with the instance.
|
RequestLaunchTemplateData |
withElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> elasticInferenceAccelerators)
The elastic inference accelerator for the instance.
|
RequestLaunchTemplateData |
withElasticInferenceAccelerators(LaunchTemplateElasticInferenceAccelerator... elasticInferenceAccelerators)
The elastic inference accelerator for 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.
|
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 |
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 |
withMetadataOptions(LaunchTemplateInstanceMetadataOptionsRequest metadataOptions)
The metadata options for the instance.
|
RequestLaunchTemplateData |
withMonitoring(LaunchTemplatesMonitoringRequest monitoring)
The monitoring for the instance.
|
RequestLaunchTemplateData |
withNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
One or more network interfaces.
|
RequestLaunchTemplateData |
withNetworkInterfaces(LaunchTemplateInstanceNetworkInterfaceSpecificationRequest... networkInterfaces)
One or more network interfaces.
|
RequestLaunchTemplateData |
withPlacement(LaunchTemplatePlacementRequest placement)
The placement for the instance.
|
RequestLaunchTemplateData |
withRamDiskId(String ramDiskId)
The ID of the RAM disk.
|
RequestLaunchTemplateData |
withSecurityGroupIds(Collection<String> securityGroupIds)
One or more security group IDs.
|
RequestLaunchTemplateData |
withSecurityGroupIds(String... securityGroupIds)
One or more security group IDs.
|
RequestLaunchTemplateData |
withSecurityGroups(Collection<String> securityGroups)
[EC2-Classic, default VPC] One or more security group names.
|
RequestLaunchTemplateData |
withSecurityGroups(String... securityGroups)
[EC2-Classic, default VPC] One or more security group names.
|
RequestLaunchTemplateData |
withTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources during launch.
|
RequestLaunchTemplateData |
withTagSpecifications(LaunchTemplateTagSpecificationRequest... tagSpecifications)
The tags to apply to the resources during 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 Elastic Compute Cloud User Guide.
kernelId
- The ID of the kernel. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud 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 Elastic Compute Cloud 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 Elastic Compute Cloud 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 Elastic Compute Cloud User Guide.
kernelId
- The ID of the kernel. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud 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()
One or more network interfaces. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
public void setNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
One or more network interfaces. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
networkInterfaces
- One or more network interfaces. If you specify a network interface, you must specify any security groups
and subnets as part of the network interface.public RequestLaunchTemplateData withNetworkInterfaces(LaunchTemplateInstanceNetworkInterfaceSpecificationRequest... networkInterfaces)
One or more network interfaces. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
NOTE: This method appends the values to the existing list (if any). Use
setNetworkInterfaces(java.util.Collection)
or withNetworkInterfaces(java.util.Collection)
if
you want to override the existing values.
networkInterfaces
- One or more network interfaces. If you specify a network interface, you must specify any security groups
and subnets as part of the network interface.public RequestLaunchTemplateData withNetworkInterfaces(Collection<LaunchTemplateInstanceNetworkInterfaceSpecificationRequest> networkInterfaces)
One or more network interfaces. If you specify a network interface, you must specify any security groups and subnets as part of the network interface.
networkInterfaces
- One or more network interfaces. If you specify a network interface, you must specify any security groups
and subnets as part of the network interface.public void setImageId(String imageId)
The ID of the AMI.
imageId
- The ID of the AMI.public String getImageId()
The ID of the AMI.
public RequestLaunchTemplateData withImageId(String imageId)
The ID of the AMI.
imageId
- The ID of the AMI.public void setInstanceType(String instanceType)
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
instanceType
- The instance type. For more information, see Instance Types in the
Amazon Elastic Compute Cloud User Guide.InstanceType
public String getInstanceType()
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
InstanceType
public RequestLaunchTemplateData withInstanceType(String instanceType)
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
instanceType
- The instance type. For more information, see Instance Types in the
Amazon Elastic Compute Cloud User Guide.InstanceType
public RequestLaunchTemplateData withInstanceType(InstanceType instanceType)
The instance type. For more information, see Instance Types in the Amazon Elastic Compute Cloud User Guide.
instanceType
- The instance type. For more information, see Instance Types in the
Amazon Elastic Compute Cloud User Guide.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 Elastic Compute Cloud User Guide.
ramDiskId
- The ID of the RAM disk. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud 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 Elastic Compute Cloud 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 Elastic Compute Cloud 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 Elastic Compute Cloud User Guide.
ramDiskId
- The ID of the RAM disk. We recommend that you use PV-GRUB instead of kernels and RAM disks. For more information, see User Provided Kernels in the Amazon Elastic Compute Cloud 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 Running Commands on Your Linux Instance at Launch (Linux) or Adding User Data (Windows).
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 Running Commands on Your Linux
Instance at Launch (Linux) or Adding User Data (Windows).
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 Running Commands on Your Linux Instance at Launch (Linux) or Adding User Data (Windows).
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 Running Commands on Your Linux Instance at Launch (Linux) or Adding User Data (Windows).
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 Running Commands on Your Linux
Instance at Launch (Linux) or Adding User Data (Windows).
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 during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags.
public void setTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags.
tagSpecifications
- The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The
specified tags are applied to all instances or volumes that are created during launch. To tag a resource
after it has been created, see CreateTags.public RequestLaunchTemplateData withTagSpecifications(LaunchTemplateTagSpecificationRequest... tagSpecifications)
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags.
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 during launch. You can only tag instances and volumes on launch. The
specified tags are applied to all instances or volumes that are created during launch. To tag a resource
after it has been created, see CreateTags.public RequestLaunchTemplateData withTagSpecifications(Collection<LaunchTemplateTagSpecificationRequest> tagSpecifications)
The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The specified tags are applied to all instances or volumes that are created during launch. To tag a resource after it has been created, see CreateTags.
tagSpecifications
- The tags to apply to the resources during launch. You can only tag instances and volumes on launch. The
specified tags are applied to all instances or volumes that are created during launch. To tag a resource
after it has been created, see CreateTags.public List<ElasticGpuSpecification> getElasticGpuSpecifications()
An elastic GPU to associate with the instance.
public void setElasticGpuSpecifications(Collection<ElasticGpuSpecification> elasticGpuSpecifications)
An elastic GPU to associate with the instance.
elasticGpuSpecifications
- An elastic GPU to associate with the instance.public RequestLaunchTemplateData withElasticGpuSpecifications(ElasticGpuSpecification... elasticGpuSpecifications)
An elastic GPU to associate with the instance.
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
- An elastic GPU to associate with the instance.public RequestLaunchTemplateData withElasticGpuSpecifications(Collection<ElasticGpuSpecification> elasticGpuSpecifications)
An elastic GPU to associate with the instance.
elasticGpuSpecifications
- An elastic GPU to associate with the instance.public List<LaunchTemplateElasticInferenceAccelerator> getElasticInferenceAccelerators()
The elastic inference accelerator for the instance.
public void setElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> elasticInferenceAccelerators)
The elastic inference accelerator for the instance.
elasticInferenceAccelerators
- The elastic inference accelerator for the instance.public RequestLaunchTemplateData withElasticInferenceAccelerators(LaunchTemplateElasticInferenceAccelerator... elasticInferenceAccelerators)
The elastic inference accelerator for the instance.
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
- The elastic inference accelerator for the instance.public RequestLaunchTemplateData withElasticInferenceAccelerators(Collection<LaunchTemplateElasticInferenceAccelerator> elasticInferenceAccelerators)
The elastic inference accelerator for the instance.
elasticInferenceAccelerators
- The elastic inference accelerator for the instance.public List<String> getSecurityGroupIds()
One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same request.
public void setSecurityGroupIds(Collection<String> securityGroupIds)
One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same request.
securityGroupIds
- One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same
request.public RequestLaunchTemplateData withSecurityGroupIds(String... securityGroupIds)
One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same request.
NOTE: This method appends the values to the existing list (if any). Use
setSecurityGroupIds(java.util.Collection)
or withSecurityGroupIds(java.util.Collection)
if you
want to override the existing values.
securityGroupIds
- One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same
request.public RequestLaunchTemplateData withSecurityGroupIds(Collection<String> securityGroupIds)
One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same request.
securityGroupIds
- One or more security group IDs. You can create a security group using CreateSecurityGroup. You cannot specify both a security group ID and security name in the same
request.public List<String> getSecurityGroups()
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
public void setSecurityGroups(Collection<String> securityGroups)
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
securityGroups
- [EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security
group IDs instead. You cannot specify both a security group ID and security name in the same request.public RequestLaunchTemplateData withSecurityGroups(String... securityGroups)
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
NOTE: This method appends the values to the existing list (if any). Use
setSecurityGroups(java.util.Collection)
or withSecurityGroups(java.util.Collection)
if you want
to override the existing values.
securityGroups
- [EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security
group IDs instead. You cannot specify both a security group ID and security name in the same request.public RequestLaunchTemplateData withSecurityGroups(Collection<String> securityGroups)
[EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security group IDs instead. You cannot specify both a security group ID and security name in the same request.
securityGroups
- [EC2-Classic, default VPC] One or more security group names. For a nondefault VPC, you must use security
group IDs instead. You cannot specify both a security group ID and security name in the same request.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 for T2, T3, or T3a instances only.
creditSpecification
- The credit option for CPU usage of the instance. Valid for T2, T3, or T3a instances only.public CreditSpecificationRequest getCreditSpecification()
The credit option for CPU usage of the instance. Valid for T2, T3, or T3a instances only.
public RequestLaunchTemplateData withCreditSpecification(CreditSpecificationRequest creditSpecification)
The credit option for CPU usage of the instance. Valid for T2, T3, or T3a instances only.
creditSpecification
- The credit option for CPU usage of the instance. Valid for T2, T3, or T3a instances only.public void setCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions)
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide.
cpuOptions
- The CPU options for the instance. For more information, see Optimizing CPU
Options in the Amazon Elastic Compute Cloud User Guide.public LaunchTemplateCpuOptionsRequest getCpuOptions()
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide.
public RequestLaunchTemplateData withCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions)
The CPU options for the instance. For more information, see Optimizing CPU Options in the Amazon Elastic Compute Cloud User Guide.
cpuOptions
- The CPU options for the instance. For more information, see Optimizing CPU
Options in the Amazon Elastic Compute Cloud 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 instance in the Amazon Elastic Compute Cloud 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 instance in
the Amazon Elastic Compute Cloud 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 instance in the Amazon Elastic Compute Cloud 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 instance in the Amazon Elastic Compute Cloud 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 instance in
the Amazon Elastic Compute Cloud 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 Elastic Compute Cloud User Guide.
metadataOptions
- The metadata options for the instance. For more information, see Instance metadata
and user data in the Amazon Elastic Compute Cloud User Guide.public LaunchTemplateInstanceMetadataOptionsRequest getMetadataOptions()
The metadata options for the instance. For more information, see Instance metadata and user data in the Amazon Elastic Compute Cloud 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 Elastic Compute Cloud User Guide.
metadataOptions
- The metadata options for the instance. For more information, see Instance metadata
and user data in the Amazon Elastic Compute Cloud 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 String toString()
toString
in class Object
Object.toString()
public RequestLaunchTemplateData clone()