com.amazonaws.services.ec2.model.Instance Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2017-2022 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 an instance.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Instance implements Serializable, Cloneable {
/**
*
* The AMI launch index, which can be used to find this instance in the launch group.
*
*/
private Integer amiLaunchIndex;
/**
*
* The ID of the AMI used to launch the instance.
*
*/
private String imageId;
/**
*
* The ID of the instance.
*
*/
private String instanceId;
/**
*
* The instance type.
*
*/
private String instanceType;
/**
*
* The kernel associated with this instance, if applicable.
*
*/
private String kernelId;
/**
*
* The name of the key pair, if this instance was launched with an associated key pair.
*
*/
private String keyName;
/**
*
* The time the instance was launched.
*
*/
private java.util.Date launchTime;
/**
*
* The monitoring for the instance.
*
*/
private Monitoring monitoring;
/**
*
* The location where the instance launched, if applicable.
*
*/
private Placement placement;
/**
*
* The value is Windows
for Windows instances; otherwise blank.
*
*/
private String platform;
/**
*
* (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the
* Amazon EC2 network. This name is not available until the instance enters the running
state.
*
*
* [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS
* resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your
* custom domain name servers must resolve the hostname as appropriate.
*
*/
private String privateDnsName;
/**
*
* The private IPv4 address assigned to the instance.
*
*/
private String privateIpAddress;
/**
*
* The product codes attached to this instance, if applicable.
*
*/
private com.amazonaws.internal.SdkInternalList productCodes;
/**
*
* (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters
* the running
state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your
* VPC.
*
*/
private String publicDnsName;
/**
*
* The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
*
*
* A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
*
*/
private String publicIpAddress;
/**
*
* The RAM disk associated with this instance, if applicable.
*
*/
private String ramdiskId;
/**
*
* The current state of the instance.
*
*/
private InstanceState state;
/**
*
* The reason for the most recent state transition. This might be an empty string.
*
*/
private String stateTransitionReason;
/**
*
* [EC2-VPC] The ID of the subnet in which the instance is running.
*
*/
private String subnetId;
/**
*
* [EC2-VPC] The ID of the VPC in which the instance is running.
*
*/
private String vpcId;
/**
*
* The architecture of the image.
*
*/
private String architecture;
/**
*
* Any block device mapping entries for the instance.
*
*/
private com.amazonaws.internal.SdkInternalList blockDeviceMappings;
/**
*
* The idempotency token you provided when you launched the instance, if applicable.
*
*/
private String clientToken;
/**
*
* 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 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;
/**
*
* Specifies whether enhanced networking with ENA is enabled.
*
*/
private Boolean enaSupport;
/**
*
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro hypervisors.
*
*/
private String hypervisor;
/**
*
* The IAM instance profile associated with the instance, if applicable.
*
*/
private IamInstanceProfile iamInstanceProfile;
/**
*
* Indicates whether this is a Spot Instance or a Scheduled Instance.
*
*/
private String instanceLifecycle;
/**
*
* The Elastic GPU associated with the instance.
*
*/
private com.amazonaws.internal.SdkInternalList elasticGpuAssociations;
/**
*
* The elastic inference accelerator associated with the instance.
*
*/
private com.amazonaws.internal.SdkInternalList elasticInferenceAcceleratorAssociations;
/**
*
* [EC2-VPC] The network interfaces for the instance.
*
*/
private com.amazonaws.internal.SdkInternalList networkInterfaces;
/**
*
* The Amazon Resource Name (ARN) of the Outpost.
*
*/
private String outpostArn;
/**
*
* The device name of the root device volume (for example, /dev/sda1
).
*
*/
private String rootDeviceName;
/**
*
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
*
*/
private String rootDeviceType;
/**
*
* The security groups for the instance.
*
*/
private com.amazonaws.internal.SdkInternalList securityGroups;
/**
*
* Indicates whether source/destination checking is enabled.
*
*/
private Boolean sourceDestCheck;
/**
*
* If the request is a Spot Instance request, the ID of the request.
*
*/
private String spotInstanceRequestId;
/**
*
* Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
*
*/
private String sriovNetSupport;
/**
*
* The reason for the most recent state transition.
*
*/
private StateReason stateReason;
/**
*
* Any tags assigned to the instance.
*
*/
private com.amazonaws.internal.SdkInternalList tags;
/**
*
* The virtualization type of the instance.
*
*/
private String virtualizationType;
/**
*
* The CPU options for the instance.
*
*/
private CpuOptions cpuOptions;
/**
*
* The ID of the Capacity Reservation.
*
*/
private String capacityReservationId;
/**
*
* Information about the Capacity Reservation targeting option.
*
*/
private CapacityReservationSpecificationResponse capacityReservationSpecification;
/**
*
* Indicates whether the instance is enabled for hibernation.
*
*/
private HibernationOptions hibernationOptions;
/**
*
* The license configurations for the instance.
*
*/
private com.amazonaws.internal.SdkInternalList licenses;
/**
*
* The metadata options for the instance.
*
*/
private InstanceMetadataOptionsResponse metadataOptions;
/**
*
* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
*
*/
private EnclaveOptions enclaveOptions;
/**
*
* The boot mode of the instance. For more information, see Boot modes in the Amazon EC2 User
* Guide.
*
*/
private String bootMode;
/**
*
* The platform details value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*/
private String platformDetails;
/**
*
* The usage operation value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*/
private String usageOperation;
/**
*
* The time that the usage operation was last updated.
*
*/
private java.util.Date usageOperationUpdateTime;
/**
*
* The options for the instance hostname.
*
*/
private PrivateDnsNameOptionsResponse privateDnsNameOptions;
/**
*
* The IPv6 address assigned to the instance.
*
*/
private String ipv6Address;
/**
*
* Provides information on the recovery and maintenance options of your instance.
*
*/
private InstanceMaintenanceOptions maintenanceOptions;
/**
*
* The AMI launch index, which can be used to find this instance in the launch group.
*
*
* @param amiLaunchIndex
* The AMI launch index, which can be used to find this instance in the launch group.
*/
public void setAmiLaunchIndex(Integer amiLaunchIndex) {
this.amiLaunchIndex = amiLaunchIndex;
}
/**
*
* The AMI launch index, which can be used to find this instance in the launch group.
*
*
* @return The AMI launch index, which can be used to find this instance in the launch group.
*/
public Integer getAmiLaunchIndex() {
return this.amiLaunchIndex;
}
/**
*
* The AMI launch index, which can be used to find this instance in the launch group.
*
*
* @param amiLaunchIndex
* The AMI launch index, which can be used to find this instance in the launch group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withAmiLaunchIndex(Integer amiLaunchIndex) {
setAmiLaunchIndex(amiLaunchIndex);
return this;
}
/**
*
* The ID of the AMI used to launch the instance.
*
*
* @param imageId
* The ID of the AMI used to launch the instance.
*/
public void setImageId(String imageId) {
this.imageId = imageId;
}
/**
*
* The ID of the AMI used to launch the instance.
*
*
* @return The ID of the AMI used to launch the instance.
*/
public String getImageId() {
return this.imageId;
}
/**
*
* The ID of the AMI used to launch the instance.
*
*
* @param imageId
* The ID of the AMI used to launch the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withImageId(String imageId) {
setImageId(imageId);
return this;
}
/**
*
* The ID of the instance.
*
*
* @param instanceId
* The ID of the instance.
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
/**
*
* The ID of the instance.
*
*
* @return The ID of the instance.
*/
public String getInstanceId() {
return this.instanceId;
}
/**
*
* The ID of the instance.
*
*
* @param instanceId
* The ID of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withInstanceId(String instanceId) {
setInstanceId(instanceId);
return this;
}
/**
*
* The instance type.
*
*
* @param instanceType
* The instance type.
* @see InstanceType
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* The instance type.
*
*
* @return The instance type.
* @see InstanceType
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* The instance type.
*
*
* @param instanceType
* The instance type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public Instance withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* The instance type.
*
*
* @param instanceType
* The instance type.
* @see InstanceType
*/
public void setInstanceType(InstanceType instanceType) {
withInstanceType(instanceType);
}
/**
*
* The instance type.
*
*
* @param instanceType
* The instance type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public Instance withInstanceType(InstanceType instanceType) {
this.instanceType = instanceType.toString();
return this;
}
/**
*
* The kernel associated with this instance, if applicable.
*
*
* @param kernelId
* The kernel associated with this instance, if applicable.
*/
public void setKernelId(String kernelId) {
this.kernelId = kernelId;
}
/**
*
* The kernel associated with this instance, if applicable.
*
*
* @return The kernel associated with this instance, if applicable.
*/
public String getKernelId() {
return this.kernelId;
}
/**
*
* The kernel associated with this instance, if applicable.
*
*
* @param kernelId
* The kernel associated with this instance, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withKernelId(String kernelId) {
setKernelId(kernelId);
return this;
}
/**
*
* The name of the key pair, if this instance was launched with an associated key pair.
*
*
* @param keyName
* The name of the key pair, if this instance was launched with an associated key pair.
*/
public void setKeyName(String keyName) {
this.keyName = keyName;
}
/**
*
* The name of the key pair, if this instance was launched with an associated key pair.
*
*
* @return The name of the key pair, if this instance was launched with an associated key pair.
*/
public String getKeyName() {
return this.keyName;
}
/**
*
* The name of the key pair, if this instance was launched with an associated key pair.
*
*
* @param keyName
* The name of the key pair, if this instance was launched with an associated key pair.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withKeyName(String keyName) {
setKeyName(keyName);
return this;
}
/**
*
* The time the instance was launched.
*
*
* @param launchTime
* The time the instance was launched.
*/
public void setLaunchTime(java.util.Date launchTime) {
this.launchTime = launchTime;
}
/**
*
* The time the instance was launched.
*
*
* @return The time the instance was launched.
*/
public java.util.Date getLaunchTime() {
return this.launchTime;
}
/**
*
* The time the instance was launched.
*
*
* @param launchTime
* The time the instance was launched.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withLaunchTime(java.util.Date launchTime) {
setLaunchTime(launchTime);
return this;
}
/**
*
* The monitoring for the instance.
*
*
* @param monitoring
* The monitoring for the instance.
*/
public void setMonitoring(Monitoring monitoring) {
this.monitoring = monitoring;
}
/**
*
* The monitoring for the instance.
*
*
* @return The monitoring for the instance.
*/
public Monitoring 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 Instance withMonitoring(Monitoring monitoring) {
setMonitoring(monitoring);
return this;
}
/**
*
* The location where the instance launched, if applicable.
*
*
* @param placement
* The location where the instance launched, if applicable.
*/
public void setPlacement(Placement placement) {
this.placement = placement;
}
/**
*
* The location where the instance launched, if applicable.
*
*
* @return The location where the instance launched, if applicable.
*/
public Placement getPlacement() {
return this.placement;
}
/**
*
* The location where the instance launched, if applicable.
*
*
* @param placement
* The location where the instance launched, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withPlacement(Placement placement) {
setPlacement(placement);
return this;
}
/**
*
* The value is Windows
for Windows instances; otherwise blank.
*
*
* @param platform
* The value is Windows
for Windows instances; otherwise blank.
* @see PlatformValues
*/
public void setPlatform(String platform) {
this.platform = platform;
}
/**
*
* The value is Windows
for Windows instances; otherwise blank.
*
*
* @return The value is Windows
for Windows instances; otherwise blank.
* @see PlatformValues
*/
public String getPlatform() {
return this.platform;
}
/**
*
* The value is Windows
for Windows instances; otherwise blank.
*
*
* @param platform
* The value is Windows
for Windows instances; otherwise blank.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PlatformValues
*/
public Instance withPlatform(String platform) {
setPlatform(platform);
return this;
}
/**
*
* The value is Windows
for Windows instances; otherwise blank.
*
*
* @param platform
* The value is Windows
for Windows instances; otherwise blank.
* @see PlatformValues
*/
public void setPlatform(PlatformValues platform) {
withPlatform(platform);
}
/**
*
* The value is Windows
for Windows instances; otherwise blank.
*
*
* @param platform
* The value is Windows
for Windows instances; otherwise blank.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PlatformValues
*/
public Instance withPlatform(PlatformValues platform) {
this.platform = platform.toString();
return this;
}
/**
*
* (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the
* Amazon EC2 network. This name is not available until the instance enters the running
state.
*
*
* [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS
* resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your
* custom domain name servers must resolve the hostname as appropriate.
*
*
* @param privateDnsName
* (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used
* inside the Amazon EC2 network. This name is not available until the instance enters the
* running
state.
*
* [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled
* DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your
* VPC, your custom domain name servers must resolve the hostname as appropriate.
*/
public void setPrivateDnsName(String privateDnsName) {
this.privateDnsName = privateDnsName;
}
/**
*
* (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the
* Amazon EC2 network. This name is not available until the instance enters the running
state.
*
*
* [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS
* resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your
* custom domain name servers must resolve the hostname as appropriate.
*
*
* @return (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used
* inside the Amazon EC2 network. This name is not available until the instance enters the
* running
state.
*
* [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled
* DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your
* VPC, your custom domain name servers must resolve the hostname as appropriate.
*/
public String getPrivateDnsName() {
return this.privateDnsName;
}
/**
*
* (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the
* Amazon EC2 network. This name is not available until the instance enters the running
state.
*
*
* [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS
* resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your
* custom domain name servers must resolve the hostname as appropriate.
*
*
* @param privateDnsName
* (IPv4 only) The private DNS hostname name assigned to the instance. This DNS hostname can only be used
* inside the Amazon EC2 network. This name is not available until the instance enters the
* running
state.
*
* [EC2-VPC] The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled
* DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your
* VPC, your custom domain name servers must resolve the hostname as appropriate.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withPrivateDnsName(String privateDnsName) {
setPrivateDnsName(privateDnsName);
return this;
}
/**
*
* The private IPv4 address assigned to the instance.
*
*
* @param privateIpAddress
* The private IPv4 address assigned to the instance.
*/
public void setPrivateIpAddress(String privateIpAddress) {
this.privateIpAddress = privateIpAddress;
}
/**
*
* The private IPv4 address assigned to the instance.
*
*
* @return The private IPv4 address assigned to the instance.
*/
public String getPrivateIpAddress() {
return this.privateIpAddress;
}
/**
*
* The private IPv4 address assigned to the instance.
*
*
* @param privateIpAddress
* The private IPv4 address assigned to the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withPrivateIpAddress(String privateIpAddress) {
setPrivateIpAddress(privateIpAddress);
return this;
}
/**
*
* The product codes attached to this instance, if applicable.
*
*
* @return The product codes attached to this instance, if applicable.
*/
public java.util.List getProductCodes() {
if (productCodes == null) {
productCodes = new com.amazonaws.internal.SdkInternalList();
}
return productCodes;
}
/**
*
* The product codes attached to this instance, if applicable.
*
*
* @param productCodes
* The product codes attached to this instance, if applicable.
*/
public void setProductCodes(java.util.Collection productCodes) {
if (productCodes == null) {
this.productCodes = null;
return;
}
this.productCodes = new com.amazonaws.internal.SdkInternalList(productCodes);
}
/**
*
* The product codes attached to this instance, if applicable.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setProductCodes(java.util.Collection)} or {@link #withProductCodes(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param productCodes
* The product codes attached to this instance, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withProductCodes(ProductCode... productCodes) {
if (this.productCodes == null) {
setProductCodes(new com.amazonaws.internal.SdkInternalList(productCodes.length));
}
for (ProductCode ele : productCodes) {
this.productCodes.add(ele);
}
return this;
}
/**
*
* The product codes attached to this instance, if applicable.
*
*
* @param productCodes
* The product codes attached to this instance, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withProductCodes(java.util.Collection productCodes) {
setProductCodes(productCodes);
return this;
}
/**
*
* (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters
* the running
state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your
* VPC.
*
*
* @param publicDnsName
* (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance
* enters the running
state. For EC2-VPC, this name is only available if you've enabled DNS
* hostnames for your VPC.
*/
public void setPublicDnsName(String publicDnsName) {
this.publicDnsName = publicDnsName;
}
/**
*
* (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters
* the running
state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your
* VPC.
*
*
* @return (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance
* enters the running
state. For EC2-VPC, this name is only available if you've enabled DNS
* hostnames for your VPC.
*/
public String getPublicDnsName() {
return this.publicDnsName;
}
/**
*
* (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance enters
* the running
state. For EC2-VPC, this name is only available if you've enabled DNS hostnames for your
* VPC.
*
*
* @param publicDnsName
* (IPv4 only) The public DNS name assigned to the instance. This name is not available until the instance
* enters the running
state. For EC2-VPC, this name is only available if you've enabled DNS
* hostnames for your VPC.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withPublicDnsName(String publicDnsName) {
setPublicDnsName(publicDnsName);
return this;
}
/**
*
* The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
*
*
* A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
*
*
* @param publicIpAddress
* The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
*
* A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
*/
public void setPublicIpAddress(String publicIpAddress) {
this.publicIpAddress = publicIpAddress;
}
/**
*
* The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
*
*
* A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
*
*
* @return The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
*
* A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
*/
public String getPublicIpAddress() {
return this.publicIpAddress;
}
/**
*
* The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
*
*
* A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
*
*
* @param publicIpAddress
* The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.
*
* A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withPublicIpAddress(String publicIpAddress) {
setPublicIpAddress(publicIpAddress);
return this;
}
/**
*
* The RAM disk associated with this instance, if applicable.
*
*
* @param ramdiskId
* The RAM disk associated with this instance, if applicable.
*/
public void setRamdiskId(String ramdiskId) {
this.ramdiskId = ramdiskId;
}
/**
*
* The RAM disk associated with this instance, if applicable.
*
*
* @return The RAM disk associated with this instance, if applicable.
*/
public String getRamdiskId() {
return this.ramdiskId;
}
/**
*
* The RAM disk associated with this instance, if applicable.
*
*
* @param ramdiskId
* The RAM disk associated with this instance, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withRamdiskId(String ramdiskId) {
setRamdiskId(ramdiskId);
return this;
}
/**
*
* The current state of the instance.
*
*
* @param state
* The current state of the instance.
*/
public void setState(InstanceState state) {
this.state = state;
}
/**
*
* The current state of the instance.
*
*
* @return The current state of the instance.
*/
public InstanceState getState() {
return this.state;
}
/**
*
* The current state of the instance.
*
*
* @param state
* The current state of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withState(InstanceState state) {
setState(state);
return this;
}
/**
*
* The reason for the most recent state transition. This might be an empty string.
*
*
* @param stateTransitionReason
* The reason for the most recent state transition. This might be an empty string.
*/
public void setStateTransitionReason(String stateTransitionReason) {
this.stateTransitionReason = stateTransitionReason;
}
/**
*
* The reason for the most recent state transition. This might be an empty string.
*
*
* @return The reason for the most recent state transition. This might be an empty string.
*/
public String getStateTransitionReason() {
return this.stateTransitionReason;
}
/**
*
* The reason for the most recent state transition. This might be an empty string.
*
*
* @param stateTransitionReason
* The reason for the most recent state transition. This might be an empty string.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withStateTransitionReason(String stateTransitionReason) {
setStateTransitionReason(stateTransitionReason);
return this;
}
/**
*
* [EC2-VPC] The ID of the subnet in which the instance is running.
*
*
* @param subnetId
* [EC2-VPC] The ID of the subnet in which the instance is running.
*/
public void setSubnetId(String subnetId) {
this.subnetId = subnetId;
}
/**
*
* [EC2-VPC] The ID of the subnet in which the instance is running.
*
*
* @return [EC2-VPC] The ID of the subnet in which the instance is running.
*/
public String getSubnetId() {
return this.subnetId;
}
/**
*
* [EC2-VPC] The ID of the subnet in which the instance is running.
*
*
* @param subnetId
* [EC2-VPC] The ID of the subnet in which the instance is running.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSubnetId(String subnetId) {
setSubnetId(subnetId);
return this;
}
/**
*
* [EC2-VPC] The ID of the VPC in which the instance is running.
*
*
* @param vpcId
* [EC2-VPC] The ID of the VPC in which the instance is running.
*/
public void setVpcId(String vpcId) {
this.vpcId = vpcId;
}
/**
*
* [EC2-VPC] The ID of the VPC in which the instance is running.
*
*
* @return [EC2-VPC] The ID of the VPC in which the instance is running.
*/
public String getVpcId() {
return this.vpcId;
}
/**
*
* [EC2-VPC] The ID of the VPC in which the instance is running.
*
*
* @param vpcId
* [EC2-VPC] The ID of the VPC in which the instance is running.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withVpcId(String vpcId) {
setVpcId(vpcId);
return this;
}
/**
*
* The architecture of the image.
*
*
* @param architecture
* The architecture of the image.
* @see ArchitectureValues
*/
public void setArchitecture(String architecture) {
this.architecture = architecture;
}
/**
*
* The architecture of the image.
*
*
* @return The architecture of the image.
* @see ArchitectureValues
*/
public String getArchitecture() {
return this.architecture;
}
/**
*
* The architecture of the image.
*
*
* @param architecture
* The architecture of the image.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ArchitectureValues
*/
public Instance withArchitecture(String architecture) {
setArchitecture(architecture);
return this;
}
/**
*
* The architecture of the image.
*
*
* @param architecture
* The architecture of the image.
* @see ArchitectureValues
*/
public void setArchitecture(ArchitectureValues architecture) {
withArchitecture(architecture);
}
/**
*
* The architecture of the image.
*
*
* @param architecture
* The architecture of the image.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ArchitectureValues
*/
public Instance withArchitecture(ArchitectureValues architecture) {
this.architecture = architecture.toString();
return this;
}
/**
*
* Any block device mapping entries for the instance.
*
*
* @return Any block device mapping entries for the instance.
*/
public java.util.List getBlockDeviceMappings() {
if (blockDeviceMappings == null) {
blockDeviceMappings = new com.amazonaws.internal.SdkInternalList();
}
return blockDeviceMappings;
}
/**
*
* Any block device mapping entries for the instance.
*
*
* @param blockDeviceMappings
* Any block device mapping entries for the instance.
*/
public void setBlockDeviceMappings(java.util.Collection blockDeviceMappings) {
if (blockDeviceMappings == null) {
this.blockDeviceMappings = null;
return;
}
this.blockDeviceMappings = new com.amazonaws.internal.SdkInternalList(blockDeviceMappings);
}
/**
*
* Any block device mapping entries for the instance.
*
*
* 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
* Any block device mapping entries for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withBlockDeviceMappings(InstanceBlockDeviceMapping... blockDeviceMappings) {
if (this.blockDeviceMappings == null) {
setBlockDeviceMappings(new com.amazonaws.internal.SdkInternalList(blockDeviceMappings.length));
}
for (InstanceBlockDeviceMapping ele : blockDeviceMappings) {
this.blockDeviceMappings.add(ele);
}
return this;
}
/**
*
* Any block device mapping entries for the instance.
*
*
* @param blockDeviceMappings
* Any block device mapping entries for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withBlockDeviceMappings(java.util.Collection blockDeviceMappings) {
setBlockDeviceMappings(blockDeviceMappings);
return this;
}
/**
*
* The idempotency token you provided when you launched the instance, if applicable.
*
*
* @param clientToken
* The idempotency token you provided when you launched the instance, if applicable.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* The idempotency token you provided when you launched the instance, if applicable.
*
*
* @return The idempotency token you provided when you launched the instance, if applicable.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* The idempotency token you provided when you launched the instance, if applicable.
*
*
* @param clientToken
* The idempotency token you provided when you launched the instance, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withClientToken(String clientToken) {
setClientToken(clientToken);
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 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 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 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 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 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 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 Instance 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 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 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;
}
/**
*
* Specifies whether enhanced networking with ENA is enabled.
*
*
* @param enaSupport
* Specifies whether enhanced networking with ENA is enabled.
*/
public void setEnaSupport(Boolean enaSupport) {
this.enaSupport = enaSupport;
}
/**
*
* Specifies whether enhanced networking with ENA is enabled.
*
*
* @return Specifies whether enhanced networking with ENA is enabled.
*/
public Boolean getEnaSupport() {
return this.enaSupport;
}
/**
*
* Specifies whether enhanced networking with ENA is enabled.
*
*
* @param enaSupport
* Specifies whether enhanced networking with ENA is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withEnaSupport(Boolean enaSupport) {
setEnaSupport(enaSupport);
return this;
}
/**
*
* Specifies whether enhanced networking with ENA is enabled.
*
*
* @return Specifies whether enhanced networking with ENA is enabled.
*/
public Boolean isEnaSupport() {
return this.enaSupport;
}
/**
*
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro hypervisors.
*
*
* @param hypervisor
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro
* hypervisors.
* @see HypervisorType
*/
public void setHypervisor(String hypervisor) {
this.hypervisor = hypervisor;
}
/**
*
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro hypervisors.
*
*
* @return The hypervisor type of the instance. The value xen
is used for both Xen and Nitro
* hypervisors.
* @see HypervisorType
*/
public String getHypervisor() {
return this.hypervisor;
}
/**
*
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro hypervisors.
*
*
* @param hypervisor
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro
* hypervisors.
* @return Returns a reference to this object so that method calls can be chained together.
* @see HypervisorType
*/
public Instance withHypervisor(String hypervisor) {
setHypervisor(hypervisor);
return this;
}
/**
*
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro hypervisors.
*
*
* @param hypervisor
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro
* hypervisors.
* @see HypervisorType
*/
public void setHypervisor(HypervisorType hypervisor) {
withHypervisor(hypervisor);
}
/**
*
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro hypervisors.
*
*
* @param hypervisor
* The hypervisor type of the instance. The value xen
is used for both Xen and Nitro
* hypervisors.
* @return Returns a reference to this object so that method calls can be chained together.
* @see HypervisorType
*/
public Instance withHypervisor(HypervisorType hypervisor) {
this.hypervisor = hypervisor.toString();
return this;
}
/**
*
* The IAM instance profile associated with the instance, if applicable.
*
*
* @param iamInstanceProfile
* The IAM instance profile associated with the instance, if applicable.
*/
public void setIamInstanceProfile(IamInstanceProfile iamInstanceProfile) {
this.iamInstanceProfile = iamInstanceProfile;
}
/**
*
* The IAM instance profile associated with the instance, if applicable.
*
*
* @return The IAM instance profile associated with the instance, if applicable.
*/
public IamInstanceProfile getIamInstanceProfile() {
return this.iamInstanceProfile;
}
/**
*
* The IAM instance profile associated with the instance, if applicable.
*
*
* @param iamInstanceProfile
* The IAM instance profile associated with the instance, if applicable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withIamInstanceProfile(IamInstanceProfile iamInstanceProfile) {
setIamInstanceProfile(iamInstanceProfile);
return this;
}
/**
*
* Indicates whether this is a Spot Instance or a Scheduled Instance.
*
*
* @param instanceLifecycle
* Indicates whether this is a Spot Instance or a Scheduled Instance.
* @see InstanceLifecycleType
*/
public void setInstanceLifecycle(String instanceLifecycle) {
this.instanceLifecycle = instanceLifecycle;
}
/**
*
* Indicates whether this is a Spot Instance or a Scheduled Instance.
*
*
* @return Indicates whether this is a Spot Instance or a Scheduled Instance.
* @see InstanceLifecycleType
*/
public String getInstanceLifecycle() {
return this.instanceLifecycle;
}
/**
*
* Indicates whether this is a Spot Instance or a Scheduled Instance.
*
*
* @param instanceLifecycle
* Indicates whether this is a Spot Instance or a Scheduled Instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceLifecycleType
*/
public Instance withInstanceLifecycle(String instanceLifecycle) {
setInstanceLifecycle(instanceLifecycle);
return this;
}
/**
*
* Indicates whether this is a Spot Instance or a Scheduled Instance.
*
*
* @param instanceLifecycle
* Indicates whether this is a Spot Instance or a Scheduled Instance.
* @see InstanceLifecycleType
*/
public void setInstanceLifecycle(InstanceLifecycleType instanceLifecycle) {
withInstanceLifecycle(instanceLifecycle);
}
/**
*
* Indicates whether this is a Spot Instance or a Scheduled Instance.
*
*
* @param instanceLifecycle
* Indicates whether this is a Spot Instance or a Scheduled Instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceLifecycleType
*/
public Instance withInstanceLifecycle(InstanceLifecycleType instanceLifecycle) {
this.instanceLifecycle = instanceLifecycle.toString();
return this;
}
/**
*
* The Elastic GPU associated with the instance.
*
*
* @return The Elastic GPU associated with the instance.
*/
public java.util.List getElasticGpuAssociations() {
if (elasticGpuAssociations == null) {
elasticGpuAssociations = new com.amazonaws.internal.SdkInternalList();
}
return elasticGpuAssociations;
}
/**
*
* The Elastic GPU associated with the instance.
*
*
* @param elasticGpuAssociations
* The Elastic GPU associated with the instance.
*/
public void setElasticGpuAssociations(java.util.Collection elasticGpuAssociations) {
if (elasticGpuAssociations == null) {
this.elasticGpuAssociations = null;
return;
}
this.elasticGpuAssociations = new com.amazonaws.internal.SdkInternalList(elasticGpuAssociations);
}
/**
*
* The Elastic GPU associated with the instance.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setElasticGpuAssociations(java.util.Collection)} or
* {@link #withElasticGpuAssociations(java.util.Collection)} if you want to override the existing values.
*
*
* @param elasticGpuAssociations
* The Elastic GPU associated with the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withElasticGpuAssociations(ElasticGpuAssociation... elasticGpuAssociations) {
if (this.elasticGpuAssociations == null) {
setElasticGpuAssociations(new com.amazonaws.internal.SdkInternalList(elasticGpuAssociations.length));
}
for (ElasticGpuAssociation ele : elasticGpuAssociations) {
this.elasticGpuAssociations.add(ele);
}
return this;
}
/**
*
* The Elastic GPU associated with the instance.
*
*
* @param elasticGpuAssociations
* The Elastic GPU associated with the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withElasticGpuAssociations(java.util.Collection elasticGpuAssociations) {
setElasticGpuAssociations(elasticGpuAssociations);
return this;
}
/**
*
* The elastic inference accelerator associated with the instance.
*
*
* @return The elastic inference accelerator associated with the instance.
*/
public java.util.List getElasticInferenceAcceleratorAssociations() {
if (elasticInferenceAcceleratorAssociations == null) {
elasticInferenceAcceleratorAssociations = new com.amazonaws.internal.SdkInternalList();
}
return elasticInferenceAcceleratorAssociations;
}
/**
*
* The elastic inference accelerator associated with the instance.
*
*
* @param elasticInferenceAcceleratorAssociations
* The elastic inference accelerator associated with the instance.
*/
public void setElasticInferenceAcceleratorAssociations(java.util.Collection elasticInferenceAcceleratorAssociations) {
if (elasticInferenceAcceleratorAssociations == null) {
this.elasticInferenceAcceleratorAssociations = null;
return;
}
this.elasticInferenceAcceleratorAssociations = new com.amazonaws.internal.SdkInternalList(
elasticInferenceAcceleratorAssociations);
}
/**
*
* The elastic inference accelerator associated with the instance.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setElasticInferenceAcceleratorAssociations(java.util.Collection)} or
* {@link #withElasticInferenceAcceleratorAssociations(java.util.Collection)} if you want to override the existing
* values.
*
*
* @param elasticInferenceAcceleratorAssociations
* The elastic inference accelerator associated with the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withElasticInferenceAcceleratorAssociations(ElasticInferenceAcceleratorAssociation... elasticInferenceAcceleratorAssociations) {
if (this.elasticInferenceAcceleratorAssociations == null) {
setElasticInferenceAcceleratorAssociations(new com.amazonaws.internal.SdkInternalList(
elasticInferenceAcceleratorAssociations.length));
}
for (ElasticInferenceAcceleratorAssociation ele : elasticInferenceAcceleratorAssociations) {
this.elasticInferenceAcceleratorAssociations.add(ele);
}
return this;
}
/**
*
* The elastic inference accelerator associated with the instance.
*
*
* @param elasticInferenceAcceleratorAssociations
* The elastic inference accelerator associated with the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withElasticInferenceAcceleratorAssociations(
java.util.Collection elasticInferenceAcceleratorAssociations) {
setElasticInferenceAcceleratorAssociations(elasticInferenceAcceleratorAssociations);
return this;
}
/**
*
* [EC2-VPC] The network interfaces for the instance.
*
*
* @return [EC2-VPC] The network interfaces for the instance.
*/
public java.util.List getNetworkInterfaces() {
if (networkInterfaces == null) {
networkInterfaces = new com.amazonaws.internal.SdkInternalList();
}
return networkInterfaces;
}
/**
*
* [EC2-VPC] The network interfaces for the instance.
*
*
* @param networkInterfaces
* [EC2-VPC] The network interfaces for the instance.
*/
public void setNetworkInterfaces(java.util.Collection networkInterfaces) {
if (networkInterfaces == null) {
this.networkInterfaces = null;
return;
}
this.networkInterfaces = new com.amazonaws.internal.SdkInternalList(networkInterfaces);
}
/**
*
* [EC2-VPC] The network interfaces for the instance.
*
*
* 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
* [EC2-VPC] The network interfaces for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withNetworkInterfaces(InstanceNetworkInterface... networkInterfaces) {
if (this.networkInterfaces == null) {
setNetworkInterfaces(new com.amazonaws.internal.SdkInternalList(networkInterfaces.length));
}
for (InstanceNetworkInterface ele : networkInterfaces) {
this.networkInterfaces.add(ele);
}
return this;
}
/**
*
* [EC2-VPC] The network interfaces for the instance.
*
*
* @param networkInterfaces
* [EC2-VPC] The network interfaces for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withNetworkInterfaces(java.util.Collection networkInterfaces) {
setNetworkInterfaces(networkInterfaces);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost.
*
*
* @param outpostArn
* The Amazon Resource Name (ARN) of the Outpost.
*/
public void setOutpostArn(String outpostArn) {
this.outpostArn = outpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost.
*
*
* @return The Amazon Resource Name (ARN) of the Outpost.
*/
public String getOutpostArn() {
return this.outpostArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Outpost.
*
*
* @param outpostArn
* The Amazon Resource Name (ARN) of the Outpost.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withOutpostArn(String outpostArn) {
setOutpostArn(outpostArn);
return this;
}
/**
*
* The device name of the root device volume (for example, /dev/sda1
).
*
*
* @param rootDeviceName
* The device name of the root device volume (for example, /dev/sda1
).
*/
public void setRootDeviceName(String rootDeviceName) {
this.rootDeviceName = rootDeviceName;
}
/**
*
* The device name of the root device volume (for example, /dev/sda1
).
*
*
* @return The device name of the root device volume (for example, /dev/sda1
).
*/
public String getRootDeviceName() {
return this.rootDeviceName;
}
/**
*
* The device name of the root device volume (for example, /dev/sda1
).
*
*
* @param rootDeviceName
* The device name of the root device volume (for example, /dev/sda1
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withRootDeviceName(String rootDeviceName) {
setRootDeviceName(rootDeviceName);
return this;
}
/**
*
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
*
*
* @param rootDeviceType
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
* @see DeviceType
*/
public void setRootDeviceType(String rootDeviceType) {
this.rootDeviceType = rootDeviceType;
}
/**
*
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
*
*
* @return The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
* @see DeviceType
*/
public String getRootDeviceType() {
return this.rootDeviceType;
}
/**
*
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
*
*
* @param rootDeviceType
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeviceType
*/
public Instance withRootDeviceType(String rootDeviceType) {
setRootDeviceType(rootDeviceType);
return this;
}
/**
*
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
*
*
* @param rootDeviceType
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
* @see DeviceType
*/
public void setRootDeviceType(DeviceType rootDeviceType) {
withRootDeviceType(rootDeviceType);
}
/**
*
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
*
*
* @param rootDeviceType
* The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DeviceType
*/
public Instance withRootDeviceType(DeviceType rootDeviceType) {
this.rootDeviceType = rootDeviceType.toString();
return this;
}
/**
*
* The security groups for the instance.
*
*
* @return The security groups for the instance.
*/
public java.util.List getSecurityGroups() {
if (securityGroups == null) {
securityGroups = new com.amazonaws.internal.SdkInternalList();
}
return securityGroups;
}
/**
*
* The security groups for the instance.
*
*
* @param securityGroups
* The security groups for the instance.
*/
public void setSecurityGroups(java.util.Collection securityGroups) {
if (securityGroups == null) {
this.securityGroups = null;
return;
}
this.securityGroups = new com.amazonaws.internal.SdkInternalList(securityGroups);
}
/**
*
* The security groups for the instance.
*
*
* 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
* The security groups for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSecurityGroups(GroupIdentifier... securityGroups) {
if (this.securityGroups == null) {
setSecurityGroups(new com.amazonaws.internal.SdkInternalList(securityGroups.length));
}
for (GroupIdentifier ele : securityGroups) {
this.securityGroups.add(ele);
}
return this;
}
/**
*
* The security groups for the instance.
*
*
* @param securityGroups
* The security groups for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSecurityGroups(java.util.Collection securityGroups) {
setSecurityGroups(securityGroups);
return this;
}
/**
*
* Indicates whether source/destination checking is enabled.
*
*
* @param sourceDestCheck
* Indicates whether source/destination checking is enabled.
*/
public void setSourceDestCheck(Boolean sourceDestCheck) {
this.sourceDestCheck = sourceDestCheck;
}
/**
*
* Indicates whether source/destination checking is enabled.
*
*
* @return Indicates whether source/destination checking is enabled.
*/
public Boolean getSourceDestCheck() {
return this.sourceDestCheck;
}
/**
*
* Indicates whether source/destination checking is enabled.
*
*
* @param sourceDestCheck
* Indicates whether source/destination checking is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSourceDestCheck(Boolean sourceDestCheck) {
setSourceDestCheck(sourceDestCheck);
return this;
}
/**
*
* Indicates whether source/destination checking is enabled.
*
*
* @return Indicates whether source/destination checking is enabled.
*/
public Boolean isSourceDestCheck() {
return this.sourceDestCheck;
}
/**
*
* If the request is a Spot Instance request, the ID of the request.
*
*
* @param spotInstanceRequestId
* If the request is a Spot Instance request, the ID of the request.
*/
public void setSpotInstanceRequestId(String spotInstanceRequestId) {
this.spotInstanceRequestId = spotInstanceRequestId;
}
/**
*
* If the request is a Spot Instance request, the ID of the request.
*
*
* @return If the request is a Spot Instance request, the ID of the request.
*/
public String getSpotInstanceRequestId() {
return this.spotInstanceRequestId;
}
/**
*
* If the request is a Spot Instance request, the ID of the request.
*
*
* @param spotInstanceRequestId
* If the request is a Spot Instance request, the ID of the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSpotInstanceRequestId(String spotInstanceRequestId) {
setSpotInstanceRequestId(spotInstanceRequestId);
return this;
}
/**
*
* Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
*
*
* @param sriovNetSupport
* Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
*/
public void setSriovNetSupport(String sriovNetSupport) {
this.sriovNetSupport = sriovNetSupport;
}
/**
*
* Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
*
*
* @return Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
*/
public String getSriovNetSupport() {
return this.sriovNetSupport;
}
/**
*
* Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
*
*
* @param sriovNetSupport
* Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withSriovNetSupport(String sriovNetSupport) {
setSriovNetSupport(sriovNetSupport);
return this;
}
/**
*
* The reason for the most recent state transition.
*
*
* @param stateReason
* The reason for the most recent state transition.
*/
public void setStateReason(StateReason stateReason) {
this.stateReason = stateReason;
}
/**
*
* The reason for the most recent state transition.
*
*
* @return The reason for the most recent state transition.
*/
public StateReason getStateReason() {
return this.stateReason;
}
/**
*
* The reason for the most recent state transition.
*
*
* @param stateReason
* The reason for the most recent state transition.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withStateReason(StateReason stateReason) {
setStateReason(stateReason);
return this;
}
/**
*
* Any tags assigned to the instance.
*
*
* @return Any tags assigned to the instance.
*/
public java.util.List getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList();
}
return tags;
}
/**
*
* Any tags assigned to the instance.
*
*
* @param tags
* Any tags assigned to the instance.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList(tags);
}
/**
*
* Any tags assigned to the instance.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* Any tags assigned to the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withTags(Tag... tags) {
if (this.tags == null) {
setTags(new com.amazonaws.internal.SdkInternalList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* Any tags assigned to the instance.
*
*
* @param tags
* Any tags assigned to the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* The virtualization type of the instance.
*
*
* @param virtualizationType
* The virtualization type of the instance.
* @see VirtualizationType
*/
public void setVirtualizationType(String virtualizationType) {
this.virtualizationType = virtualizationType;
}
/**
*
* The virtualization type of the instance.
*
*
* @return The virtualization type of the instance.
* @see VirtualizationType
*/
public String getVirtualizationType() {
return this.virtualizationType;
}
/**
*
* The virtualization type of the instance.
*
*
* @param virtualizationType
* The virtualization type of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VirtualizationType
*/
public Instance withVirtualizationType(String virtualizationType) {
setVirtualizationType(virtualizationType);
return this;
}
/**
*
* The virtualization type of the instance.
*
*
* @param virtualizationType
* The virtualization type of the instance.
* @see VirtualizationType
*/
public void setVirtualizationType(VirtualizationType virtualizationType) {
withVirtualizationType(virtualizationType);
}
/**
*
* The virtualization type of the instance.
*
*
* @param virtualizationType
* The virtualization type of the instance.
* @return Returns a reference to this object so that method calls can be chained together.
* @see VirtualizationType
*/
public Instance withVirtualizationType(VirtualizationType virtualizationType) {
this.virtualizationType = virtualizationType.toString();
return this;
}
/**
*
* The CPU options for the instance.
*
*
* @param cpuOptions
* The CPU options for the instance.
*/
public void setCpuOptions(CpuOptions cpuOptions) {
this.cpuOptions = cpuOptions;
}
/**
*
* The CPU options for the instance.
*
*
* @return The CPU options for the instance.
*/
public CpuOptions getCpuOptions() {
return this.cpuOptions;
}
/**
*
* The CPU options for the instance.
*
*
* @param cpuOptions
* The CPU options for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withCpuOptions(CpuOptions cpuOptions) {
setCpuOptions(cpuOptions);
return this;
}
/**
*
* The ID of the Capacity Reservation.
*
*
* @param capacityReservationId
* The ID of the Capacity Reservation.
*/
public void setCapacityReservationId(String capacityReservationId) {
this.capacityReservationId = capacityReservationId;
}
/**
*
* The ID of the Capacity Reservation.
*
*
* @return The ID of the Capacity Reservation.
*/
public String getCapacityReservationId() {
return this.capacityReservationId;
}
/**
*
* The ID of the Capacity Reservation.
*
*
* @param capacityReservationId
* The ID of the Capacity Reservation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withCapacityReservationId(String capacityReservationId) {
setCapacityReservationId(capacityReservationId);
return this;
}
/**
*
* Information about the Capacity Reservation targeting option.
*
*
* @param capacityReservationSpecification
* Information about the Capacity Reservation targeting option.
*/
public void setCapacityReservationSpecification(CapacityReservationSpecificationResponse capacityReservationSpecification) {
this.capacityReservationSpecification = capacityReservationSpecification;
}
/**
*
* Information about the Capacity Reservation targeting option.
*
*
* @return Information about the Capacity Reservation targeting option.
*/
public CapacityReservationSpecificationResponse getCapacityReservationSpecification() {
return this.capacityReservationSpecification;
}
/**
*
* Information about the Capacity Reservation targeting option.
*
*
* @param capacityReservationSpecification
* Information about the Capacity Reservation targeting option.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withCapacityReservationSpecification(CapacityReservationSpecificationResponse capacityReservationSpecification) {
setCapacityReservationSpecification(capacityReservationSpecification);
return this;
}
/**
*
* Indicates whether the instance is enabled for hibernation.
*
*
* @param hibernationOptions
* Indicates whether the instance is enabled for hibernation.
*/
public void setHibernationOptions(HibernationOptions hibernationOptions) {
this.hibernationOptions = hibernationOptions;
}
/**
*
* Indicates whether the instance is enabled for hibernation.
*
*
* @return Indicates whether the instance is enabled for hibernation.
*/
public HibernationOptions getHibernationOptions() {
return this.hibernationOptions;
}
/**
*
* Indicates whether the instance is enabled for hibernation.
*
*
* @param hibernationOptions
* Indicates whether the instance is enabled for hibernation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withHibernationOptions(HibernationOptions hibernationOptions) {
setHibernationOptions(hibernationOptions);
return this;
}
/**
*
* The license configurations for the instance.
*
*
* @return The license configurations for the instance.
*/
public java.util.List getLicenses() {
if (licenses == null) {
licenses = new com.amazonaws.internal.SdkInternalList();
}
return licenses;
}
/**
*
* The license configurations for the instance.
*
*
* @param licenses
* The license configurations for the instance.
*/
public void setLicenses(java.util.Collection licenses) {
if (licenses == null) {
this.licenses = null;
return;
}
this.licenses = new com.amazonaws.internal.SdkInternalList(licenses);
}
/**
*
* The license configurations for the instance.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLicenses(java.util.Collection)} or {@link #withLicenses(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param licenses
* The license configurations for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withLicenses(LicenseConfiguration... licenses) {
if (this.licenses == null) {
setLicenses(new com.amazonaws.internal.SdkInternalList(licenses.length));
}
for (LicenseConfiguration ele : licenses) {
this.licenses.add(ele);
}
return this;
}
/**
*
* The license configurations for the instance.
*
*
* @param licenses
* The license configurations for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withLicenses(java.util.Collection licenses) {
setLicenses(licenses);
return this;
}
/**
*
* The metadata options for the instance.
*
*
* @param metadataOptions
* The metadata options for the instance.
*/
public void setMetadataOptions(InstanceMetadataOptionsResponse metadataOptions) {
this.metadataOptions = metadataOptions;
}
/**
*
* The metadata options for the instance.
*
*
* @return The metadata options for the instance.
*/
public InstanceMetadataOptionsResponse getMetadataOptions() {
return this.metadataOptions;
}
/**
*
* The metadata options for the instance.
*
*
* @param metadataOptions
* The metadata options for the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withMetadataOptions(InstanceMetadataOptionsResponse metadataOptions) {
setMetadataOptions(metadataOptions);
return this;
}
/**
*
* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
*
*
* @param enclaveOptions
* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
*/
public void setEnclaveOptions(EnclaveOptions enclaveOptions) {
this.enclaveOptions = enclaveOptions;
}
/**
*
* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
*
*
* @return Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
*/
public EnclaveOptions getEnclaveOptions() {
return this.enclaveOptions;
}
/**
*
* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
*
*
* @param enclaveOptions
* Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withEnclaveOptions(EnclaveOptions enclaveOptions) {
setEnclaveOptions(enclaveOptions);
return this;
}
/**
*
* The boot mode of the instance. For more information, see Boot modes in the Amazon EC2 User
* Guide.
*
*
* @param bootMode
* The boot mode of the instance. For more information, see Boot modes in the Amazon
* EC2 User Guide.
* @see BootModeValues
*/
public void setBootMode(String bootMode) {
this.bootMode = bootMode;
}
/**
*
* The boot mode of the instance. For more information, see Boot modes in the Amazon EC2 User
* Guide.
*
*
* @return The boot mode of the instance. For more information, see Boot modes in the Amazon
* EC2 User Guide.
* @see BootModeValues
*/
public String getBootMode() {
return this.bootMode;
}
/**
*
* The boot mode of the instance. For more information, see Boot modes in the Amazon EC2 User
* Guide.
*
*
* @param bootMode
* The boot mode of the instance. For more information, see Boot modes in the Amazon
* EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BootModeValues
*/
public Instance withBootMode(String bootMode) {
setBootMode(bootMode);
return this;
}
/**
*
* The boot mode of the instance. For more information, see Boot modes in the Amazon EC2 User
* Guide.
*
*
* @param bootMode
* The boot mode of the instance. For more information, see Boot modes in the Amazon
* EC2 User Guide.
* @see BootModeValues
*/
public void setBootMode(BootModeValues bootMode) {
withBootMode(bootMode);
}
/**
*
* The boot mode of the instance. For more information, see Boot modes in the Amazon EC2 User
* Guide.
*
*
* @param bootMode
* The boot mode of the instance. For more information, see Boot modes in the Amazon
* EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see BootModeValues
*/
public Instance withBootMode(BootModeValues bootMode) {
this.bootMode = bootMode.toString();
return this;
}
/**
*
* The platform details value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*
* @param platformDetails
* The platform details value for the instance. For more information, see AMI billing
* information fields in the Amazon EC2 User Guide.
*/
public void setPlatformDetails(String platformDetails) {
this.platformDetails = platformDetails;
}
/**
*
* The platform details value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*
* @return The platform details value for the instance. For more information, see AMI billing
* information fields in the Amazon EC2 User Guide.
*/
public String getPlatformDetails() {
return this.platformDetails;
}
/**
*
* The platform details value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*
* @param platformDetails
* The platform details value for the instance. For more information, see AMI billing
* information fields in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withPlatformDetails(String platformDetails) {
setPlatformDetails(platformDetails);
return this;
}
/**
*
* The usage operation value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*
* @param usageOperation
* The usage operation value for the instance. For more information, see AMI billing
* information fields in the Amazon EC2 User Guide.
*/
public void setUsageOperation(String usageOperation) {
this.usageOperation = usageOperation;
}
/**
*
* The usage operation value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*
* @return The usage operation value for the instance. For more information, see AMI billing
* information fields in the Amazon EC2 User Guide.
*/
public String getUsageOperation() {
return this.usageOperation;
}
/**
*
* The usage operation value for the instance. For more information, see AMI billing information
* fields in the Amazon EC2 User Guide.
*
*
* @param usageOperation
* The usage operation value for the instance. For more information, see AMI billing
* information fields in the Amazon EC2 User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withUsageOperation(String usageOperation) {
setUsageOperation(usageOperation);
return this;
}
/**
*
* The time that the usage operation was last updated.
*
*
* @param usageOperationUpdateTime
* The time that the usage operation was last updated.
*/
public void setUsageOperationUpdateTime(java.util.Date usageOperationUpdateTime) {
this.usageOperationUpdateTime = usageOperationUpdateTime;
}
/**
*
* The time that the usage operation was last updated.
*
*
* @return The time that the usage operation was last updated.
*/
public java.util.Date getUsageOperationUpdateTime() {
return this.usageOperationUpdateTime;
}
/**
*
* The time that the usage operation was last updated.
*
*
* @param usageOperationUpdateTime
* The time that the usage operation was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withUsageOperationUpdateTime(java.util.Date usageOperationUpdateTime) {
setUsageOperationUpdateTime(usageOperationUpdateTime);
return this;
}
/**
*
* The options for the instance hostname.
*
*
* @param privateDnsNameOptions
* The options for the instance hostname.
*/
public void setPrivateDnsNameOptions(PrivateDnsNameOptionsResponse privateDnsNameOptions) {
this.privateDnsNameOptions = privateDnsNameOptions;
}
/**
*
* The options for the instance hostname.
*
*
* @return The options for the instance hostname.
*/
public PrivateDnsNameOptionsResponse getPrivateDnsNameOptions() {
return this.privateDnsNameOptions;
}
/**
*
* The options for the instance hostname.
*
*
* @param privateDnsNameOptions
* The options for the instance hostname.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withPrivateDnsNameOptions(PrivateDnsNameOptionsResponse privateDnsNameOptions) {
setPrivateDnsNameOptions(privateDnsNameOptions);
return this;
}
/**
*
* The IPv6 address assigned to the instance.
*
*
* @param ipv6Address
* The IPv6 address assigned to the instance.
*/
public void setIpv6Address(String ipv6Address) {
this.ipv6Address = ipv6Address;
}
/**
*
* The IPv6 address assigned to the instance.
*
*
* @return The IPv6 address assigned to the instance.
*/
public String getIpv6Address() {
return this.ipv6Address;
}
/**
*
* The IPv6 address assigned to the instance.
*
*
* @param ipv6Address
* The IPv6 address assigned to the instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withIpv6Address(String ipv6Address) {
setIpv6Address(ipv6Address);
return this;
}
/**
*
* Provides information on the recovery and maintenance options of your instance.
*
*
* @param maintenanceOptions
* Provides information on the recovery and maintenance options of your instance.
*/
public void setMaintenanceOptions(InstanceMaintenanceOptions maintenanceOptions) {
this.maintenanceOptions = maintenanceOptions;
}
/**
*
* Provides information on the recovery and maintenance options of your instance.
*
*
* @return Provides information on the recovery and maintenance options of your instance.
*/
public InstanceMaintenanceOptions getMaintenanceOptions() {
return this.maintenanceOptions;
}
/**
*
* Provides information on the recovery and maintenance options of your instance.
*
*
* @param maintenanceOptions
* Provides information on the recovery and maintenance options of your instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Instance withMaintenanceOptions(InstanceMaintenanceOptions maintenanceOptions) {
setMaintenanceOptions(maintenanceOptions);
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 (getAmiLaunchIndex() != null)
sb.append("AmiLaunchIndex: ").append(getAmiLaunchIndex()).append(",");
if (getImageId() != null)
sb.append("ImageId: ").append(getImageId()).append(",");
if (getInstanceId() != null)
sb.append("InstanceId: ").append(getInstanceId()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType()).append(",");
if (getKernelId() != null)
sb.append("KernelId: ").append(getKernelId()).append(",");
if (getKeyName() != null)
sb.append("KeyName: ").append(getKeyName()).append(",");
if (getLaunchTime() != null)
sb.append("LaunchTime: ").append(getLaunchTime()).append(",");
if (getMonitoring() != null)
sb.append("Monitoring: ").append(getMonitoring()).append(",");
if (getPlacement() != null)
sb.append("Placement: ").append(getPlacement()).append(",");
if (getPlatform() != null)
sb.append("Platform: ").append(getPlatform()).append(",");
if (getPrivateDnsName() != null)
sb.append("PrivateDnsName: ").append(getPrivateDnsName()).append(",");
if (getPrivateIpAddress() != null)
sb.append("PrivateIpAddress: ").append(getPrivateIpAddress()).append(",");
if (getProductCodes() != null)
sb.append("ProductCodes: ").append(getProductCodes()).append(",");
if (getPublicDnsName() != null)
sb.append("PublicDnsName: ").append(getPublicDnsName()).append(",");
if (getPublicIpAddress() != null)
sb.append("PublicIpAddress: ").append(getPublicIpAddress()).append(",");
if (getRamdiskId() != null)
sb.append("RamdiskId: ").append(getRamdiskId()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getStateTransitionReason() != null)
sb.append("StateTransitionReason: ").append(getStateTransitionReason()).append(",");
if (getSubnetId() != null)
sb.append("SubnetId: ").append(getSubnetId()).append(",");
if (getVpcId() != null)
sb.append("VpcId: ").append(getVpcId()).append(",");
if (getArchitecture() != null)
sb.append("Architecture: ").append(getArchitecture()).append(",");
if (getBlockDeviceMappings() != null)
sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(",");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getEbsOptimized() != null)
sb.append("EbsOptimized: ").append(getEbsOptimized()).append(",");
if (getEnaSupport() != null)
sb.append("EnaSupport: ").append(getEnaSupport()).append(",");
if (getHypervisor() != null)
sb.append("Hypervisor: ").append(getHypervisor()).append(",");
if (getIamInstanceProfile() != null)
sb.append("IamInstanceProfile: ").append(getIamInstanceProfile()).append(",");
if (getInstanceLifecycle() != null)
sb.append("InstanceLifecycle: ").append(getInstanceLifecycle()).append(",");
if (getElasticGpuAssociations() != null)
sb.append("ElasticGpuAssociations: ").append(getElasticGpuAssociations()).append(",");
if (getElasticInferenceAcceleratorAssociations() != null)
sb.append("ElasticInferenceAcceleratorAssociations: ").append(getElasticInferenceAcceleratorAssociations()).append(",");
if (getNetworkInterfaces() != null)
sb.append("NetworkInterfaces: ").append(getNetworkInterfaces()).append(",");
if (getOutpostArn() != null)
sb.append("OutpostArn: ").append(getOutpostArn()).append(",");
if (getRootDeviceName() != null)
sb.append("RootDeviceName: ").append(getRootDeviceName()).append(",");
if (getRootDeviceType() != null)
sb.append("RootDeviceType: ").append(getRootDeviceType()).append(",");
if (getSecurityGroups() != null)
sb.append("SecurityGroups: ").append(getSecurityGroups()).append(",");
if (getSourceDestCheck() != null)
sb.append("SourceDestCheck: ").append(getSourceDestCheck()).append(",");
if (getSpotInstanceRequestId() != null)
sb.append("SpotInstanceRequestId: ").append(getSpotInstanceRequestId()).append(",");
if (getSriovNetSupport() != null)
sb.append("SriovNetSupport: ").append(getSriovNetSupport()).append(",");
if (getStateReason() != null)
sb.append("StateReason: ").append(getStateReason()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getVirtualizationType() != null)
sb.append("VirtualizationType: ").append(getVirtualizationType()).append(",");
if (getCpuOptions() != null)
sb.append("CpuOptions: ").append(getCpuOptions()).append(",");
if (getCapacityReservationId() != null)
sb.append("CapacityReservationId: ").append(getCapacityReservationId()).append(",");
if (getCapacityReservationSpecification() != null)
sb.append("CapacityReservationSpecification: ").append(getCapacityReservationSpecification()).append(",");
if (getHibernationOptions() != null)
sb.append("HibernationOptions: ").append(getHibernationOptions()).append(",");
if (getLicenses() != null)
sb.append("Licenses: ").append(getLicenses()).append(",");
if (getMetadataOptions() != null)
sb.append("MetadataOptions: ").append(getMetadataOptions()).append(",");
if (getEnclaveOptions() != null)
sb.append("EnclaveOptions: ").append(getEnclaveOptions()).append(",");
if (getBootMode() != null)
sb.append("BootMode: ").append(getBootMode()).append(",");
if (getPlatformDetails() != null)
sb.append("PlatformDetails: ").append(getPlatformDetails()).append(",");
if (getUsageOperation() != null)
sb.append("UsageOperation: ").append(getUsageOperation()).append(",");
if (getUsageOperationUpdateTime() != null)
sb.append("UsageOperationUpdateTime: ").append(getUsageOperationUpdateTime()).append(",");
if (getPrivateDnsNameOptions() != null)
sb.append("PrivateDnsNameOptions: ").append(getPrivateDnsNameOptions()).append(",");
if (getIpv6Address() != null)
sb.append("Ipv6Address: ").append(getIpv6Address()).append(",");
if (getMaintenanceOptions() != null)
sb.append("MaintenanceOptions: ").append(getMaintenanceOptions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Instance == false)
return false;
Instance other = (Instance) obj;
if (other.getAmiLaunchIndex() == null ^ this.getAmiLaunchIndex() == null)
return false;
if (other.getAmiLaunchIndex() != null && other.getAmiLaunchIndex().equals(this.getAmiLaunchIndex()) == 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.getInstanceId() == null ^ this.getInstanceId() == null)
return false;
if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == 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.getKernelId() == null ^ this.getKernelId() == null)
return false;
if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == 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.getLaunchTime() == null ^ this.getLaunchTime() == null)
return false;
if (other.getLaunchTime() != null && other.getLaunchTime().equals(this.getLaunchTime()) == 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.getPlatform() == null ^ this.getPlatform() == null)
return false;
if (other.getPlatform() != null && other.getPlatform().equals(this.getPlatform()) == false)
return false;
if (other.getPrivateDnsName() == null ^ this.getPrivateDnsName() == null)
return false;
if (other.getPrivateDnsName() != null && other.getPrivateDnsName().equals(this.getPrivateDnsName()) == false)
return false;
if (other.getPrivateIpAddress() == null ^ this.getPrivateIpAddress() == null)
return false;
if (other.getPrivateIpAddress() != null && other.getPrivateIpAddress().equals(this.getPrivateIpAddress()) == false)
return false;
if (other.getProductCodes() == null ^ this.getProductCodes() == null)
return false;
if (other.getProductCodes() != null && other.getProductCodes().equals(this.getProductCodes()) == false)
return false;
if (other.getPublicDnsName() == null ^ this.getPublicDnsName() == null)
return false;
if (other.getPublicDnsName() != null && other.getPublicDnsName().equals(this.getPublicDnsName()) == false)
return false;
if (other.getPublicIpAddress() == null ^ this.getPublicIpAddress() == null)
return false;
if (other.getPublicIpAddress() != null && other.getPublicIpAddress().equals(this.getPublicIpAddress()) == 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.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getStateTransitionReason() == null ^ this.getStateTransitionReason() == null)
return false;
if (other.getStateTransitionReason() != null && other.getStateTransitionReason().equals(this.getStateTransitionReason()) == false)
return false;
if (other.getSubnetId() == null ^ this.getSubnetId() == null)
return false;
if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == false)
return false;
if (other.getVpcId() == null ^ this.getVpcId() == null)
return false;
if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false)
return false;
if (other.getArchitecture() == null ^ this.getArchitecture() == null)
return false;
if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == 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.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == 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.getEnaSupport() == null ^ this.getEnaSupport() == null)
return false;
if (other.getEnaSupport() != null && other.getEnaSupport().equals(this.getEnaSupport()) == false)
return false;
if (other.getHypervisor() == null ^ this.getHypervisor() == null)
return false;
if (other.getHypervisor() != null && other.getHypervisor().equals(this.getHypervisor()) == 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.getInstanceLifecycle() == null ^ this.getInstanceLifecycle() == null)
return false;
if (other.getInstanceLifecycle() != null && other.getInstanceLifecycle().equals(this.getInstanceLifecycle()) == false)
return false;
if (other.getElasticGpuAssociations() == null ^ this.getElasticGpuAssociations() == null)
return false;
if (other.getElasticGpuAssociations() != null && other.getElasticGpuAssociations().equals(this.getElasticGpuAssociations()) == false)
return false;
if (other.getElasticInferenceAcceleratorAssociations() == null ^ this.getElasticInferenceAcceleratorAssociations() == null)
return false;
if (other.getElasticInferenceAcceleratorAssociations() != null
&& other.getElasticInferenceAcceleratorAssociations().equals(this.getElasticInferenceAcceleratorAssociations()) == 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.getOutpostArn() == null ^ this.getOutpostArn() == null)
return false;
if (other.getOutpostArn() != null && other.getOutpostArn().equals(this.getOutpostArn()) == false)
return false;
if (other.getRootDeviceName() == null ^ this.getRootDeviceName() == null)
return false;
if (other.getRootDeviceName() != null && other.getRootDeviceName().equals(this.getRootDeviceName()) == false)
return false;
if (other.getRootDeviceType() == null ^ this.getRootDeviceType() == null)
return false;
if (other.getRootDeviceType() != null && other.getRootDeviceType().equals(this.getRootDeviceType()) == 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.getSourceDestCheck() == null ^ this.getSourceDestCheck() == null)
return false;
if (other.getSourceDestCheck() != null && other.getSourceDestCheck().equals(this.getSourceDestCheck()) == false)
return false;
if (other.getSpotInstanceRequestId() == null ^ this.getSpotInstanceRequestId() == null)
return false;
if (other.getSpotInstanceRequestId() != null && other.getSpotInstanceRequestId().equals(this.getSpotInstanceRequestId()) == false)
return false;
if (other.getSriovNetSupport() == null ^ this.getSriovNetSupport() == null)
return false;
if (other.getSriovNetSupport() != null && other.getSriovNetSupport().equals(this.getSriovNetSupport()) == false)
return false;
if (other.getStateReason() == null ^ this.getStateReason() == null)
return false;
if (other.getStateReason() != null && other.getStateReason().equals(this.getStateReason()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getVirtualizationType() == null ^ this.getVirtualizationType() == null)
return false;
if (other.getVirtualizationType() != null && other.getVirtualizationType().equals(this.getVirtualizationType()) == 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.getCapacityReservationId() == null ^ this.getCapacityReservationId() == null)
return false;
if (other.getCapacityReservationId() != null && other.getCapacityReservationId().equals(this.getCapacityReservationId()) == 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.getHibernationOptions() == null ^ this.getHibernationOptions() == null)
return false;
if (other.getHibernationOptions() != null && other.getHibernationOptions().equals(this.getHibernationOptions()) == false)
return false;
if (other.getLicenses() == null ^ this.getLicenses() == null)
return false;
if (other.getLicenses() != null && other.getLicenses().equals(this.getLicenses()) == false)
return false;
if (other.getMetadataOptions() == null ^ this.getMetadataOptions() == null)
return false;
if (other.getMetadataOptions() != null && other.getMetadataOptions().equals(this.getMetadataOptions()) == false)
return false;
if (other.getEnclaveOptions() == null ^ this.getEnclaveOptions() == null)
return false;
if (other.getEnclaveOptions() != null && other.getEnclaveOptions().equals(this.getEnclaveOptions()) == false)
return false;
if (other.getBootMode() == null ^ this.getBootMode() == null)
return false;
if (other.getBootMode() != null && other.getBootMode().equals(this.getBootMode()) == false)
return false;
if (other.getPlatformDetails() == null ^ this.getPlatformDetails() == null)
return false;
if (other.getPlatformDetails() != null && other.getPlatformDetails().equals(this.getPlatformDetails()) == false)
return false;
if (other.getUsageOperation() == null ^ this.getUsageOperation() == null)
return false;
if (other.getUsageOperation() != null && other.getUsageOperation().equals(this.getUsageOperation()) == false)
return false;
if (other.getUsageOperationUpdateTime() == null ^ this.getUsageOperationUpdateTime() == null)
return false;
if (other.getUsageOperationUpdateTime() != null && other.getUsageOperationUpdateTime().equals(this.getUsageOperationUpdateTime()) == false)
return false;
if (other.getPrivateDnsNameOptions() == null ^ this.getPrivateDnsNameOptions() == null)
return false;
if (other.getPrivateDnsNameOptions() != null && other.getPrivateDnsNameOptions().equals(this.getPrivateDnsNameOptions()) == false)
return false;
if (other.getIpv6Address() == null ^ this.getIpv6Address() == null)
return false;
if (other.getIpv6Address() != null && other.getIpv6Address().equals(this.getIpv6Address()) == false)
return false;
if (other.getMaintenanceOptions() == null ^ this.getMaintenanceOptions() == null)
return false;
if (other.getMaintenanceOptions() != null && other.getMaintenanceOptions().equals(this.getMaintenanceOptions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAmiLaunchIndex() == null) ? 0 : getAmiLaunchIndex().hashCode());
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode());
hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode());
hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode());
hashCode = prime * hashCode + ((getLaunchTime() == null) ? 0 : getLaunchTime().hashCode());
hashCode = prime * hashCode + ((getMonitoring() == null) ? 0 : getMonitoring().hashCode());
hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode());
hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode());
hashCode = prime * hashCode + ((getPrivateDnsName() == null) ? 0 : getPrivateDnsName().hashCode());
hashCode = prime * hashCode + ((getPrivateIpAddress() == null) ? 0 : getPrivateIpAddress().hashCode());
hashCode = prime * hashCode + ((getProductCodes() == null) ? 0 : getProductCodes().hashCode());
hashCode = prime * hashCode + ((getPublicDnsName() == null) ? 0 : getPublicDnsName().hashCode());
hashCode = prime * hashCode + ((getPublicIpAddress() == null) ? 0 : getPublicIpAddress().hashCode());
hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getStateTransitionReason() == null) ? 0 : getStateTransitionReason().hashCode());
hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode());
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode());
hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode());
hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode());
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode());
hashCode = prime * hashCode + ((getEnaSupport() == null) ? 0 : getEnaSupport().hashCode());
hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode());
hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode());
hashCode = prime * hashCode + ((getInstanceLifecycle() == null) ? 0 : getInstanceLifecycle().hashCode());
hashCode = prime * hashCode + ((getElasticGpuAssociations() == null) ? 0 : getElasticGpuAssociations().hashCode());
hashCode = prime * hashCode + ((getElasticInferenceAcceleratorAssociations() == null) ? 0 : getElasticInferenceAcceleratorAssociations().hashCode());
hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode());
hashCode = prime * hashCode + ((getOutpostArn() == null) ? 0 : getOutpostArn().hashCode());
hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode());
hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode());
hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode());
hashCode = prime * hashCode + ((getSourceDestCheck() == null) ? 0 : getSourceDestCheck().hashCode());
hashCode = prime * hashCode + ((getSpotInstanceRequestId() == null) ? 0 : getSpotInstanceRequestId().hashCode());
hashCode = prime * hashCode + ((getSriovNetSupport() == null) ? 0 : getSriovNetSupport().hashCode());
hashCode = prime * hashCode + ((getStateReason() == null) ? 0 : getStateReason().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getVirtualizationType() == null) ? 0 : getVirtualizationType().hashCode());
hashCode = prime * hashCode + ((getCpuOptions() == null) ? 0 : getCpuOptions().hashCode());
hashCode = prime * hashCode + ((getCapacityReservationId() == null) ? 0 : getCapacityReservationId().hashCode());
hashCode = prime * hashCode + ((getCapacityReservationSpecification() == null) ? 0 : getCapacityReservationSpecification().hashCode());
hashCode = prime * hashCode + ((getHibernationOptions() == null) ? 0 : getHibernationOptions().hashCode());
hashCode = prime * hashCode + ((getLicenses() == null) ? 0 : getLicenses().hashCode());
hashCode = prime * hashCode + ((getMetadataOptions() == null) ? 0 : getMetadataOptions().hashCode());
hashCode = prime * hashCode + ((getEnclaveOptions() == null) ? 0 : getEnclaveOptions().hashCode());
hashCode = prime * hashCode + ((getBootMode() == null) ? 0 : getBootMode().hashCode());
hashCode = prime * hashCode + ((getPlatformDetails() == null) ? 0 : getPlatformDetails().hashCode());
hashCode = prime * hashCode + ((getUsageOperation() == null) ? 0 : getUsageOperation().hashCode());
hashCode = prime * hashCode + ((getUsageOperationUpdateTime() == null) ? 0 : getUsageOperationUpdateTime().hashCode());
hashCode = prime * hashCode + ((getPrivateDnsNameOptions() == null) ? 0 : getPrivateDnsNameOptions().hashCode());
hashCode = prime * hashCode + ((getIpv6Address() == null) ? 0 : getIpv6Address().hashCode());
hashCode = prime * hashCode + ((getMaintenanceOptions() == null) ? 0 : getMaintenanceOptions().hashCode());
return hashCode;
}
@Override
public Instance clone() {
try {
return (Instance) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}