Class InstanceRequirementsRequest
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<InstanceRequirementsRequest.Builder,
InstanceRequirementsRequest>
The instance requirements for attribute-based instance type selection. Instead of specifying exact instance types, you define requirements such as vCPU count, memory size, network performance, and accelerator specifications. Amazon ECS automatically selects Amazon EC2 instance types that match these requirements, providing flexibility and helping to mitigate capacity constraints.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal AcceleratorCountRequest
The minimum and maximum number of accelerators for the instance types.final List
<AcceleratorManufacturer> The accelerator manufacturers to include.The accelerator manufacturers to include.final List
<AcceleratorName> The specific accelerator names to include.The specific accelerator names to include.The minimum and maximum total accelerator memory in mebibytes (MiB).final List
<AcceleratorType> The accelerator types to include.The accelerator types to include.The instance types to include in the selection.final BareMetal
Indicates whether to include bare metal instance types.final String
Indicates whether to include bare metal instance types.The minimum and maximum baseline Amazon EBS bandwidth in megabits per second (Mbps).builder()
final BurstablePerformance
Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g).final String
Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g).final List
<CpuManufacturer> The CPU manufacturers to include or exclude.The CPU manufacturers to include or exclude.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.The instance types to exclude from selection.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final boolean
For responses, this returns true if the service returned a value for the AcceleratorManufacturers property.final boolean
For responses, this returns true if the service returned a value for the AcceleratorNames property.final boolean
For responses, this returns true if the service returned a value for the AcceleratorTypes property.final boolean
For responses, this returns true if the service returned a value for the AllowedInstanceTypes property.final boolean
For responses, this returns true if the service returned a value for the CpuManufacturers property.final boolean
For responses, this returns true if the service returned a value for the ExcludedInstanceTypes property.final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the InstanceGenerations property.final boolean
For responses, this returns true if the service returned a value for the LocalStorageTypes property.final List
<InstanceGeneration> The instance generations to include.The instance generations to include.final LocalStorage
Indicates whether to include instance types with local storage.final String
Indicates whether to include instance types with local storage.final List
<LocalStorageType> The local storage types to include.The local storage types to include.final Integer
The maximum price for Spot instances as a percentage of the optimal On-Demand price.final MemoryGiBPerVCpuRequest
The minimum and maximum amount of memory per vCPU in gibibytes (GiB).final MemoryMiBRequest
The minimum and maximum amount of memory in mebibytes (MiB) for the instance types.The minimum and maximum network bandwidth in gigabits per second (Gbps).The minimum and maximum number of network interfaces for the instance types.final Integer
The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price.final Boolean
Indicates whether the instance types must support hibernation.static Class
<? extends InstanceRequirementsRequest.Builder> final Integer
The maximum price for Spot instances as a percentage over the lowest priced On-Demand instance.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.The minimum and maximum total local storage in gigabytes (GB) for instance types with local storage.final VCpuCountRangeRequest
The minimum and maximum number of vCPUs for the instance types.Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
vCpuCount
The minimum and maximum number of vCPUs for the instance types. Amazon ECS selects instance types that have vCPU counts within this range.
- Returns:
- The minimum and maximum number of vCPUs for the instance types. Amazon ECS selects instance types that have vCPU counts within this range.
-
memoryMiB
The minimum and maximum amount of memory in mebibytes (MiB) for the instance types. Amazon ECS selects instance types that have memory within this range.
- Returns:
- The minimum and maximum amount of memory in mebibytes (MiB) for the instance types. Amazon ECS selects instance types that have memory within this range.
-
cpuManufacturers
The CPU manufacturers to include or exclude. You can specify
intel
,amd
, oramazon-web-services
to control which CPU types are used for your workloads.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
hasCpuManufacturers()
method.- Returns:
- The CPU manufacturers to include or exclude. You can specify
intel
,amd
, oramazon-web-services
to control which CPU types are used for your workloads.
-
hasCpuManufacturers
public final boolean hasCpuManufacturers()For responses, this returns true if the service returned a value for the CpuManufacturers 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. -
cpuManufacturersAsStrings
The CPU manufacturers to include or exclude. You can specify
intel
,amd
, oramazon-web-services
to control which CPU types are used for your workloads.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
hasCpuManufacturers()
method.- Returns:
- The CPU manufacturers to include or exclude. You can specify
intel
,amd
, oramazon-web-services
to control which CPU types are used for your workloads.
-
memoryGiBPerVCpu
The minimum and maximum amount of memory per vCPU in gibibytes (GiB). This helps ensure that instance types have the appropriate memory-to-CPU ratio for your workloads.
- Returns:
- The minimum and maximum amount of memory per vCPU in gibibytes (GiB). This helps ensure that instance types have the appropriate memory-to-CPU ratio for your workloads.
-
hasExcludedInstanceTypes
public final boolean hasExcludedInstanceTypes()For responses, this returns true if the service returned a value for the ExcludedInstanceTypes 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. -
excludedInstanceTypes
The instance types to exclude from selection. Use this to prevent Amazon ECS from selecting specific instance types that may not be suitable for your workloads.
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
hasExcludedInstanceTypes()
method.- Returns:
- The instance types to exclude from selection. Use this to prevent Amazon ECS from selecting specific instance types that may not be suitable for your workloads.
-
instanceGenerations
The instance generations to include. You can specify
current
to use the latest generation instances, orprevious
to include previous generation instances for cost optimization.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
hasInstanceGenerations()
method.- Returns:
- The instance generations to include. You can specify
current
to use the latest generation instances, orprevious
to include previous generation instances for cost optimization.
-
hasInstanceGenerations
public final boolean hasInstanceGenerations()For responses, this returns true if the service returned a value for the InstanceGenerations 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. -
instanceGenerationsAsStrings
The instance generations to include. You can specify
current
to use the latest generation instances, orprevious
to include previous generation instances for cost optimization.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
hasInstanceGenerations()
method.- Returns:
- The instance generations to include. You can specify
current
to use the latest generation instances, orprevious
to include previous generation instances for cost optimization.
-
spotMaxPricePercentageOverLowestPrice
The maximum price for Spot instances as a percentage over the lowest priced On-Demand instance. This helps control Spot instance costs while maintaining access to capacity.
- Returns:
- The maximum price for Spot instances as a percentage over the lowest priced On-Demand instance. This helps control Spot instance costs while maintaining access to capacity.
-
onDemandMaxPricePercentageOverLowestPrice
The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon ECS selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.
- Returns:
- The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price. The identified On-Demand price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon ECS selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.
-
bareMetal
Indicates whether to include bare metal instance types. Set to
included
to allow bare metal instances,excluded
to exclude them, orrequired
to use only bare metal instances.If the service returns an enum value that is not available in the current SDK version,
bareMetal
will returnBareMetal.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frombareMetalAsString()
.- Returns:
- Indicates whether to include bare metal instance types. Set to
included
to allow bare metal instances,excluded
to exclude them, orrequired
to use only bare metal instances. - See Also:
-
bareMetalAsString
Indicates whether to include bare metal instance types. Set to
included
to allow bare metal instances,excluded
to exclude them, orrequired
to use only bare metal instances.If the service returns an enum value that is not available in the current SDK version,
bareMetal
will returnBareMetal.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frombareMetalAsString()
.- Returns:
- Indicates whether to include bare metal instance types. Set to
included
to allow bare metal instances,excluded
to exclude them, orrequired
to use only bare metal instances. - See Also:
-
burstablePerformance
Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to
included
to allow burstable instances,excluded
to exclude them, orrequired
to use only burstable instances.If the service returns an enum value that is not available in the current SDK version,
burstablePerformance
will returnBurstablePerformance.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromburstablePerformanceAsString()
.- Returns:
- Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to
included
to allow burstable instances,excluded
to exclude them, orrequired
to use only burstable instances. - See Also:
-
burstablePerformanceAsString
Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to
included
to allow burstable instances,excluded
to exclude them, orrequired
to use only burstable instances.If the service returns an enum value that is not available in the current SDK version,
burstablePerformance
will returnBurstablePerformance.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromburstablePerformanceAsString()
.- Returns:
- Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to
included
to allow burstable instances,excluded
to exclude them, orrequired
to use only burstable instances. - See Also:
-
requireHibernateSupport
Indicates whether the instance types must support hibernation. When set to
true
, only instance types that support hibernation are selected.- Returns:
- Indicates whether the instance types must support hibernation. When set to
true
, only instance types that support hibernation are selected.
-
networkInterfaceCount
The minimum and maximum number of network interfaces for the instance types. This is useful for workloads that require multiple network interfaces.
- Returns:
- The minimum and maximum number of network interfaces for the instance types. This is useful for workloads that require multiple network interfaces.
-
localStorage
Indicates whether to include instance types with local storage. Set to
included
to allow local storage,excluded
to exclude it, orrequired
to use only instances with local storage.If the service returns an enum value that is not available in the current SDK version,
localStorage
will returnLocalStorage.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromlocalStorageAsString()
.- Returns:
- Indicates whether to include instance types with local storage. Set to
included
to allow local storage,excluded
to exclude it, orrequired
to use only instances with local storage. - See Also:
-
localStorageAsString
Indicates whether to include instance types with local storage. Set to
included
to allow local storage,excluded
to exclude it, orrequired
to use only instances with local storage.If the service returns an enum value that is not available in the current SDK version,
localStorage
will returnLocalStorage.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromlocalStorageAsString()
.- Returns:
- Indicates whether to include instance types with local storage. Set to
included
to allow local storage,excluded
to exclude it, orrequired
to use only instances with local storage. - See Also:
-
localStorageTypes
The local storage types to include. You can specify
hdd
for hard disk drives,ssd
for solid state drives, or both.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
hasLocalStorageTypes()
method.- Returns:
- The local storage types to include. You can specify
hdd
for hard disk drives,ssd
for solid state drives, or both.
-
hasLocalStorageTypes
public final boolean hasLocalStorageTypes()For responses, this returns true if the service returned a value for the LocalStorageTypes 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. -
localStorageTypesAsStrings
The local storage types to include. You can specify
hdd
for hard disk drives,ssd
for solid state drives, or both.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
hasLocalStorageTypes()
method.- Returns:
- The local storage types to include. You can specify
hdd
for hard disk drives,ssd
for solid state drives, or both.
-
totalLocalStorageGB
The minimum and maximum total local storage in gigabytes (GB) for instance types with local storage.
- Returns:
- The minimum and maximum total local storage in gigabytes (GB) for instance types with local storage.
-
baselineEbsBandwidthMbps
The minimum and maximum baseline Amazon EBS bandwidth in megabits per second (Mbps). This is important for workloads with high storage I/O requirements.
- Returns:
- The minimum and maximum baseline Amazon EBS bandwidth in megabits per second (Mbps). This is important for workloads with high storage I/O requirements.
-
acceleratorTypes
The accelerator types to include. You can specify
gpu
for graphics processing units,fpga
for field programmable gate arrays, orinference
for machine learning inference accelerators.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
hasAcceleratorTypes()
method.- Returns:
- The accelerator types to include. You can specify
gpu
for graphics processing units,fpga
for field programmable gate arrays, orinference
for machine learning inference accelerators.
-
hasAcceleratorTypes
public final boolean hasAcceleratorTypes()For responses, this returns true if the service returned a value for the AcceleratorTypes 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. -
acceleratorTypesAsStrings
The accelerator types to include. You can specify
gpu
for graphics processing units,fpga
for field programmable gate arrays, orinference
for machine learning inference accelerators.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
hasAcceleratorTypes()
method.- Returns:
- The accelerator types to include. You can specify
gpu
for graphics processing units,fpga
for field programmable gate arrays, orinference
for machine learning inference accelerators.
-
acceleratorCount
The minimum and maximum number of accelerators for the instance types. This is used when you need instances with specific numbers of GPUs or other accelerators.
- Returns:
- The minimum and maximum number of accelerators for the instance types. This is used when you need instances with specific numbers of GPUs or other accelerators.
-
acceleratorManufacturers
The accelerator manufacturers to include. You can specify
nvidia
,amd
,amazon-web-services
, orxilinx
depending on your accelerator requirements.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
hasAcceleratorManufacturers()
method.- Returns:
- The accelerator manufacturers to include. You can specify
nvidia
,amd
,amazon-web-services
, orxilinx
depending on your accelerator requirements.
-
hasAcceleratorManufacturers
public final boolean hasAcceleratorManufacturers()For responses, this returns true if the service returned a value for the AcceleratorManufacturers 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. -
acceleratorManufacturersAsStrings
The accelerator manufacturers to include. You can specify
nvidia
,amd
,amazon-web-services
, orxilinx
depending on your accelerator requirements.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
hasAcceleratorManufacturers()
method.- Returns:
- The accelerator manufacturers to include. You can specify
nvidia
,amd
,amazon-web-services
, orxilinx
depending on your accelerator requirements.
-
acceleratorNames
The specific accelerator names to include. For example, you can specify
a100
,v100
,k80
, or other specific accelerator models.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
hasAcceleratorNames()
method.- Returns:
- The specific accelerator names to include. For example, you can specify
a100
,v100
,k80
, or other specific accelerator models.
-
hasAcceleratorNames
public final boolean hasAcceleratorNames()For responses, this returns true if the service returned a value for the AcceleratorNames 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. -
acceleratorNamesAsStrings
The specific accelerator names to include. For example, you can specify
a100
,v100
,k80
, or other specific accelerator models.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
hasAcceleratorNames()
method.- Returns:
- The specific accelerator names to include. For example, you can specify
a100
,v100
,k80
, or other specific accelerator models.
-
acceleratorTotalMemoryMiB
The minimum and maximum total accelerator memory in mebibytes (MiB). This is important for GPU workloads that require specific amounts of video memory.
- Returns:
- The minimum and maximum total accelerator memory in mebibytes (MiB). This is important for GPU workloads that require specific amounts of video memory.
-
networkBandwidthGbps
The minimum and maximum network bandwidth in gigabits per second (Gbps). This is crucial for network-intensive workloads that require high throughput.
- Returns:
- The minimum and maximum network bandwidth in gigabits per second (Gbps). This is crucial for network-intensive workloads that require high throughput.
-
hasAllowedInstanceTypes
public final boolean hasAllowedInstanceTypes()For responses, this returns true if the service returned a value for the AllowedInstanceTypes 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. -
allowedInstanceTypes
The instance types to include in the selection. When specified, Amazon ECS only considers these instance types, subject to the other requirements specified.
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
hasAllowedInstanceTypes()
method.- Returns:
- The instance types to include in the selection. When specified, Amazon ECS only considers these instance types, subject to the other requirements specified.
-
maxSpotPriceAsPercentageOfOptimalOnDemandPrice
The maximum price for Spot instances as a percentage of the optimal On-Demand price. This provides more precise cost control for Spot instance selection.
- Returns:
- The maximum price for Spot instances as a percentage of the optimal On-Demand price. This provides more precise cost control for Spot instance selection.
-
toBuilder
Description copied from interface:ToCopyableBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToCopyableBuilder<InstanceRequirementsRequest.Builder,
InstanceRequirementsRequest> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
Description copied from interface:SdkPojo
Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToField
in interfaceSdkPojo
- Returns:
- The mapping between the field name and its corresponding field.
-