/* * Copyright 2018-2023 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; /** *
* Describes the launch specification for an instance. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class LaunchSpecification implements Serializable, Cloneable { /** ** The base64-encoded user data that instances use when starting up. User data is limited to 16 KB. *
*/ private String userData; /** ** Deprecated. *
*/ private String addressingType; /** ** The block device mapping entries. *
*/ private com.amazonaws.internal.SdkInternalList* Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to * Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't * available with all instance types. Additional usage charges apply when using an EBS Optimized instance. *
*
* Default: false
*
* The IAM instance profile. *
*/ private IamInstanceProfileSpecification iamInstanceProfile; /** ** The ID of the AMI. *
*/ private String imageId; /** ** The instance type. Only one instance type can be specified. *
*/ private String instanceType; /** ** The ID of the kernel. *
*/ private String kernelId; /** ** The name of the key pair. *
*/ private String keyName; /** ** The network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs * using the network interface. *
*/ private com.amazonaws.internal.SdkInternalList* The placement information for the instance. *
*/ private SpotPlacement placement; /** ** The ID of the RAM disk. *
*/ private String ramdiskId; /** ** The ID of the subnet in which to launch the instance. *
*/ private String subnetId; /** ** The IDs of the security groups. *
*/ private com.amazonaws.internal.SdkInternalList* One or more security group names. *
*/ private com.amazonaws.internal.SdkInternalList* The base64-encoded user data that instances use when starting up. User data is limited to 16 KB. *
* * @param userData * The base64-encoded user data that instances use when starting up. User data is limited to 16 KB. */ public void setUserData(String userData) { this.userData = userData; } /** ** The base64-encoded user data that instances use when starting up. User data is limited to 16 KB. *
* * @return The base64-encoded user data that instances use when starting up. User data is limited to 16 KB. */ public String getUserData() { return this.userData; } /** ** The base64-encoded user data that instances use when starting up. User data is limited to 16 KB. *
* * @param userData * The base64-encoded user data that instances use when starting up. User data is limited to 16 KB. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withUserData(String userData) { setUserData(userData); return this; } /** ** Deprecated. *
* * @param addressingType * Deprecated. */ public void setAddressingType(String addressingType) { this.addressingType = addressingType; } /** ** Deprecated. *
* * @return Deprecated. */ public String getAddressingType() { return this.addressingType; } /** ** Deprecated. *
* * @param addressingType * Deprecated. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withAddressingType(String addressingType) { setAddressingType(addressingType); return this; } /** ** The block device mapping entries. *
* * @return The block device mapping entries. */ public java.util.List* The block device mapping entries. *
* * @param blockDeviceMappings * The block device mapping entries. */ public void setBlockDeviceMappings(java.util.Collection* The block device mapping entries. *
** 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 entries. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) { if (this.blockDeviceMappings == null) { setBlockDeviceMappings(new com.amazonaws.internal.SdkInternalList* The block device mapping entries. *
* * @param blockDeviceMappings * The block device mapping entries. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withBlockDeviceMappings(java.util.Collection* Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to * Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't * available with all instance types. Additional usage charges apply when using an EBS Optimized instance. *
*
* Default: false
*
* Default: false
*/
public void setEbsOptimized(Boolean ebsOptimized) {
this.ebsOptimized = ebsOptimized;
}
/**
*
* Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to * Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't * available with all instance types. Additional usage charges apply when using an EBS Optimized instance. *
*
* Default: false
*
* Default: false
*/
public Boolean getEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to * Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't * available with all instance types. Additional usage charges apply when using an EBS Optimized instance. *
*
* Default: false
*
* Default: false
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LaunchSpecification withEbsOptimized(Boolean ebsOptimized) {
setEbsOptimized(ebsOptimized);
return this;
}
/**
*
* Indicates whether the instance is optimized for EBS I/O. This optimization provides dedicated throughput to * Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't * available with all instance types. Additional usage charges apply when using an EBS Optimized instance. *
*
* Default: false
*
* Default: false
*/
public Boolean isEbsOptimized() {
return this.ebsOptimized;
}
/**
*
* The IAM instance profile. *
* * @param iamInstanceProfile * The IAM instance profile. */ public void setIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile) { this.iamInstanceProfile = iamInstanceProfile; } /** ** The IAM instance profile. *
* * @return The IAM instance profile. */ public IamInstanceProfileSpecification 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 LaunchSpecification withIamInstanceProfile(IamInstanceProfileSpecification iamInstanceProfile) { setIamInstanceProfile(iamInstanceProfile); 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 LaunchSpecification withImageId(String imageId) { setImageId(imageId); return this; } /** ** The instance type. Only one instance type can be specified. *
* * @param instanceType * The instance type. Only one instance type can be specified. * @see InstanceType */ public void setInstanceType(String instanceType) { this.instanceType = instanceType; } /** ** The instance type. Only one instance type can be specified. *
* * @return The instance type. Only one instance type can be specified. * @see InstanceType */ public String getInstanceType() { return this.instanceType; } /** ** The instance type. Only one instance type can be specified. *
* * @param instanceType * The instance type. Only one instance type can be specified. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public LaunchSpecification withInstanceType(String instanceType) { setInstanceType(instanceType); return this; } /** ** The instance type. Only one instance type can be specified. *
* * @param instanceType * The instance type. Only one instance type can be specified. * @see InstanceType */ public void setInstanceType(InstanceType instanceType) { withInstanceType(instanceType); } /** ** The instance type. Only one instance type can be specified. *
* * @param instanceType * The instance type. Only one instance type can be specified. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceType */ public LaunchSpecification withInstanceType(InstanceType instanceType) { this.instanceType = instanceType.toString(); return this; } /** ** The ID of the kernel. *
* * @param kernelId * The ID of the kernel. */ public void setKernelId(String kernelId) { this.kernelId = kernelId; } /** ** The ID of the kernel. *
* * @return The ID of the kernel. */ public String getKernelId() { return this.kernelId; } /** ** The ID of the kernel. *
* * @param kernelId * The ID of the kernel. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withKernelId(String kernelId) { setKernelId(kernelId); return this; } /** ** The name of the key pair. *
* * @param keyName * The name of the key pair. */ public void setKeyName(String keyName) { this.keyName = keyName; } /** ** The name of the key pair. *
* * @return The name of the key pair. */ public String getKeyName() { return this.keyName; } /** ** The name of the key pair. *
* * @param keyName * The name of the key pair. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withKeyName(String keyName) { setKeyName(keyName); return this; } /** ** The network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs * using the network interface. *
* * @return The network interfaces. If you specify a network interface, you must specify subnet IDs and security * group IDs using the network interface. */ public java.util.List* The network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs * using the network interface. *
* * @param networkInterfaces * The network interfaces. If you specify a network interface, you must specify subnet IDs and security group * IDs using the network interface. */ public void setNetworkInterfaces(java.util.Collection* The network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs * using 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 * The network interfaces. If you specify a network interface, you must specify subnet IDs and security group * IDs using the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withNetworkInterfaces(InstanceNetworkInterfaceSpecification... networkInterfaces) { if (this.networkInterfaces == null) { setNetworkInterfaces(new com.amazonaws.internal.SdkInternalList* The network interfaces. If you specify a network interface, you must specify subnet IDs and security group IDs * using the network interface. *
* * @param networkInterfaces * The network interfaces. If you specify a network interface, you must specify subnet IDs and security group * IDs using the network interface. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withNetworkInterfaces(java.util.Collection* The placement information for the instance. *
* * @param placement * The placement information for the instance. */ public void setPlacement(SpotPlacement placement) { this.placement = placement; } /** ** The placement information for the instance. *
* * @return The placement information for the instance. */ public SpotPlacement getPlacement() { return this.placement; } /** ** The placement information for the instance. *
* * @param placement * The placement information for the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withPlacement(SpotPlacement placement) { setPlacement(placement); return this; } /** ** The ID of the RAM disk. *
* * @param ramdiskId * The ID of the RAM disk. */ public void setRamdiskId(String ramdiskId) { this.ramdiskId = ramdiskId; } /** ** The ID of the RAM disk. *
* * @return The ID of the RAM disk. */ public String getRamdiskId() { return this.ramdiskId; } /** ** The ID of the RAM disk. *
* * @param ramdiskId * The ID of the RAM disk. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withRamdiskId(String ramdiskId) { setRamdiskId(ramdiskId); return this; } /** ** The ID of the subnet in which to launch the instance. *
* * @param subnetId * The ID of the subnet in which to launch the instance. */ public void setSubnetId(String subnetId) { this.subnetId = subnetId; } /** ** The ID of the subnet in which to launch the instance. *
* * @return The ID of the subnet in which to launch the instance. */ public String getSubnetId() { return this.subnetId; } /** ** The ID of the subnet in which to launch the instance. *
* * @param subnetId * The ID of the subnet in which to launch the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withSubnetId(String subnetId) { setSubnetId(subnetId); return this; } /** ** The IDs of the security groups. *
* * @return The IDs of the security groups. */ public java.util.List* The IDs of the security groups. *
* * @param allSecurityGroups * The IDs of the security groups. */ public void setAllSecurityGroups(java.util.Collection* The IDs of the security groups. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setAllSecurityGroups(java.util.Collection)} or {@link #withAllSecurityGroups(java.util.Collection)} if * you want to override the existing values. *
* * @param allSecurityGroups * The IDs of the security groups. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withAllSecurityGroups(GroupIdentifier... allSecurityGroups) { if (this.allSecurityGroups == null) { setAllSecurityGroups(new com.amazonaws.internal.SdkInternalList* The IDs of the security groups. *
* * @param allSecurityGroups * The IDs of the security groups. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withAllSecurityGroups(java.util.Collection* One or more security group names. *
* * @return One or more security group names. */ public java.util.List* One or more security group names. *
* * @param securityGroups * One or more security group names. */ public void setSecurityGroups(java.util.Collection* One or more security group names. *
** 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 * One or more security group names. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withSecurityGroups(String... securityGroups) { if (this.securityGroups == null) { setSecurityGroups(new com.amazonaws.internal.SdkInternalList* One or more security group names. *
* * @param securityGroups * One or more security group names. * @return Returns a reference to this object so that method calls can be chained together. */ public LaunchSpecification withSecurityGroups(java.util.Collection