Class InstanceRequirementsRequest

java.lang.Object
software.amazon.awssdk.services.ecs.model.InstanceRequirementsRequest
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<InstanceRequirementsRequest.Builder,InstanceRequirementsRequest>

@Generated("software.amazon.awssdk:codegen") public final class InstanceRequirementsRequest extends Object implements SdkPojo, Serializable, 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:
  • Method Details

    • vCpuCount

      public final VCpuCountRangeRequest 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

      public final MemoryMiBRequest 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

      public final List<CpuManufacturer> cpuManufacturers()

      The CPU manufacturers to include or exclude. You can specify intel, amd, or amazon-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, or amazon-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 the isEmpty() 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

      public final List<String> cpuManufacturersAsStrings()

      The CPU manufacturers to include or exclude. You can specify intel, amd, or amazon-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, or amazon-web-services to control which CPU types are used for your workloads.
    • memoryGiBPerVCpu

      public final MemoryGiBPerVCpuRequest 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 the isEmpty() 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

      public final List<String> 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

      public final List<InstanceGeneration> instanceGenerations()

      The instance generations to include. You can specify current to use the latest generation instances, or previous 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, or previous 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 the isEmpty() 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

      public final List<String> instanceGenerationsAsStrings()

      The instance generations to include. You can specify current to use the latest generation instances, or previous 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, or previous to include previous generation instances for cost optimization.
    • spotMaxPricePercentageOverLowestPrice

      public final Integer 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

      public final Integer 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

      public final BareMetal bareMetal()

      Indicates whether to include bare metal instance types. Set to included to allow bare metal instances, excluded to exclude them, or required to use only bare metal instances.

      If the service returns an enum value that is not available in the current SDK version, bareMetal will return BareMetal.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from bareMetalAsString().

      Returns:
      Indicates whether to include bare metal instance types. Set to included to allow bare metal instances, excluded to exclude them, or required to use only bare metal instances.
      See Also:
    • bareMetalAsString

      public final String bareMetalAsString()

      Indicates whether to include bare metal instance types. Set to included to allow bare metal instances, excluded to exclude them, or required to use only bare metal instances.

      If the service returns an enum value that is not available in the current SDK version, bareMetal will return BareMetal.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from bareMetalAsString().

      Returns:
      Indicates whether to include bare metal instance types. Set to included to allow bare metal instances, excluded to exclude them, or required to use only bare metal instances.
      See Also:
    • burstablePerformance

      public final BurstablePerformance burstablePerformance()

      Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to included to allow burstable instances, excluded to exclude them, or required to use only burstable instances.

      If the service returns an enum value that is not available in the current SDK version, burstablePerformance will return BurstablePerformance.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from burstablePerformanceAsString().

      Returns:
      Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to included to allow burstable instances, excluded to exclude them, or required to use only burstable instances.
      See Also:
    • burstablePerformanceAsString

      public final String burstablePerformanceAsString()

      Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to included to allow burstable instances, excluded to exclude them, or required to use only burstable instances.

      If the service returns an enum value that is not available in the current SDK version, burstablePerformance will return BurstablePerformance.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from burstablePerformanceAsString().

      Returns:
      Indicates whether to include burstable performance instance types (T2, T3, T3a, T4g). Set to included to allow burstable instances, excluded to exclude them, or required to use only burstable instances.
      See Also:
    • requireHibernateSupport

      public final Boolean 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

      public final NetworkInterfaceCountRequest 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

      public final LocalStorage localStorage()

      Indicates whether to include instance types with local storage. Set to included to allow local storage, excluded to exclude it, or required 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 return LocalStorage.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from localStorageAsString().

      Returns:
      Indicates whether to include instance types with local storage. Set to included to allow local storage, excluded to exclude it, or required to use only instances with local storage.
      See Also:
    • localStorageAsString

      public final String localStorageAsString()

      Indicates whether to include instance types with local storage. Set to included to allow local storage, excluded to exclude it, or required 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 return LocalStorage.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from localStorageAsString().

      Returns:
      Indicates whether to include instance types with local storage. Set to included to allow local storage, excluded to exclude it, or required to use only instances with local storage.
      See Also:
    • localStorageTypes

      public final List<LocalStorageType> 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 the isEmpty() 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

      public final List<String> 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

      public final TotalLocalStorageGBRequest 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

      public final BaselineEbsBandwidthMbpsRequest 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

      public final List<AcceleratorType> acceleratorTypes()

      The accelerator types to include. You can specify gpu for graphics processing units, fpga for field programmable gate arrays, or inference 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, or inference 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 the isEmpty() 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

      public final List<String> acceleratorTypesAsStrings()

      The accelerator types to include. You can specify gpu for graphics processing units, fpga for field programmable gate arrays, or inference 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, or inference for machine learning inference accelerators.
    • acceleratorCount

      public final AcceleratorCountRequest 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

      public final List<AcceleratorManufacturer> acceleratorManufacturers()

      The accelerator manufacturers to include. You can specify nvidia, amd, amazon-web-services, or xilinx 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, or xilinx 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 the isEmpty() 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

      public final List<String> acceleratorManufacturersAsStrings()

      The accelerator manufacturers to include. You can specify nvidia, amd, amazon-web-services, or xilinx 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, or xilinx depending on your accelerator requirements.
    • acceleratorNames

      public final List<AcceleratorName> 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 the isEmpty() 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

      public final List<String> 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

      public final AcceleratorTotalMemoryMiBRequest 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

      public final NetworkBandwidthGbpsRequest 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 the isEmpty() 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

      public final List<String> 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

      public final Integer 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 interface ToCopyableBuilder<InstanceRequirementsRequest.Builder,InstanceRequirementsRequest>
      Returns:
      a builder for type T
    • builder

      public static InstanceRequirementsRequest.Builder builder()
    • serializableBuilderClass

      public static Class<? extends InstanceRequirementsRequest.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      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 an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • 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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.