#[non_exhaustive]
pub struct InstanceRequirements { /* private fields */ }
Expand description

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

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.

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

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.

Implementations§

The minimum and maximum number of vCPUs.

The minimum and maximum amount of memory, in MiB.

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

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

Default: No minimum or maximum limits

The instance types to exclude.

You can use strings with one or more wild cards, represented by an asterisk (*), to exclude 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 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.

Default: No excluded instance types

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

The price protection threshold for Spot Instances. This is the maximum you’ll pay for a 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

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

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

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

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

This parameter is not supported for GetSpotPlacementScores.

Default: false

The minimum and maximum number of network interfaces.

Default: No minimum or maximum limits

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

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

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

Default: No minimum or maximum limits

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

The accelerator types that must be on the instance type.

  • For instance types with GPU accelerators, specify gpu.

  • For instance types with FPGA accelerators, specify fpga.

  • For instance types with inference accelerators, specify inference.

Default: Any accelerator type

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

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

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

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

Default: No minimum or maximum limits

Creates a new builder-style object to manufacture InstanceRequirements.

Examples found in repository?
src/xml_deser.rs (line 53231)
53227
53228
53229
53230
53231
53232
53233
53234
53235
53236
53237
53238
53239
53240
53241
53242
53243
53244
53245
53246
53247
53248
53249
53250
53251
53252
53253
53254
53255
53256
53257
53258
53259
53260
53261
53262
53263
53264
53265
53266
53267
53268
53269
53270
53271
53272
53273
53274
53275
53276
53277
53278
53279
53280
53281
53282
53283
53284
53285
53286
53287
53288
53289
53290
53291
53292
53293
53294
53295
53296
53297
53298
53299
53300
53301
53302
53303
53304
53305
53306
53307
53308
53309
53310
53311
53312
53313
53314
53315
53316
53317
53318
53319
53320
53321
53322
53323
53324
53325
53326
53327
53328
53329
53330
53331
53332
53333
53334
53335
53336
53337
53338
53339
53340
53341
53342
53343
53344
53345
53346
53347
53348
53349
53350
53351
53352
53353
53354
53355
53356
53357
53358
53359
53360
53361
53362
53363
53364
53365
53366
53367
53368
53369
53370
53371
53372
53373
53374
53375
53376
53377
53378
53379
53380
53381
53382
53383
53384
53385
53386
53387
53388
53389
53390
53391
53392
53393
53394
53395
53396
53397
53398
53399
53400
53401
53402
53403
53404
53405
53406
53407
53408
53409
53410
53411
53412
53413
53414
53415
53416
53417
53418
53419
53420
53421
53422
53423
53424
53425
53426
53427
53428
53429
53430
53431
53432
53433
53434
53435
53436
53437
53438
53439
53440
53441
53442
53443
53444
53445
53446
53447
53448
53449
53450
53451
53452
53453
53454
53455
53456
53457
53458
53459
53460
53461
53462
53463
53464
53465
53466
53467
53468
53469
53470
53471
53472
53473
53474
53475
pub fn deser_structure_crate_model_instance_requirements(
    decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<crate::model::InstanceRequirements, aws_smithy_xml::decode::XmlDecodeError> {
    #[allow(unused_mut)]
    let mut builder = crate::model::InstanceRequirements::builder();
    while let Some(mut tag) = decoder.next_tag() {
        match tag.start_el() {
            s if s.matches("vCpuCount") /* VCpuCount com.amazonaws.ec2#InstanceRequirements$VCpuCount */ =>  {
                let var_2539 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_v_cpu_count_range(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_v_cpu_count(var_2539);
            }
            ,
            s if s.matches("memoryMiB") /* MemoryMiB com.amazonaws.ec2#InstanceRequirements$MemoryMiB */ =>  {
                let var_2540 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_memory_mi_b(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_memory_mi_b(var_2540);
            }
            ,
            s if s.matches("cpuManufacturerSet") /* CpuManufacturers com.amazonaws.ec2#InstanceRequirements$CpuManufacturers */ =>  {
                let var_2541 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_cpu_manufacturer_set(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_cpu_manufacturers(var_2541);
            }
            ,
            s if s.matches("memoryGiBPerVCpu") /* MemoryGiBPerVCpu com.amazonaws.ec2#InstanceRequirements$MemoryGiBPerVCpu */ =>  {
                let var_2542 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_memory_gi_b_per_v_cpu(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_memory_gi_b_per_v_cpu(var_2542);
            }
            ,
            s if s.matches("excludedInstanceTypeSet") /* ExcludedInstanceTypes com.amazonaws.ec2#InstanceRequirements$ExcludedInstanceTypes */ =>  {
                let var_2543 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_excluded_instance_type_set(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_excluded_instance_types(var_2543);
            }
            ,
            s if s.matches("instanceGenerationSet") /* InstanceGenerations com.amazonaws.ec2#InstanceRequirements$InstanceGenerations */ =>  {
                let var_2544 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_instance_generation_set(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_instance_generations(var_2544);
            }
            ,
            s if s.matches("spotMaxPricePercentageOverLowestPrice") /* SpotMaxPricePercentageOverLowestPrice com.amazonaws.ec2#InstanceRequirements$SpotMaxPricePercentageOverLowestPrice */ =>  {
                let var_2545 =
                    Some(
                         {
                            <i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_spot_max_price_percentage_over_lowest_price(var_2545);
            }
            ,
            s if s.matches("onDemandMaxPricePercentageOverLowestPrice") /* OnDemandMaxPricePercentageOverLowestPrice com.amazonaws.ec2#InstanceRequirements$OnDemandMaxPricePercentageOverLowestPrice */ =>  {
                let var_2546 =
                    Some(
                         {
                            <i32 as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (integer: `com.amazonaws.ec2#Integer`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_on_demand_max_price_percentage_over_lowest_price(var_2546);
            }
            ,
            s if s.matches("bareMetal") /* BareMetal com.amazonaws.ec2#InstanceRequirements$BareMetal */ =>  {
                let var_2547 =
                    Some(
                        Result::<crate::model::BareMetal, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::BareMetal::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_bare_metal(var_2547);
            }
            ,
            s if s.matches("burstablePerformance") /* BurstablePerformance com.amazonaws.ec2#InstanceRequirements$BurstablePerformance */ =>  {
                let var_2548 =
                    Some(
                        Result::<crate::model::BurstablePerformance, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::BurstablePerformance::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_burstable_performance(var_2548);
            }
            ,
            s if s.matches("requireHibernateSupport") /* RequireHibernateSupport com.amazonaws.ec2#InstanceRequirements$RequireHibernateSupport */ =>  {
                let var_2549 =
                    Some(
                         {
                            <bool as aws_smithy_types::primitive::Parse>::parse_smithy_primitive(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                            .map_err(|_|aws_smithy_xml::decode::XmlDecodeError::custom("expected (boolean: `com.amazonaws.ec2#Boolean`)"))
                        }
                        ?
                    )
                ;
                builder = builder.set_require_hibernate_support(var_2549);
            }
            ,
            s if s.matches("networkInterfaceCount") /* NetworkInterfaceCount com.amazonaws.ec2#InstanceRequirements$NetworkInterfaceCount */ =>  {
                let var_2550 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_network_interface_count(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_network_interface_count(var_2550);
            }
            ,
            s if s.matches("localStorage") /* LocalStorage com.amazonaws.ec2#InstanceRequirements$LocalStorage */ =>  {
                let var_2551 =
                    Some(
                        Result::<crate::model::LocalStorage, aws_smithy_xml::decode::XmlDecodeError>::Ok(
                            crate::model::LocalStorage::from(
                                aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
                            )
                        )
                        ?
                    )
                ;
                builder = builder.set_local_storage(var_2551);
            }
            ,
            s if s.matches("localStorageTypeSet") /* LocalStorageTypes com.amazonaws.ec2#InstanceRequirements$LocalStorageTypes */ =>  {
                let var_2552 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_local_storage_type_set(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_local_storage_types(var_2552);
            }
            ,
            s if s.matches("totalLocalStorageGB") /* TotalLocalStorageGB com.amazonaws.ec2#InstanceRequirements$TotalLocalStorageGB */ =>  {
                let var_2553 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_total_local_storage_gb(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_total_local_storage_gb(var_2553);
            }
            ,
            s if s.matches("baselineEbsBandwidthMbps") /* BaselineEbsBandwidthMbps com.amazonaws.ec2#InstanceRequirements$BaselineEbsBandwidthMbps */ =>  {
                let var_2554 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_baseline_ebs_bandwidth_mbps(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_baseline_ebs_bandwidth_mbps(var_2554);
            }
            ,
            s if s.matches("acceleratorTypeSet") /* AcceleratorTypes com.amazonaws.ec2#InstanceRequirements$AcceleratorTypes */ =>  {
                let var_2555 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_accelerator_type_set(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_accelerator_types(var_2555);
            }
            ,
            s if s.matches("acceleratorCount") /* AcceleratorCount com.amazonaws.ec2#InstanceRequirements$AcceleratorCount */ =>  {
                let var_2556 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_accelerator_count(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_accelerator_count(var_2556);
            }
            ,
            s if s.matches("acceleratorManufacturerSet") /* AcceleratorManufacturers com.amazonaws.ec2#InstanceRequirements$AcceleratorManufacturers */ =>  {
                let var_2557 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_accelerator_manufacturer_set(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_accelerator_manufacturers(var_2557);
            }
            ,
            s if s.matches("acceleratorNameSet") /* AcceleratorNames com.amazonaws.ec2#InstanceRequirements$AcceleratorNames */ =>  {
                let var_2558 =
                    Some(
                        crate::xml_deser::deser_list_com_amazonaws_ec2_accelerator_name_set(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_accelerator_names(var_2558);
            }
            ,
            s if s.matches("acceleratorTotalMemoryMiB") /* AcceleratorTotalMemoryMiB com.amazonaws.ec2#InstanceRequirements$AcceleratorTotalMemoryMiB */ =>  {
                let var_2559 =
                    Some(
                        crate::xml_deser::deser_structure_crate_model_accelerator_total_memory_mi_b(&mut tag)
                        ?
                    )
                ;
                builder = builder.set_accelerator_total_memory_mi_b(var_2559);
            }
            ,
            _ => {}
        }
    }
    Ok(builder.build())
}

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more