com.amazonaws.services.ec2.model.RequestLaunchTemplateData Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2014-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* The information to include in the launch template.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RequestLaunchTemplateData implements Serializable, Cloneable {
/**
*
* 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.
*
*
*/
private String kernelId;
/**
*
* 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.
*
*/
private Boolean ebsOptimized;
/**
*
* The IAM instance profile.
*
*/
private LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile;
/**
*
* The block device mapping.
*
*
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error.
* This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a
* snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed
* using this action.
*
*
*/
private com.amazonaws.internal.SdkInternalList blockDeviceMappings;
/**
*
* 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.
*
*/
private com.amazonaws.internal.SdkInternalList networkInterfaces;
/**
*
* The ID of the AMI.
*
*/
private String imageId;
/**
*
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
*
*/
private String instanceType;
/**
*
* 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.
*
*
*/
private String keyName;
/**
*
* The monitoring for the instance.
*
*/
private LaunchTemplatesMonitoringRequest monitoring;
/**
*
* The placement for the instance.
*
*/
private LaunchTemplatePlacementRequest placement;
/**
*
* 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.
*
*
*/
private String ramDiskId;
/**
*
* 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.
*
*/
private Boolean disableApiTermination;
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*
* Default: stop
*
*/
private String instanceInitiatedShutdownBehavior;
/**
*
* The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance
* at Launch (Linux) and Adding User Data (Windows).
*
*/
private String userData;
/**
*
* 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.
*
*/
private com.amazonaws.internal.SdkInternalList tagSpecifications;
/**
*
* An elastic GPU to associate with the instance.
*
*/
private com.amazonaws.internal.SdkInternalList elasticGpuSpecifications;
/**
*
* The elastic inference accelerator for the instance.
*
*/
private com.amazonaws.internal.SdkInternalList elasticInferenceAccelerators;
/**
*
* 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.
*
*/
private com.amazonaws.internal.SdkInternalList securityGroupIds;
/**
*
* [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.
*
*/
private com.amazonaws.internal.SdkInternalList securityGroups;
/**
*
* The market (purchasing) option for the instances.
*
*/
private LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions;
/**
*
* The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
*
*/
private CreditSpecificationRequest creditSpecification;
/**
*
* The CPU options for the instance. For more information, see Optimizing CPU Options
* in the Amazon Elastic Compute Cloud User Guide.
*
*/
private LaunchTemplateCpuOptionsRequest cpuOptions;
/**
*
* 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).
*
*/
private LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification;
/**
*
* The license configurations.
*
*/
private com.amazonaws.internal.SdkInternalList licenseSpecifications;
/**
*
* Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the
* hibernation
* prerequisites. Hibernation is currently supported only for Amazon Linux. For more information, see Hibernate Your Instance in the
* Amazon Elastic Compute Cloud User Guide.
*
*/
private LaunchTemplateHibernationOptionsRequest hibernationOptions;
/**
*
* 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.
*
*
*
* @param 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 setKernelId(String kernelId) {
this.kernelId = 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.
*
*
*
* @return 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() {
return this.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.
*
*
*
* @param 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.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withKernelId(String kernelId) {
setKernelId(kernelId);
return this;
}
/**
*
* 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.
*
*
* @param 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 void setEbsOptimized(Boolean ebsOptimized) {
this.ebsOptimized = 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.
*
*
* @return 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() {
return this.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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withEbsOptimized(Boolean ebsOptimized) {
setEbsOptimized(ebsOptimized);
return this;
}
/**
*
* 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.
*
*
* @return 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() {
return this.ebsOptimized;
}
/**
*
* The IAM instance profile.
*
*
* @param iamInstanceProfile
* The IAM instance profile.
*/
public void setIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile) {
this.iamInstanceProfile = iamInstanceProfile;
}
/**
*
* The IAM instance profile.
*
*
* @return The IAM instance profile.
*/
public LaunchTemplateIamInstanceProfileSpecificationRequest getIamInstanceProfile() {
return this.iamInstanceProfile;
}
/**
*
* The IAM instance profile.
*
*
* @param iamInstanceProfile
* The IAM instance profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withIamInstanceProfile(LaunchTemplateIamInstanceProfileSpecificationRequest iamInstanceProfile) {
setIamInstanceProfile(iamInstanceProfile);
return this;
}
/**
*
* The block device mapping.
*
*
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error.
* This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a
* snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed
* using this action.
*
*
*
* @return The block device mapping.
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an
* error. This is because only blank volumes can be encrypted on start, and these are not created from a
* snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption
* status cannot be changed using this action.
*
*/
public java.util.List getBlockDeviceMappings() {
if (blockDeviceMappings == null) {
blockDeviceMappings = new com.amazonaws.internal.SdkInternalList();
}
return blockDeviceMappings;
}
/**
*
* The block device mapping.
*
*
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error.
* This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a
* snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed
* using this action.
*
*
*
* @param blockDeviceMappings
* The block device mapping.
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an
* error. This is because only blank volumes can be encrypted on start, and these are not created from a
* snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption
* status cannot be changed using this action.
*
*/
public void setBlockDeviceMappings(java.util.Collection blockDeviceMappings) {
if (blockDeviceMappings == null) {
this.blockDeviceMappings = null;
return;
}
this.blockDeviceMappings = new com.amazonaws.internal.SdkInternalList(blockDeviceMappings);
}
/**
*
* The block device mapping.
*
*
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error.
* This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a
* snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed
* using this action.
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setBlockDeviceMappings(java.util.Collection)} or {@link #withBlockDeviceMappings(java.util.Collection)}
* if you want to override the existing values.
*
*
* @param blockDeviceMappings
* The block device mapping.
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an
* error. This is because only blank volumes can be encrypted on start, and these are not created from a
* snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption
* status cannot be changed using this action.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withBlockDeviceMappings(LaunchTemplateBlockDeviceMappingRequest... blockDeviceMappings) {
if (this.blockDeviceMappings == null) {
setBlockDeviceMappings(new com.amazonaws.internal.SdkInternalList(blockDeviceMappings.length));
}
for (LaunchTemplateBlockDeviceMappingRequest ele : blockDeviceMappings) {
this.blockDeviceMappings.add(ele);
}
return this;
}
/**
*
* The block device mapping.
*
*
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an error.
* This is because only blank volumes can be encrypted on start, and these are not created from a snapshot. If a
* snapshot is the basis for the volume, it contains data by definition and its encryption status cannot be changed
* using this action.
*
*
*
* @param blockDeviceMappings
* The block device mapping.
*
* Supplying both a snapshot ID and an encryption value as arguments for block-device mapping results in an
* error. This is because only blank volumes can be encrypted on start, and these are not created from a
* snapshot. If a snapshot is the basis for the volume, it contains data by definition and its encryption
* status cannot be changed using this action.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withBlockDeviceMappings(java.util.Collection blockDeviceMappings) {
setBlockDeviceMappings(blockDeviceMappings);
return this;
}
/**
*
* 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.
*
*
* @return 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 java.util.List getNetworkInterfaces() {
if (networkInterfaces == null) {
networkInterfaces = new com.amazonaws.internal.SdkInternalList();
}
return 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.
*
*
* @param 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 setNetworkInterfaces(java.util.Collection networkInterfaces) {
if (networkInterfaces == null) {
this.networkInterfaces = null;
return;
}
this.networkInterfaces = new com.amazonaws.internal.SdkInternalList(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
* {@link #setNetworkInterfaces(java.util.Collection)} or {@link #withNetworkInterfaces(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withNetworkInterfaces(LaunchTemplateInstanceNetworkInterfaceSpecificationRequest... networkInterfaces) {
if (this.networkInterfaces == null) {
setNetworkInterfaces(new com.amazonaws.internal.SdkInternalList(
networkInterfaces.length));
}
for (LaunchTemplateInstanceNetworkInterfaceSpecificationRequest ele : networkInterfaces) {
this.networkInterfaces.add(ele);
}
return this;
}
/**
*
* 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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withNetworkInterfaces(java.util.Collection networkInterfaces) {
setNetworkInterfaces(networkInterfaces);
return this;
}
/**
*
* The ID of the AMI.
*
*
* @param imageId
* The ID of the AMI.
*/
public void setImageId(String imageId) {
this.imageId = imageId;
}
/**
*
* The ID of the AMI.
*
*
* @return The ID of the AMI.
*/
public String getImageId() {
return this.imageId;
}
/**
*
* The ID of the AMI.
*
*
* @param imageId
* The ID of the AMI.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withImageId(String imageId) {
setImageId(imageId);
return this;
}
/**
*
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @param instanceType
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
* @see InstanceType
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @return The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
* @see InstanceType
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @param instanceType
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public RequestLaunchTemplateData withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @param instanceType
* The instance type. For more information, see Instance Types in the
* Amazon Elastic Compute Cloud User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public RequestLaunchTemplateData withInstanceType(InstanceType instanceType) {
this.instanceType = instanceType.toString();
return this;
}
/**
*
* 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.
*
*
*
* @param 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 setKeyName(String keyName) {
this.keyName = 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.
*
*
*
* @return 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.
*
*/
public String getKeyName() {
return this.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.
*
*
*
* @param 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.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withKeyName(String keyName) {
setKeyName(keyName);
return this;
}
/**
*
* The monitoring for the instance.
*
*
* @param monitoring
* The monitoring for the instance.
*/
public void setMonitoring(LaunchTemplatesMonitoringRequest monitoring) {
this.monitoring = monitoring;
}
/**
*
* The monitoring for the instance.
*
*
* @return The monitoring for the instance.
*/
public LaunchTemplatesMonitoringRequest getMonitoring() {
return this.monitoring;
}
/**
*
* The monitoring for the instance.
*
*
* @param monitoring
* The monitoring for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withMonitoring(LaunchTemplatesMonitoringRequest monitoring) {
setMonitoring(monitoring);
return this;
}
/**
*
* The placement for the instance.
*
*
* @param placement
* The placement for the instance.
*/
public void setPlacement(LaunchTemplatePlacementRequest placement) {
this.placement = placement;
}
/**
*
* The placement for the instance.
*
*
* @return The placement for the instance.
*/
public LaunchTemplatePlacementRequest getPlacement() {
return this.placement;
}
/**
*
* The placement for the instance.
*
*
* @param placement
* The placement for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withPlacement(LaunchTemplatePlacementRequest placement) {
setPlacement(placement);
return this;
}
/**
*
* 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.
*
*
*
* @param 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 setRamDiskId(String ramDiskId) {
this.ramDiskId = 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.
*
*
*
* @return 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() {
return this.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.
*
*
*
* @param 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.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withRamDiskId(String ramDiskId) {
setRamDiskId(ramDiskId);
return this;
}
/**
*
* 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.
*
*
* @param 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 void setDisableApiTermination(Boolean disableApiTermination) {
this.disableApiTermination = 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.
*
*
* @return 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() {
return this.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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withDisableApiTermination(Boolean disableApiTermination) {
setDisableApiTermination(disableApiTermination);
return this;
}
/**
*
* 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.
*
*
* @return 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() {
return this.disableApiTermination;
}
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*
* Default: stop
*
*
* @param 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
* @see ShutdownBehavior
*/
public void setInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
this.instanceInitiatedShutdownBehavior = 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
*
*
* @return Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
* Default: stop
* @see ShutdownBehavior
*/
public String getInstanceInitiatedShutdownBehavior() {
return this.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
*
*
* @param 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
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShutdownBehavior
*/
public RequestLaunchTemplateData withInstanceInitiatedShutdownBehavior(String instanceInitiatedShutdownBehavior) {
setInstanceInitiatedShutdownBehavior(instanceInitiatedShutdownBehavior);
return this;
}
/**
*
* Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the
* operating system command for system shutdown).
*
*
* Default: stop
*
*
* @param 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
* @return Returns a reference to this object so that method calls can be chained together.
* @see ShutdownBehavior
*/
public RequestLaunchTemplateData withInstanceInitiatedShutdownBehavior(ShutdownBehavior instanceInitiatedShutdownBehavior) {
this.instanceInitiatedShutdownBehavior = instanceInitiatedShutdownBehavior.toString();
return this;
}
/**
*
* The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance
* at Launch (Linux) and Adding User Data (Windows).
*
*
* @param userData
* The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux
* Instance at Launch (Linux) and Adding User Data (Windows).
*/
public void setUserData(String userData) {
this.userData = userData;
}
/**
*
* The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance
* at Launch (Linux) and Adding User Data (Windows).
*
*
* @return The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux
* Instance at Launch (Linux) and Adding User Data (Windows).
*/
public String getUserData() {
return this.userData;
}
/**
*
* The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux Instance
* at Launch (Linux) and Adding User Data (Windows).
*
*
* @param userData
* The Base64-encoded user data to make available to the instance. For more information, see Running Commands on Your Linux
* Instance at Launch (Linux) and Adding User Data (Windows).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withUserData(String userData) {
setUserData(userData);
return this;
}
/**
*
* 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.
*
*
* @return 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 java.util.List getTagSpecifications() {
if (tagSpecifications == null) {
tagSpecifications = new com.amazonaws.internal.SdkInternalList();
}
return 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.
*
*
* @param 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 void setTagSpecifications(java.util.Collection tagSpecifications) {
if (tagSpecifications == null) {
this.tagSpecifications = null;
return;
}
this.tagSpecifications = new com.amazonaws.internal.SdkInternalList(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
* {@link #setTagSpecifications(java.util.Collection)} or {@link #withTagSpecifications(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withTagSpecifications(LaunchTemplateTagSpecificationRequest... tagSpecifications) {
if (this.tagSpecifications == null) {
setTagSpecifications(new com.amazonaws.internal.SdkInternalList(tagSpecifications.length));
}
for (LaunchTemplateTagSpecificationRequest ele : tagSpecifications) {
this.tagSpecifications.add(ele);
}
return this;
}
/**
*
* 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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withTagSpecifications(java.util.Collection tagSpecifications) {
setTagSpecifications(tagSpecifications);
return this;
}
/**
*
* An elastic GPU to associate with the instance.
*
*
* @return An elastic GPU to associate with the instance.
*/
public java.util.List getElasticGpuSpecifications() {
if (elasticGpuSpecifications == null) {
elasticGpuSpecifications = new com.amazonaws.internal.SdkInternalList();
}
return elasticGpuSpecifications;
}
/**
*
* An elastic GPU to associate with the instance.
*
*
* @param elasticGpuSpecifications
* An elastic GPU to associate with the instance.
*/
public void setElasticGpuSpecifications(java.util.Collection elasticGpuSpecifications) {
if (elasticGpuSpecifications == null) {
this.elasticGpuSpecifications = null;
return;
}
this.elasticGpuSpecifications = new com.amazonaws.internal.SdkInternalList(elasticGpuSpecifications);
}
/**
*
* An elastic GPU to associate with the instance.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setElasticGpuSpecifications(java.util.Collection)} or
* {@link #withElasticGpuSpecifications(java.util.Collection)} if you want to override the existing values.
*
*
* @param elasticGpuSpecifications
* An elastic GPU to associate with the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withElasticGpuSpecifications(ElasticGpuSpecification... elasticGpuSpecifications) {
if (this.elasticGpuSpecifications == null) {
setElasticGpuSpecifications(new com.amazonaws.internal.SdkInternalList(elasticGpuSpecifications.length));
}
for (ElasticGpuSpecification ele : elasticGpuSpecifications) {
this.elasticGpuSpecifications.add(ele);
}
return this;
}
/**
*
* An elastic GPU to associate with the instance.
*
*
* @param elasticGpuSpecifications
* An elastic GPU to associate with the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withElasticGpuSpecifications(java.util.Collection elasticGpuSpecifications) {
setElasticGpuSpecifications(elasticGpuSpecifications);
return this;
}
/**
*
* The elastic inference accelerator for the instance.
*
*
* @return The elastic inference accelerator for the instance.
*/
public java.util.List getElasticInferenceAccelerators() {
if (elasticInferenceAccelerators == null) {
elasticInferenceAccelerators = new com.amazonaws.internal.SdkInternalList();
}
return elasticInferenceAccelerators;
}
/**
*
* The elastic inference accelerator for the instance.
*
*
* @param elasticInferenceAccelerators
* The elastic inference accelerator for the instance.
*/
public void setElasticInferenceAccelerators(java.util.Collection elasticInferenceAccelerators) {
if (elasticInferenceAccelerators == null) {
this.elasticInferenceAccelerators = null;
return;
}
this.elasticInferenceAccelerators = new com.amazonaws.internal.SdkInternalList(elasticInferenceAccelerators);
}
/**
*
* The elastic inference accelerator for the instance.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setElasticInferenceAccelerators(java.util.Collection)} or
* {@link #withElasticInferenceAccelerators(java.util.Collection)} if you want to override the existing values.
*
*
* @param elasticInferenceAccelerators
* The elastic inference accelerator for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withElasticInferenceAccelerators(LaunchTemplateElasticInferenceAccelerator... elasticInferenceAccelerators) {
if (this.elasticInferenceAccelerators == null) {
setElasticInferenceAccelerators(new com.amazonaws.internal.SdkInternalList(
elasticInferenceAccelerators.length));
}
for (LaunchTemplateElasticInferenceAccelerator ele : elasticInferenceAccelerators) {
this.elasticInferenceAccelerators.add(ele);
}
return this;
}
/**
*
* The elastic inference accelerator for the instance.
*
*
* @param elasticInferenceAccelerators
* The elastic inference accelerator for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withElasticInferenceAccelerators(
java.util.Collection elasticInferenceAccelerators) {
setElasticInferenceAccelerators(elasticInferenceAccelerators);
return this;
}
/**
*
* 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.
*
*
* @return 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 java.util.List getSecurityGroupIds() {
if (securityGroupIds == null) {
securityGroupIds = new com.amazonaws.internal.SdkInternalList();
}
return 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.
*
*
* @param 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 void setSecurityGroupIds(java.util.Collection securityGroupIds) {
if (securityGroupIds == null) {
this.securityGroupIds = null;
return;
}
this.securityGroupIds = new com.amazonaws.internal.SdkInternalList(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
* {@link #setSecurityGroupIds(java.util.Collection)} or {@link #withSecurityGroupIds(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withSecurityGroupIds(String... securityGroupIds) {
if (this.securityGroupIds == null) {
setSecurityGroupIds(new com.amazonaws.internal.SdkInternalList(securityGroupIds.length));
}
for (String ele : securityGroupIds) {
this.securityGroupIds.add(ele);
}
return this;
}
/**
*
* 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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withSecurityGroupIds(java.util.Collection securityGroupIds) {
setSecurityGroupIds(securityGroupIds);
return this;
}
/**
*
* [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.
*
*
* @return [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 java.util.List getSecurityGroups() {
if (securityGroups == null) {
securityGroups = new com.amazonaws.internal.SdkInternalList();
}
return 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.
*
*
* @param 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 setSecurityGroups(java.util.Collection securityGroups) {
if (securityGroups == null) {
this.securityGroups = null;
return;
}
this.securityGroups = new com.amazonaws.internal.SdkInternalList(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
* {@link #setSecurityGroups(java.util.Collection)} or {@link #withSecurityGroups(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withSecurityGroups(String... securityGroups) {
if (this.securityGroups == null) {
setSecurityGroups(new com.amazonaws.internal.SdkInternalList(securityGroups.length));
}
for (String ele : securityGroups) {
this.securityGroups.add(ele);
}
return this;
}
/**
*
* [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.
*
*
* @param 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.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withSecurityGroups(java.util.Collection securityGroups) {
setSecurityGroups(securityGroups);
return this;
}
/**
*
* The market (purchasing) option for the instances.
*
*
* @param instanceMarketOptions
* The market (purchasing) option for the instances.
*/
public void setInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions) {
this.instanceMarketOptions = instanceMarketOptions;
}
/**
*
* The market (purchasing) option for the instances.
*
*
* @return The market (purchasing) option for the instances.
*/
public LaunchTemplateInstanceMarketOptionsRequest getInstanceMarketOptions() {
return this.instanceMarketOptions;
}
/**
*
* The market (purchasing) option for the instances.
*
*
* @param instanceMarketOptions
* The market (purchasing) option for the instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withInstanceMarketOptions(LaunchTemplateInstanceMarketOptionsRequest instanceMarketOptions) {
setInstanceMarketOptions(instanceMarketOptions);
return this;
}
/**
*
* The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
*
*
* @param creditSpecification
* The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
*/
public void setCreditSpecification(CreditSpecificationRequest creditSpecification) {
this.creditSpecification = creditSpecification;
}
/**
*
* The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
*
*
* @return The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
*/
public CreditSpecificationRequest getCreditSpecification() {
return this.creditSpecification;
}
/**
*
* The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
*
*
* @param creditSpecification
* The credit option for CPU usage of the instance. Valid for T2 or T3 instances only.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withCreditSpecification(CreditSpecificationRequest creditSpecification) {
setCreditSpecification(creditSpecification);
return this;
}
/**
*
* The CPU options for the instance. For more information, see Optimizing CPU Options
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param cpuOptions
* The CPU options for the instance. For more information, see Optimizing CPU
* Options in the Amazon Elastic Compute Cloud User Guide.
*/
public void setCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions) {
this.cpuOptions = cpuOptions;
}
/**
*
* The CPU options for the instance. For more information, see Optimizing CPU Options
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* @return The CPU options for the instance. For more information, see Optimizing CPU
* Options in the Amazon Elastic Compute Cloud User Guide.
*/
public LaunchTemplateCpuOptionsRequest getCpuOptions() {
return this.cpuOptions;
}
/**
*
* The CPU options for the instance. For more information, see Optimizing CPU Options
* in the Amazon Elastic Compute Cloud User Guide.
*
*
* @param cpuOptions
* The CPU options for the instance. For more information, see Optimizing CPU
* Options in the Amazon Elastic Compute Cloud User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withCpuOptions(LaunchTemplateCpuOptionsRequest cpuOptions) {
setCpuOptions(cpuOptions);
return this;
}
/**
*
* 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).
*
*
* @param 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 void setCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification) {
this.capacityReservationSpecification = 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).
*
*
* @return 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() {
return this.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).
*
*
* @param 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).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withCapacityReservationSpecification(LaunchTemplateCapacityReservationSpecificationRequest capacityReservationSpecification) {
setCapacityReservationSpecification(capacityReservationSpecification);
return this;
}
/**
*
* The license configurations.
*
*
* @return The license configurations.
*/
public java.util.List getLicenseSpecifications() {
if (licenseSpecifications == null) {
licenseSpecifications = new com.amazonaws.internal.SdkInternalList();
}
return licenseSpecifications;
}
/**
*
* The license configurations.
*
*
* @param licenseSpecifications
* The license configurations.
*/
public void setLicenseSpecifications(java.util.Collection licenseSpecifications) {
if (licenseSpecifications == null) {
this.licenseSpecifications = null;
return;
}
this.licenseSpecifications = new com.amazonaws.internal.SdkInternalList(licenseSpecifications);
}
/**
*
* The license configurations.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLicenseSpecifications(java.util.Collection)} or
* {@link #withLicenseSpecifications(java.util.Collection)} if you want to override the existing values.
*
*
* @param licenseSpecifications
* The license configurations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withLicenseSpecifications(LaunchTemplateLicenseConfigurationRequest... licenseSpecifications) {
if (this.licenseSpecifications == null) {
setLicenseSpecifications(new com.amazonaws.internal.SdkInternalList(licenseSpecifications.length));
}
for (LaunchTemplateLicenseConfigurationRequest ele : licenseSpecifications) {
this.licenseSpecifications.add(ele);
}
return this;
}
/**
*
* The license configurations.
*
*
* @param licenseSpecifications
* The license configurations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withLicenseSpecifications(java.util.Collection licenseSpecifications) {
setLicenseSpecifications(licenseSpecifications);
return this;
}
/**
*
* Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the
* hibernation
* prerequisites. Hibernation is currently supported only for Amazon Linux. For more information, see Hibernate Your Instance in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @param hibernationOptions
* Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance
* meets the hibernation prerequisites. Hibernation is currently supported only for Amazon Linux. For more
* information, see Hibernate
* Your Instance in the Amazon Elastic Compute Cloud User Guide.
*/
public void setHibernationOptions(LaunchTemplateHibernationOptionsRequest hibernationOptions) {
this.hibernationOptions = hibernationOptions;
}
/**
*
* Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the
* hibernation
* prerequisites. Hibernation is currently supported only for Amazon Linux. For more information, see Hibernate Your Instance in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @return Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance
* meets the hibernation prerequisites. Hibernation is currently supported only for Amazon Linux. For more
* information, see Hibernate
* Your Instance in the Amazon Elastic Compute Cloud User Guide.
*/
public LaunchTemplateHibernationOptionsRequest getHibernationOptions() {
return this.hibernationOptions;
}
/**
*
* Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance meets the
* hibernation
* prerequisites. Hibernation is currently supported only for Amazon Linux. For more information, see Hibernate Your Instance in the
* Amazon Elastic Compute Cloud User Guide.
*
*
* @param hibernationOptions
* Indicates whether an instance is enabled for hibernation. This parameter is valid only if the instance
* meets the hibernation prerequisites. Hibernation is currently supported only for Amazon Linux. For more
* information, see Hibernate
* Your Instance in the Amazon Elastic Compute Cloud User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RequestLaunchTemplateData withHibernationOptions(LaunchTemplateHibernationOptionsRequest hibernationOptions) {
setHibernationOptions(hibernationOptions);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getKernelId() != null)
sb.append("KernelId: ").append(getKernelId()).append(",");
if (getEbsOptimized() != null)
sb.append("EbsOptimized: ").append(getEbsOptimized()).append(",");
if (getIamInstanceProfile() != null)
sb.append("IamInstanceProfile: ").append(getIamInstanceProfile()).append(",");
if (getBlockDeviceMappings() != null)
sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(",");
if (getNetworkInterfaces() != null)
sb.append("NetworkInterfaces: ").append(getNetworkInterfaces()).append(",");
if (getImageId() != null)
sb.append("ImageId: ").append(getImageId()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getKeyName() != null)
sb.append("KeyName: ").append(getKeyName()).append(",");
if (getMonitoring() != null)
sb.append("Monitoring: ").append(getMonitoring()).append(",");
if (getPlacement() != null)
sb.append("Placement: ").append(getPlacement()).append(",");
if (getRamDiskId() != null)
sb.append("RamDiskId: ").append(getRamDiskId()).append(",");
if (getDisableApiTermination() != null)
sb.append("DisableApiTermination: ").append(getDisableApiTermination()).append(",");
if (getInstanceInitiatedShutdownBehavior() != null)
sb.append("InstanceInitiatedShutdownBehavior: ").append(getInstanceInitiatedShutdownBehavior()).append(",");
if (getUserData() != null)
sb.append("UserData: ").append(getUserData()).append(",");
if (getTagSpecifications() != null)
sb.append("TagSpecifications: ").append(getTagSpecifications()).append(",");
if (getElasticGpuSpecifications() != null)
sb.append("ElasticGpuSpecifications: ").append(getElasticGpuSpecifications()).append(",");
if (getElasticInferenceAccelerators() != null)
sb.append("ElasticInferenceAccelerators: ").append(getElasticInferenceAccelerators()).append(",");
if (getSecurityGroupIds() != null)
sb.append("SecurityGroupIds: ").append(getSecurityGroupIds()).append(",");
if (getSecurityGroups() != null)
sb.append("SecurityGroups: ").append(getSecurityGroups()).append(",");
if (getInstanceMarketOptions() != null)
sb.append("InstanceMarketOptions: ").append(getInstanceMarketOptions()).append(",");
if (getCreditSpecification() != null)
sb.append("CreditSpecification: ").append(getCreditSpecification()).append(",");
if (getCpuOptions() != null)
sb.append("CpuOptions: ").append(getCpuOptions()).append(",");
if (getCapacityReservationSpecification() != null)
sb.append("CapacityReservationSpecification: ").append(getCapacityReservationSpecification()).append(",");
if (getLicenseSpecifications() != null)
sb.append("LicenseSpecifications: ").append(getLicenseSpecifications()).append(",");
if (getHibernationOptions() != null)
sb.append("HibernationOptions: ").append(getHibernationOptions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RequestLaunchTemplateData == false)
return false;
RequestLaunchTemplateData other = (RequestLaunchTemplateData) obj;
if (other.getKernelId() == null ^ this.getKernelId() == null)
return false;
if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == false)
return false;
if (other.getEbsOptimized() == null ^ this.getEbsOptimized() == null)
return false;
if (other.getEbsOptimized() != null && other.getEbsOptimized().equals(this.getEbsOptimized()) == false)
return false;
if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null)
return false;
if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false)
return false;
if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null)
return false;
if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == false)
return false;
if (other.getNetworkInterfaces() == null ^ this.getNetworkInterfaces() == null)
return false;
if (other.getNetworkInterfaces() != null && other.getNetworkInterfaces().equals(this.getNetworkInterfaces()) == false)
return false;
if (other.getImageId() == null ^ this.getImageId() == null)
return false;
if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false)
return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
if (other.getKeyName() == null ^ this.getKeyName() == null)
return false;
if (other.getKeyName() != null && other.getKeyName().equals(this.getKeyName()) == false)
return false;
if (other.getMonitoring() == null ^ this.getMonitoring() == null)
return false;
if (other.getMonitoring() != null && other.getMonitoring().equals(this.getMonitoring()) == false)
return false;
if (other.getPlacement() == null ^ this.getPlacement() == null)
return false;
if (other.getPlacement() != null && other.getPlacement().equals(this.getPlacement()) == false)
return false;
if (other.getRamDiskId() == null ^ this.getRamDiskId() == null)
return false;
if (other.getRamDiskId() != null && other.getRamDiskId().equals(this.getRamDiskId()) == false)
return false;
if (other.getDisableApiTermination() == null ^ this.getDisableApiTermination() == null)
return false;
if (other.getDisableApiTermination() != null && other.getDisableApiTermination().equals(this.getDisableApiTermination()) == false)
return false;
if (other.getInstanceInitiatedShutdownBehavior() == null ^ this.getInstanceInitiatedShutdownBehavior() == null)
return false;
if (other.getInstanceInitiatedShutdownBehavior() != null
&& other.getInstanceInitiatedShutdownBehavior().equals(this.getInstanceInitiatedShutdownBehavior()) == false)
return false;
if (other.getUserData() == null ^ this.getUserData() == null)
return false;
if (other.getUserData() != null && other.getUserData().equals(this.getUserData()) == false)
return false;
if (other.getTagSpecifications() == null ^ this.getTagSpecifications() == null)
return false;
if (other.getTagSpecifications() != null && other.getTagSpecifications().equals(this.getTagSpecifications()) == false)
return false;
if (other.getElasticGpuSpecifications() == null ^ this.getElasticGpuSpecifications() == null)
return false;
if (other.getElasticGpuSpecifications() != null && other.getElasticGpuSpecifications().equals(this.getElasticGpuSpecifications()) == false)
return false;
if (other.getElasticInferenceAccelerators() == null ^ this.getElasticInferenceAccelerators() == null)
return false;
if (other.getElasticInferenceAccelerators() != null && other.getElasticInferenceAccelerators().equals(this.getElasticInferenceAccelerators()) == false)
return false;
if (other.getSecurityGroupIds() == null ^ this.getSecurityGroupIds() == null)
return false;
if (other.getSecurityGroupIds() != null && other.getSecurityGroupIds().equals(this.getSecurityGroupIds()) == false)
return false;
if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null)
return false;
if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false)
return false;
if (other.getInstanceMarketOptions() == null ^ this.getInstanceMarketOptions() == null)
return false;
if (other.getInstanceMarketOptions() != null && other.getInstanceMarketOptions().equals(this.getInstanceMarketOptions()) == false)
return false;
if (other.getCreditSpecification() == null ^ this.getCreditSpecification() == null)
return false;
if (other.getCreditSpecification() != null && other.getCreditSpecification().equals(this.getCreditSpecification()) == false)
return false;
if (other.getCpuOptions() == null ^ this.getCpuOptions() == null)
return false;
if (other.getCpuOptions() != null && other.getCpuOptions().equals(this.getCpuOptions()) == false)
return false;
if (other.getCapacityReservationSpecification() == null ^ this.getCapacityReservationSpecification() == null)
return false;
if (other.getCapacityReservationSpecification() != null
&& other.getCapacityReservationSpecification().equals(this.getCapacityReservationSpecification()) == false)
return false;
if (other.getLicenseSpecifications() == null ^ this.getLicenseSpecifications() == null)
return false;
if (other.getLicenseSpecifications() != null && other.getLicenseSpecifications().equals(this.getLicenseSpecifications()) == false)
return false;
if (other.getHibernationOptions() == null ^ this.getHibernationOptions() == null)
return false;
if (other.getHibernationOptions() != null && other.getHibernationOptions().equals(this.getHibernationOptions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode());
hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode());
hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode());
hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode());
hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode());
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode());
hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode());
hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode());
hashCode = prime * hashCode + ((getRamDiskId() == null) ? 0 : getRamDiskId().hashCode());
hashCode = prime * hashCode + ((getDisableApiTermination() == null) ? 0 : getDisableApiTermination().hashCode());
hashCode = prime * hashCode + ((getInstanceInitiatedShutdownBehavior() == null) ? 0 : getInstanceInitiatedShutdownBehavior().hashCode());
hashCode = prime * hashCode + ((getUserData() == null) ? 0 : getUserData().hashCode());
hashCode = prime * hashCode + ((getTagSpecifications() == null) ? 0 : getTagSpecifications().hashCode());
hashCode = prime * hashCode + ((getElasticGpuSpecifications() == null) ? 0 : getElasticGpuSpecifications().hashCode());
hashCode = prime * hashCode + ((getElasticInferenceAccelerators() == null) ? 0 : getElasticInferenceAccelerators().hashCode());
hashCode = prime * hashCode + ((getSecurityGroupIds() == null) ? 0 : getSecurityGroupIds().hashCode());
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode());
hashCode = prime * hashCode + ((getInstanceMarketOptions() == null) ? 0 : getInstanceMarketOptions().hashCode());
hashCode = prime * hashCode + ((getCreditSpecification() == null) ? 0 : getCreditSpecification().hashCode());
hashCode = prime * hashCode + ((getCpuOptions() == null) ? 0 : getCpuOptions().hashCode());
hashCode = prime * hashCode + ((getCapacityReservationSpecification() == null) ? 0 : getCapacityReservationSpecification().hashCode());
hashCode = prime * hashCode + ((getLicenseSpecifications() == null) ? 0 : getLicenseSpecifications().hashCode());
hashCode = prime * hashCode + ((getHibernationOptions() == null) ? 0 : getHibernationOptions().hashCode());
return hashCode;
}
@Override
public RequestLaunchTemplateData clone() {
try {
return (RequestLaunchTemplateData) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}