#[non_exhaustive]
pub struct InstanceRequirementsRequest {
Show 23 fields pub v_cpu_count: Option<VCpuCountRangeRequest>, pub memory_mi_b: Option<MemoryMiBRequest>, pub cpu_manufacturers: Option<Vec<CpuManufacturer>>, pub memory_gi_b_per_v_cpu: Option<MemoryGiBPerVCpuRequest>, pub excluded_instance_types: Option<Vec<String>>, pub instance_generations: Option<Vec<InstanceGeneration>>, pub spot_max_price_percentage_over_lowest_price: Option<i32>, pub on_demand_max_price_percentage_over_lowest_price: Option<i32>, pub bare_metal: Option<BareMetal>, pub burstable_performance: Option<BurstablePerformance>, pub require_hibernate_support: Option<bool>, pub network_interface_count: Option<NetworkInterfaceCountRequest>, pub local_storage: Option<LocalStorage>, pub local_storage_types: Option<Vec<LocalStorageType>>, pub total_local_storage_gb: Option<TotalLocalStorageGbRequest>, pub baseline_ebs_bandwidth_mbps: Option<BaselineEbsBandwidthMbpsRequest>, pub accelerator_types: Option<Vec<AcceleratorType>>, pub accelerator_count: Option<AcceleratorCountRequest>, pub accelerator_manufacturers: Option<Vec<AcceleratorManufacturer>>, pub accelerator_names: Option<Vec<AcceleratorName>>, pub accelerator_total_memory_mi_b: Option<AcceleratorTotalMemoryMiBRequest>, pub network_bandwidth_gbps: Option<NetworkBandwidthGbpsRequest>, pub allowed_instance_types: Option<Vec<String>>,
}
Expand description

The attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.

You must specify VCpuCount and MemoryMiB. All other attributes are optional. Any unspecified optional attribute is set to its default.

When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.

To limit the list of instance types from which Amazon EC2 can identify matching instance types, you can use one of the following parameters, but not both in the same request:

  • AllowedInstanceTypes - The instance types to include in the list. All other instance types are ignored, even if they match your specified attributes.

  • ExcludedInstanceTypes - The instance types to exclude from the list, even if they match your specified attributes.

If you specify InstanceRequirements, you can't specify InstanceType.

Attribute-based instance type selection is only supported when using Auto Scaling groups, EC2 Fleet, and Spot Fleet to launch instances. If you plan to use the launch template in the launch instance wizard, or with the RunInstances API or AWS::EC2::Instance Amazon Web Services CloudFormation resource, you can't specify InstanceRequirements.

For more information, see Attribute-based instance type selection for EC2 Fleet, Attribute-based instance type selection for Spot Fleet, and Spot placement score in the Amazon EC2 User Guide.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§v_cpu_count: Option<VCpuCountRangeRequest>

The minimum and maximum number of vCPUs.

§memory_mi_b: Option<MemoryMiBRequest>

The minimum and maximum amount of memory, in MiB.

§cpu_manufacturers: Option<Vec<CpuManufacturer>>

The CPU manufacturers to include.

  • For instance types with Intel CPUs, specify intel.

  • For instance types with AMD CPUs, specify amd.

  • For instance types with Amazon Web Services CPUs, specify amazon-web-services.

Don't confuse the CPU manufacturer with the CPU architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template.

Default: Any manufacturer

§memory_gi_b_per_v_cpu: Option<MemoryGiBPerVCpuRequest>

The minimum and maximum amount of memory per vCPU, in GiB.

Default: No minimum or maximum limits

§excluded_instance_types: Option<Vec<String>>

The instance types to exclude.

You can use strings with one or more wild cards, represented by an asterisk (*), to exclude an instance family, type, size, or generation. The following are examples: m5.8xlarge, c5*.*, m5a.*, r*, *3*.

For example, if you specify c5*,Amazon EC2 will exclude the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.*, Amazon EC2 will exclude all the M5a instance types, but not the M5n instance types.

If you specify ExcludedInstanceTypes, you can't specify AllowedInstanceTypes.

Default: No excluded instance types

§instance_generations: Option<Vec<InstanceGeneration>>

Indicates whether current or previous generation instance types are included. The current generation instance types are recommended for use. Current generation instance types are typically the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide.

For current generation instance types, specify current.

For previous generation instance types, specify previous.

