Class Instance
- java.lang.Object
-
- software.amazon.awssdk.services.ec2.model.Instance
-
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<Instance.Builder,Instance>
@Generated("software.amazon.awssdk:codegen") public final class Instance extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Instance.Builder,Instance>
Describes an instance.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceInstance.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegeramiLaunchIndex()The AMI launch index, which can be used to find this instance in the launch group.ArchitectureValuesarchitecture()The architecture of the image.StringarchitectureAsString()The architecture of the image.List<InstanceBlockDeviceMapping>blockDeviceMappings()Any block device mapping entries for the instance.BootModeValuesbootMode()The boot mode that was specified by the AMI.StringbootModeAsString()The boot mode that was specified by the AMI.static Instance.Builderbuilder()StringcapacityBlockId()The ID of the Capacity Block.StringcapacityReservationId()The ID of the Capacity Reservation.CapacityReservationSpecificationResponsecapacityReservationSpecification()Information about the Capacity Reservation targeting option.StringclientToken()The idempotency token you provided when you launched the instance, if applicable.CpuOptionscpuOptions()The CPU options for the instance.InstanceBootModeValuescurrentInstanceBootMode()The boot mode that is used to boot the instance at launch or start.StringcurrentInstanceBootModeAsString()The boot mode that is used to boot the instance at launch or start.BooleanebsOptimized()Indicates whether the instance is optimized for Amazon EBS I/O.List<ElasticGpuAssociation>elasticGpuAssociations()Deprecated.List<ElasticInferenceAcceleratorAssociation>elasticInferenceAcceleratorAssociations()DeprecatedBooleanenaSupport()Specifies whether enhanced networking with ENA is enabled.EnclaveOptionsenclaveOptions()Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.booleanequals(Object obj)booleanequalsBySdkFields(Object obj)<T> Optional<T>getValueForField(String fieldName, Class<T> clazz)booleanhasBlockDeviceMappings()For responses, this returns true if the service returned a value for the BlockDeviceMappings property.booleanhasElasticGpuAssociations()For responses, this returns true if the service returned a value for the ElasticGpuAssociations property.booleanhasElasticInferenceAcceleratorAssociations()For responses, this returns true if the service returned a value for the ElasticInferenceAcceleratorAssociations property.inthashCode()booleanhasLicenses()For responses, this returns true if the service returned a value for the Licenses property.booleanhasNetworkInterfaces()For responses, this returns true if the service returned a value for the NetworkInterfaces property.booleanhasProductCodes()For responses, this returns true if the service returned a value for the ProductCodes property.booleanhasSecurityGroups()For responses, this returns true if the service returned a value for the SecurityGroups property.booleanhasTags()For responses, this returns true if the service returned a value for the Tags property.HibernationOptionshibernationOptions()Indicates whether the instance is enabled for hibernation.HypervisorTypehypervisor()The hypervisor type of the instance.StringhypervisorAsString()The hypervisor type of the instance.IamInstanceProfileiamInstanceProfile()The IAM instance profile associated with the instance, if applicable.StringimageId()The ID of the AMI used to launch the instance.StringinstanceId()The ID of the instance.InstanceLifecycleTypeinstanceLifecycle()Indicates whether this is a Spot Instance or a Scheduled Instance.StringinstanceLifecycleAsString()Indicates whether this is a Spot Instance or a Scheduled Instance.InstanceTypeinstanceType()The instance type.StringinstanceTypeAsString()The instance type.Stringipv6Address()The IPv6 address assigned to the instance.StringkernelId()The kernel associated with this instance, if applicable.StringkeyName()The name of the key pair, if this instance was launched with an associated key pair.InstantlaunchTime()The time that the instance was last launched.List<LicenseConfiguration>licenses()The license configurations for the instance.InstanceMaintenanceOptionsmaintenanceOptions()Provides information on the recovery and maintenance options of your instance.InstanceMetadataOptionsResponsemetadataOptions()The metadata options for the instance.Monitoringmonitoring()The monitoring for the instance.List<InstanceNetworkInterface>networkInterfaces()The network interfaces for the instance.InstanceNetworkPerformanceOptionsnetworkPerformanceOptions()Contains settings for the network performance options for your instance.OperatorResponseoperator()The service provider that manages the instance.StringoutpostArn()The Amazon Resource Name (ARN) of the Outpost.Placementplacement()The location where the instance launched, if applicable.PlatformValuesplatform()The platform.StringplatformAsString()The platform.StringplatformDetails()The platform details value for the instance.StringprivateDnsName()[IPv4 only] The private DNS hostname name assigned to the instance.PrivateDnsNameOptionsResponseprivateDnsNameOptions()The options for the instance hostname.StringprivateIpAddress()The private IPv4 address assigned to the instance.List<ProductCode>productCodes()The product codes attached to this instance, if applicable.StringpublicDnsName()The public DNS name assigned to the instance.StringpublicIpAddress()The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.StringramdiskId()The RAM disk associated with this instance, if applicable.StringrootDeviceName()The device name of the root device volume (for example,/dev/sda1).DeviceTyperootDeviceType()The root device type used by the AMI.StringrootDeviceTypeAsString()The root device type used by the AMI.Map<String,SdkField<?>>sdkFieldNameToField()List<SdkField<?>>sdkFields()List<GroupIdentifier>securityGroups()The security groups for the instance.static Class<? extends Instance.Builder>serializableBuilderClass()BooleansourceDestCheck()Indicates whether source/destination checking is enabled.StringspotInstanceRequestId()If the request is a Spot Instance request, the ID of the request.StringsriovNetSupport()Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.InstanceStatestate()The current state of the instance.StateReasonstateReason()The reason for the most recent state transition.StringstateTransitionReason()The reason for the most recent state transition.StringsubnetId()The ID of the subnet in which the instance is running.List<Tag>tags()Any tags assigned to the instance.Instance.BuildertoBuilder()StringtoString()Returns a string representation of this object.StringtpmSupport()If the instance is configured for NitroTPM support, the value isv2.0.StringusageOperation()The usage operation value for the instance.InstantusageOperationUpdateTime()The time that the usage operation was last updated.VirtualizationTypevirtualizationType()The virtualization type of the instance.StringvirtualizationTypeAsString()The virtualization type of the instance.StringvpcId()The ID of the VPC in which the instance is running.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
architecture
public final ArchitectureValues architecture()
The architecture of the image.
If the service returns an enum value that is not available in the current SDK version,
architecturewill returnArchitectureValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromarchitectureAsString().- Returns:
- The architecture of the image.
- See Also:
ArchitectureValues
-
architectureAsString
public final String architectureAsString()
The architecture of the image.
If the service returns an enum value that is not available in the current SDK version,
architecturewill returnArchitectureValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromarchitectureAsString().- Returns:
- The architecture of the image.
- See Also:
ArchitectureValues
-
hasBlockDeviceMappings
public final boolean hasBlockDeviceMappings()
For responses, this returns true if the service returned a value for the BlockDeviceMappings property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
blockDeviceMappings
public final List<InstanceBlockDeviceMapping> blockDeviceMappings()
Any block device mapping entries for the instance.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasBlockDeviceMappings()method.- Returns:
- Any block device mapping entries for the instance.
-
clientToken
public final String clientToken()
The idempotency token you provided when you launched the instance, if applicable.
- Returns:
- The idempotency token you provided when you launched the instance, if applicable.
-
ebsOptimized
public final Boolean ebsOptimized()
Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
- Returns:
- 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.
-
enaSupport
public final Boolean enaSupport()
Specifies whether enhanced networking with ENA is enabled.
- Returns:
- Specifies whether enhanced networking with ENA is enabled.
-
hypervisor
public final HypervisorType hypervisor()
The hypervisor type of the instance. The value
xenis used for both Xen and Nitro hypervisors.If the service returns an enum value that is not available in the current SDK version,
hypervisorwill returnHypervisorType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromhypervisorAsString().- Returns:
- The hypervisor type of the instance. The value
xenis used for both Xen and Nitro hypervisors. - See Also:
HypervisorType
-
hypervisorAsString
public final String hypervisorAsString()
The hypervisor type of the instance. The value
xenis used for both Xen and Nitro hypervisors.If the service returns an enum value that is not available in the current SDK version,
hypervisorwill returnHypervisorType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromhypervisorAsString().- Returns:
- The hypervisor type of the instance. The value
xenis used for both Xen and Nitro hypervisors. - See Also:
HypervisorType
-
iamInstanceProfile
public final IamInstanceProfile iamInstanceProfile()
The IAM instance profile associated with the instance, if applicable.
- Returns:
- The IAM instance profile associated with the instance, if applicable.
-
instanceLifecycle
public final InstanceLifecycleType instanceLifecycle()
Indicates whether this is a Spot Instance or a Scheduled Instance.
If the service returns an enum value that is not available in the current SDK version,
instanceLifecyclewill returnInstanceLifecycleType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frominstanceLifecycleAsString().- Returns:
- Indicates whether this is a Spot Instance or a Scheduled Instance.
- See Also:
InstanceLifecycleType
-
instanceLifecycleAsString
public final String instanceLifecycleAsString()
Indicates whether this is a Spot Instance or a Scheduled Instance.
If the service returns an enum value that is not available in the current SDK version,
instanceLifecyclewill returnInstanceLifecycleType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frominstanceLifecycleAsString().- Returns:
- Indicates whether this is a Spot Instance or a Scheduled Instance.
- See Also:
InstanceLifecycleType
-
hasElasticGpuAssociations
public final boolean hasElasticGpuAssociations()
For responses, this returns true if the service returned a value for the ElasticGpuAssociations property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
elasticGpuAssociations
public final List<ElasticGpuAssociation> elasticGpuAssociations()
Deprecated.
Amazon Elastic Graphics reached end of life on January 8, 2024.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasElasticGpuAssociations()method.- Returns:
- Deprecated.
Amazon Elastic Graphics reached end of life on January 8, 2024.
-
hasElasticInferenceAcceleratorAssociations
public final boolean hasElasticInferenceAcceleratorAssociations()
For responses, this returns true if the service returned a value for the ElasticInferenceAcceleratorAssociations property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
elasticInferenceAcceleratorAssociations
public final List<ElasticInferenceAcceleratorAssociation> elasticInferenceAcceleratorAssociations()
Deprecated
Amazon Elastic Inference is no longer available.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasElasticInferenceAcceleratorAssociations()method.- Returns:
- Deprecated
Amazon Elastic Inference is no longer available.
-
hasNetworkInterfaces
public final boolean hasNetworkInterfaces()
For responses, this returns true if the service returned a value for the NetworkInterfaces property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
networkInterfaces
public final List<InstanceNetworkInterface> networkInterfaces()
The network interfaces for the instance.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasNetworkInterfaces()method.- Returns:
- The network interfaces for the instance.
-
outpostArn
public final String outpostArn()
The Amazon Resource Name (ARN) of the Outpost.
- Returns:
- The Amazon Resource Name (ARN) of the Outpost.
-
rootDeviceName
public final String rootDeviceName()
The device name of the root device volume (for example,
/dev/sda1).- Returns:
- The device name of the root device volume (for example,
/dev/sda1).
-
rootDeviceType
public final DeviceType rootDeviceType()
The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
If the service returns an enum value that is not available in the current SDK version,
rootDeviceTypewill returnDeviceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromrootDeviceTypeAsString().- Returns:
- The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
- See Also:
DeviceType
-
rootDeviceTypeAsString
public final String rootDeviceTypeAsString()
The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
If the service returns an enum value that is not available in the current SDK version,
rootDeviceTypewill returnDeviceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromrootDeviceTypeAsString().- Returns:
- The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.
- See Also:
DeviceType
-
hasSecurityGroups
public final boolean hasSecurityGroups()
For responses, this returns true if the service returned a value for the SecurityGroups property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
securityGroups
public final List<GroupIdentifier> securityGroups()
The security groups for the instance.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasSecurityGroups()method.- Returns:
- The security groups for the instance.
-
sourceDestCheck
public final Boolean sourceDestCheck()
Indicates whether source/destination checking is enabled.
- Returns:
- Indicates whether source/destination checking is enabled.
-
spotInstanceRequestId
public final String spotInstanceRequestId()
If the request is a Spot Instance request, the ID of the request.
- Returns:
- If the request is a Spot Instance request, the ID of the request.
-
sriovNetSupport
public final String sriovNetSupport()
Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
- Returns:
- Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
-
stateReason
public final StateReason stateReason()
The reason for the most recent state transition.
- Returns:
- The reason for the most recent state transition.
-
hasTags
public final boolean hasTags()
For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
tags
public final List<Tag> tags()
Any tags assigned to the instance.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTags()method.- Returns:
- Any tags assigned to the instance.
-
virtualizationType
public final VirtualizationType virtualizationType()
The virtualization type of the instance.
If the service returns an enum value that is not available in the current SDK version,
virtualizationTypewill returnVirtualizationType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromvirtualizationTypeAsString().- Returns:
- The virtualization type of the instance.
- See Also:
VirtualizationType
-
virtualizationTypeAsString
public final String virtualizationTypeAsString()
The virtualization type of the instance.
If the service returns an enum value that is not available in the current SDK version,
virtualizationTypewill returnVirtualizationType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromvirtualizationTypeAsString().- Returns:
- The virtualization type of the instance.
- See Also:
VirtualizationType
-
cpuOptions
public final CpuOptions cpuOptions()
The CPU options for the instance.
- Returns:
- The CPU options for the instance.
-
capacityBlockId
public final String capacityBlockId()
The ID of the Capacity Block.
For P5 instances, a Capacity Block ID refers to a group of instances. For Trn2u instances, a capacity block ID refers to an EC2 UltraServer.
- Returns:
- The ID of the Capacity Block.
For P5 instances, a Capacity Block ID refers to a group of instances. For Trn2u instances, a capacity block ID refers to an EC2 UltraServer.
-
capacityReservationId
public final String capacityReservationId()
The ID of the Capacity Reservation.
- Returns:
- The ID of the Capacity Reservation.
-
capacityReservationSpecification
public final CapacityReservationSpecificationResponse capacityReservationSpecification()
Information about the Capacity Reservation targeting option.
- Returns:
- Information about the Capacity Reservation targeting option.
-
hibernationOptions
public final HibernationOptions hibernationOptions()
Indicates whether the instance is enabled for hibernation.
- Returns:
- Indicates whether the instance is enabled for hibernation.
-
hasLicenses
public final boolean hasLicenses()
For responses, this returns true if the service returned a value for the Licenses property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
licenses
public final List<LicenseConfiguration> licenses()
The license configurations for the instance.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasLicenses()method.- Returns:
- The license configurations for the instance.
-
metadataOptions
public final InstanceMetadataOptionsResponse metadataOptions()
The metadata options for the instance.
- Returns:
- The metadata options for the instance.
-
enclaveOptions
public final EnclaveOptions enclaveOptions()
Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
- Returns:
- Indicates whether the instance is enabled for Amazon Web Services Nitro Enclaves.
-
bootMode
public final BootModeValues bootMode()
The boot mode that was specified by the AMI. If the value is
uefi-preferred, the AMI supports both UEFI and Legacy BIOS. ThecurrentInstanceBootModeparameter is the boot mode that is used to boot the instance at launch or start.The operating system contained in the AMI must be configured to support the specified boot mode.
For more information, see Boot modes in the Amazon EC2 User Guide.
If the service returns an enum value that is not available in the current SDK version,
bootModewill returnBootModeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frombootModeAsString().- Returns:
- The boot mode that was specified by the AMI. If the value is
uefi-preferred, the AMI supports both UEFI and Legacy BIOS. ThecurrentInstanceBootModeparameter is the boot mode that is used to boot the instance at launch or start.The operating system contained in the AMI must be configured to support the specified boot mode.
For more information, see Boot modes in the Amazon EC2 User Guide.
- See Also:
BootModeValues
-
bootModeAsString
public final String bootModeAsString()
The boot mode that was specified by the AMI. If the value is
uefi-preferred, the AMI supports both UEFI and Legacy BIOS. ThecurrentInstanceBootModeparameter is the boot mode that is used to boot the instance at launch or start.The operating system contained in the AMI must be configured to support the specified boot mode.
For more information, see Boot modes in the Amazon EC2 User Guide.
If the service returns an enum value that is not available in the current SDK version,
bootModewill returnBootModeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frombootModeAsString().- Returns:
- The boot mode that was specified by the AMI. If the value is
uefi-preferred, the AMI supports both UEFI and Legacy BIOS. ThecurrentInstanceBootModeparameter is the boot mode that is used to boot the instance at launch or start.The operating system contained in the AMI must be configured to support the specified boot mode.
For more information, see Boot modes in the Amazon EC2 User Guide.
- See Also:
BootModeValues
-
platformDetails
public final String platformDetails()
The platform details value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.
- Returns:
- The platform details value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.
-
usageOperation
public final String usageOperation()
The usage operation value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.
- Returns:
- The usage operation value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.
-
usageOperationUpdateTime
public final Instant usageOperationUpdateTime()
The time that the usage operation was last updated.
- Returns:
- The time that the usage operation was last updated.
-
privateDnsNameOptions
public final PrivateDnsNameOptionsResponse privateDnsNameOptions()
The options for the instance hostname.
- Returns:
- The options for the instance hostname.
-
ipv6Address
public final String ipv6Address()
The IPv6 address assigned to the instance.
- Returns:
- The IPv6 address assigned to the instance.
-
tpmSupport
public final String tpmSupport()
If the instance is configured for NitroTPM support, the value is
v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.- Returns:
- If the instance is configured for NitroTPM support, the value is
v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.
-
maintenanceOptions
public final InstanceMaintenanceOptions maintenanceOptions()
Provides information on the recovery and maintenance options of your instance.
- Returns:
- Provides information on the recovery and maintenance options of your instance.
-
currentInstanceBootMode
public final InstanceBootModeValues currentInstanceBootMode()
The boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.
If the service returns an enum value that is not available in the current SDK version,
currentInstanceBootModewill returnInstanceBootModeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcurrentInstanceBootModeAsString().- Returns:
- The boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.
- See Also:
InstanceBootModeValues
-
currentInstanceBootModeAsString
public final String currentInstanceBootModeAsString()
The boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.
If the service returns an enum value that is not available in the current SDK version,
currentInstanceBootModewill returnInstanceBootModeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromcurrentInstanceBootModeAsString().- Returns:
- The boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.
- See Also:
InstanceBootModeValues
-
networkPerformanceOptions
public final InstanceNetworkPerformanceOptions networkPerformanceOptions()
Contains settings for the network performance options for your instance.
- Returns:
- Contains settings for the network performance options for your instance.
-
operator
public final OperatorResponse operator()
The service provider that manages the instance.
- Returns:
- The service provider that manages the instance.
-
instanceId
public final String instanceId()
The ID of the instance.
- Returns:
- The ID of the instance.
-
imageId
public final String imageId()
The ID of the AMI used to launch the instance.
- Returns:
- The ID of the AMI used to launch the instance.
-
state
public final InstanceState state()
The current state of the instance.
- Returns:
- The current state of the instance.
-
privateDnsName
public final String 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
runningstate.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.
- Returns:
- [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
runningstate.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.
-
publicDnsName
public final String publicDnsName()
The public DNS name assigned to the instance. This name is not available until the instance enters the
runningstate. This name is only available if you've enabled DNS hostnames for your VPC. The format of this name depends on the public hostname type.- Returns:
- The public DNS name assigned to the instance. This name is not available until the instance enters the
runningstate. This name is only available if you've enabled DNS hostnames for your VPC. The format of this name depends on the public hostname type.
-
stateTransitionReason
public final String stateTransitionReason()
The reason for the most recent state transition. This might be an empty string.
- Returns:
- The reason for the most recent state transition. This might be an empty string.
-
keyName
public final String keyName()
The name of the key pair, if this instance was launched with an associated key pair.
- Returns:
- The name of the key pair, if this instance was launched with an associated key pair.
-
amiLaunchIndex
public final Integer amiLaunchIndex()
The AMI launch index, which can be used to find this instance in the launch group.
- Returns:
- The AMI launch index, which can be used to find this instance in the launch group.
-
hasProductCodes
public final boolean hasProductCodes()
For responses, this returns true if the service returned a value for the ProductCodes property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
productCodes
public final List<ProductCode> productCodes()
The product codes attached to this instance, if applicable.
Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasProductCodes()method.- Returns:
- The product codes attached to this instance, if applicable.
-
instanceType
public final InstanceType instanceType()
The instance type.
If the service returns an enum value that is not available in the current SDK version,
instanceTypewill returnInstanceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frominstanceTypeAsString().- Returns:
- The instance type.
- See Also:
InstanceType
-
instanceTypeAsString
public final String instanceTypeAsString()
The instance type.
If the service returns an enum value that is not available in the current SDK version,
instanceTypewill returnInstanceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available frominstanceTypeAsString().- Returns:
- The instance type.
- See Also:
InstanceType
-
launchTime
public final Instant launchTime()
The time that the instance was last launched. To determine the time that instance was first launched, see the attachment time for the primary network interface.
- Returns:
- The time that the instance was last launched. To determine the time that instance was first launched, see the attachment time for the primary network interface.
-
placement
public final Placement placement()
The location where the instance launched, if applicable.
- Returns:
- The location where the instance launched, if applicable.
-
kernelId
public final String kernelId()
The kernel associated with this instance, if applicable.
- Returns:
- The kernel associated with this instance, if applicable.
-
ramdiskId
public final String ramdiskId()
The RAM disk associated with this instance, if applicable.
- Returns:
- The RAM disk associated with this instance, if applicable.
-
platform
public final PlatformValues platform()
The platform. This value is
windowsfor Windows instances; otherwise, it is empty.If the service returns an enum value that is not available in the current SDK version,
platformwill returnPlatformValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromplatformAsString().- Returns:
- The platform. This value is
windowsfor Windows instances; otherwise, it is empty. - See Also:
PlatformValues
-
platformAsString
public final String platformAsString()
The platform. This value is
windowsfor Windows instances; otherwise, it is empty.If the service returns an enum value that is not available in the current SDK version,
platformwill returnPlatformValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available fromplatformAsString().- Returns:
- The platform. This value is
windowsfor Windows instances; otherwise, it is empty. - See Also:
PlatformValues
-
monitoring
public final Monitoring monitoring()
The monitoring for the instance.
- Returns:
- The monitoring for the instance.
-
subnetId
public final String subnetId()
The ID of the subnet in which the instance is running.
- Returns:
- The ID of the subnet in which the instance is running.
-
vpcId
public final String vpcId()
The ID of the VPC in which the instance is running.
- Returns:
- The ID of the VPC in which the instance is running.
-
privateIpAddress
public final String privateIpAddress()
The private IPv4 address assigned to the instance.
- Returns:
- The private IPv4 address assigned to the instance.
-
publicIpAddress
public final String 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.
- Returns:
- 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.
-
toBuilder
public Instance.Builder toBuilder()
- Specified by:
toBuilderin interfaceToCopyableBuilder<Instance.Builder,Instance>
-
builder
public static Instance.Builder builder()
-
serializableBuilderClass
public static Class<? extends Instance.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
public final String toString()
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.
-
sdkFieldNameToField
public final Map<String,SdkField<?>> sdkFieldNameToField()
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-
-