Default: Current and previous generation instance types

§spot_max_price_percentage_over_lowest_price: Option<i32>

The price protection threshold for Spot Instance. This is the maximum you’ll pay for an Spot Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

To turn off price protection, specify a high value, such as 999999.

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements.

If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

Default: 100

§on_demand_max_price_percentage_over_lowest_price: Option<i32>

The price protection threshold for On-Demand Instances. This is the maximum you’ll pay for an On-Demand Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

To turn off price protection, specify a high value, such as 999999.

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements.

If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

Default: 20

§bare_metal: Option<BareMetal>

Indicates whether bare metal instance types must be included, excluded, or required.

  • To include bare metal instance types, specify included.

  • To require only bare metal instance types, specify required.

  • To exclude bare metal instance types, specify excluded.

Default: excluded

§burstable_performance: Option<BurstablePerformance>

Indicates whether burstable performance T instance types are included, excluded, or required. For more information, see Burstable performance instances.

  • To include burstable performance instance types, specify included.

  • To require only burstable performance instance types, specify required.

  • To exclude burstable performance instance types, specify excluded.

Default: excluded

§require_hibernate_support: Option<bool>

Indicates whether instance types must support hibernation for On-Demand Instances.

This parameter is not supported for GetSpotPlacementScores.

Default: false

§network_interface_count: Option<NetworkInterfaceCountRequest>

The minimum and maximum number of network interfaces.

Default: No minimum or maximum limits

§local_storage: Option<LocalStorage>

Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, Amazon EC2 instance store in the Amazon EC2 User Guide.

  • To include instance types with instance store volumes, specify included.

  • To require only instance types with instance store volumes, specify required.

  • To exclude instance types with instance store volumes, specify excluded.

Default: included

§local_storage_types: Option<Vec<LocalStorageType>>

The type of local storage that is required.

  • For instance types with hard disk drive (HDD) storage, specify hdd.

  • For instance types with solid state drive (SSD) storage, specify ssd.

Default: hdd and ssd

§total_local_storage_gb: Option<TotalLocalStorageGbRequest>

The minimum and maximum amount of total local storage, in GB.

Default: No minimum or maximum limits

§baseline_ebs_bandwidth_mbps: Option<BaselineEbsBandwidthMbpsRequest>

The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide.

Default: No minimum or maximum limits

§accelerator_types: Option<Vec<AcceleratorType>>

The accelerator types that must be on the instance type.

  • To include instance types with GPU hardware, specify gpu.

  • To include instance types with FPGA hardware, specify fpga.

  • To include instance types with inference hardware, specify inference.

Default: Any accelerator type

§accelerator_count: Option<AcceleratorCountRequest>

The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web Services Inferentia chips) on an instance.

To exclude accelerator-enabled instance types, set Max to 0.

Default: No minimum or maximum limits

§accelerator_manufacturers: Option<Vec<AcceleratorManufacturer>>

Indicates whether instance types must have accelerators by specific manufacturers.

  • For instance types with NVIDIA devices, specify nvidia.

  • For instance types with AMD devices, specify amd.

  • For instance types with Amazon Web Services devices, specify amazon-web-services.

  • For instance types with Xilinx devices, specify xilinx.

Default: Any manufacturer

§accelerator_names: Option<Vec<AcceleratorName>>

The accelerators that must be on the instance type.

  • For instance types with NVIDIA A100 GPUs, specify a100.

  • For instance types with NVIDIA V100 GPUs, specify v100.

  • For instance types with NVIDIA K80 GPUs, specify k80.

  • For instance types with NVIDIA T4 GPUs, specify t4.

  • For instance types with NVIDIA M60 GPUs, specify m60.

  • For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520.

  • For instance types with Xilinx VU9P FPGAs, specify vu9p.

  • For instance types with Amazon Web Services Inferentia chips, specify inferentia.

  • For instance types with NVIDIA GRID K520 GPUs, specify k520.

Default: Any accelerator

§accelerator_total_memory_mi_b: Option<AcceleratorTotalMemoryMiBRequest>

The minimum and maximum amount of total accelerator memory, in MiB.

Default: No minimum or maximum limits

§network_bandwidth_gbps: Option<NetworkBandwidthGbpsRequest>

The minimum and maximum amount of baseline network bandwidth, in gigabits per second (Gbps). For more information, see Amazon EC2 instance network bandwidth in the Amazon EC2 User Guide.

Default: No minimum or maximum limits

§allowed_instance_types: Option<Vec<String>>

The instance types to apply your specified attributes against. All other instance types are ignored, even if they match your specified attributes.

You can use strings with one or more wild cards, represented by an asterisk (*), to allow an instance type, size, or generation. The following are examples: m5.8xlarge, c5*.*, m5a.*, r*, *3*.

For example, if you specify c5*,Amazon EC2 will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.*, Amazon EC2 will allow all the M5a instance types, but not the M5n instance types.

If you specify AllowedInstanceTypes, you can't specify ExcludedInstanceTypes.

Default: All instance types

Implementations§

source§

impl InstanceRequirementsRequest

source

pub fn v_cpu_count(&self) -> Option<&VCpuCountRangeRequest>

The minimum and maximum number of vCPUs.

source

pub fn memory_mi_b(&self) -> Option<&MemoryMiBRequest>

The minimum and maximum amount of memory, in MiB.

source

pub fn cpu_manufacturers(&self) -> Option<&[CpuManufacturer]>

The CPU manufacturers to include.

  • For instance types with Intel CPUs, specify intel.

  • For instance types with AMD CPUs, specify amd.

  • For instance types with Amazon Web Services CPUs, specify amazon-web-services.

Don't confuse the CPU manufacturer with the CPU architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template.

Default: Any manufacturer

source

pub fn memory_gi_b_per_v_cpu(&self) -> Option<&MemoryGiBPerVCpuRequest>

The minimum and maximum amount of memory per vCPU, in GiB.

Default: No minimum or maximum limits

source

pub fn excluded_instance_types(&self) -> Option<&[String]>

The instance types to exclude.

You can use strings with one or more wild cards, represented by an asterisk (*), to exclude an instance family, type, size, or generation. The following are examples: m5.8xlarge, c5*.*, m5a.*, r*, *3*.

For example, if you specify c5*,Amazon EC2 will exclude the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.*, Amazon EC2 will exclude all the M5a instance types, but not the M5n instance types.

If you specify ExcludedInstanceTypes, you can't specify AllowedInstanceTypes.

Default: No excluded instance types

source

pub fn instance_generations(&self) -> Option<&[InstanceGeneration]>

Indicates whether current or previous generation instance types are included. The current generation instance types are recommended for use. Current generation instance types are typically the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide.

For current generation instance types, specify current.

For previous generation instance types, specify previous.

Default: Current and previous generation instance types

source

pub fn spot_max_price_percentage_over_lowest_price(&self) -> Option<i32>

The price protection threshold for Spot Instance. This is the maximum you’ll pay for an Spot Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

To turn off price protection, specify a high value, such as 999999.

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements.

If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

Default: 100

source

pub fn on_demand_max_price_percentage_over_lowest_price(&self) -> Option<i32>

The price protection threshold for On-Demand Instances. This is the maximum you’ll pay for an On-Demand Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.

The parameter accepts an integer, which Amazon EC2 interprets as a percentage.

To turn off price protection, specify a high value, such as 999999.

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements.

If you set TargetCapacityUnitType to vcpu or memory-mib, the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.

Default: 20

source

pub fn bare_metal(&self) -> Option<&BareMetal>

Indicates whether bare metal instance types must be included, excluded, or required.

  • To include bare metal instance types, specify included.

  • To require only bare metal instance types, specify required.

  • To exclude bare metal instance types, specify excluded.

Default: excluded

source

pub fn burstable_performance(&self) -> Option<&BurstablePerformance>

Indicates whether burstable performance T instance types are included, excluded, or required. For more information, see Burstable performance instances.

  • To include burstable performance instance types, specify included.

  • To require only burstable performance instance types, specify required.

  • To exclude burstable performance instance types, specify excluded.

Default: excluded

source

pub fn require_hibernate_support(&self) -> Option<bool>

Indicates whether instance types must support hibernation for On-Demand Instances.

This parameter is not supported for GetSpotPlacementScores.

Default: false

source

pub fn network_interface_count(&self) -> Option<&NetworkInterfaceCountRequest>

The minimum and maximum number of network interfaces.

Default: No minimum or maximum limits

source

pub fn local_storage(&self) -> Option<&LocalStorage>

Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, Amazon EC2 instance store in the Amazon EC2 User Guide.

  • To include instance types with instance store volumes, specify included.

  • To require only instance types with instance store volumes, specify required.

  • To exclude instance types with instance store volumes, specify excluded.

Default: included

source

pub fn local_storage_types(&self) -> Option<&[LocalStorageType]>

The type of local storage that is required.

  • For instance types with hard disk drive (HDD) storage, specify hdd.

  • For instance types with solid state drive (SSD) storage, specify ssd.

Default: hdd and ssd

source

pub fn total_local_storage_gb(&self) -> Option<&TotalLocalStorageGbRequest>

The minimum and maximum amount of total local storage, in GB.

Default: No minimum or maximum limits

source

pub fn baseline_ebs_bandwidth_mbps( &self ) -> Option<&BaselineEbsBandwidthMbpsRequest>

The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide.

Default: No minimum or maximum limits

source

pub fn accelerator_types(&self) -> Option<&[AcceleratorType]>

The accelerator types that must be on the instance type.

  • To include instance types with GPU hardware, specify gpu.

  • To include instance types with FPGA hardware, specify fpga.

  • To include instance types with inference hardware, specify inference.

Default: Any accelerator type

source

pub fn accelerator_count(&self) -> Option<&AcceleratorCountRequest>

The minimum and maximum number of accelerators (GPUs, FPGAs, or Amazon Web Services Inferentia chips) on an instance.

To exclude accelerator-enabled instance types, set Max to 0.

Default: No minimum or maximum limits

source

pub fn accelerator_manufacturers(&self) -> Option<&[AcceleratorManufacturer]>

Indicates whether instance types must have accelerators by specific manufacturers.

  • For instance types with NVIDIA devices, specify nvidia.

  • For instance types with AMD devices, specify amd.

  • For instance types with Amazon Web Services devices, specify amazon-web-services.

  • For instance types with Xilinx devices, specify xilinx.

Default: Any manufacturer

source

pub fn accelerator_names(&self) -> Option<&[AcceleratorName]>

The accelerators that must be on the instance type.

  • For instance types with NVIDIA A100 GPUs, specify a100.

  • For instance types with NVIDIA V100 GPUs, specify v100.

  • For instance types with NVIDIA K80 GPUs, specify k80.

  • For instance types with NVIDIA T4 GPUs, specify t4.

  • For instance types with NVIDIA M60 GPUs, specify m60.

  • For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520.

  • For instance types with Xilinx VU9P FPGAs, specify vu9p.

  • For instance types with Amazon Web Services Inferentia chips, specify inferentia.

  • For instance types with NVIDIA GRID K520 GPUs, specify k520.

Default: Any accelerator

source

pub fn accelerator_total_memory_mi_b( &self ) -> Option<&AcceleratorTotalMemoryMiBRequest>

The minimum and maximum amount of total accelerator memory, in MiB.

Default: No minimum or maximum limits

source

pub fn network_bandwidth_gbps(&self) -> Option<&NetworkBandwidthGbpsRequest>

The minimum and maximum amount of baseline network bandwidth, in gigabits per second (Gbps). For more information, see Amazon EC2 instance network bandwidth in the Amazon EC2 User Guide.

Default: No minimum or maximum limits

source

pub fn allowed_instance_types(&self) -> Option<&[String]>

The instance types to apply your specified attributes against. All other instance types are ignored, even if they match your specified attributes.

You can use strings with one or more wild cards, represented by an asterisk (*), to allow an instance type, size, or generation. The following are examples: m5.8xlarge, c5*.*, m5a.*, r*, *3*.

For example, if you specify c5*,Amazon EC2 will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.*, Amazon EC2 will allow all the M5a instance types, but not the M5n instance types.

If you specify AllowedInstanceTypes, you can't specify ExcludedInstanceTypes.

Default: All instance types

source§

impl InstanceRequirementsRequest

source

pub fn builder() -> InstanceRequirementsRequestBuilder

Creates a new builder-style object to manufacture InstanceRequirementsRequest.

Trait Implementations§

source§

impl Clone for InstanceRequirementsRequest

source§

fn clone(&self) -> InstanceRequirementsRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InstanceRequirementsRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<InstanceRequirementsRequest> for InstanceRequirementsRequest

source§

fn eq(&self, other: &InstanceRequirementsRequest) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for InstanceRequirementsRequest

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more