Class: AWSCDK::EC2::CfnSpotFleet::InstanceRequirementsRequestProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_spot_fleet.rb

Overview

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 AWS CloudFormation resource, you can't specify InstanceRequirements .

For more information, see Specify attributes for instance type selection for EC2 Fleet or Spot Fleet and Spot placement score in the Amazon EC2 User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(accelerator_count: nil, accelerator_manufacturers: nil, accelerator_names: nil, accelerator_total_memory_mib: nil, accelerator_types: nil, allowed_instance_types: nil, bare_metal: nil, baseline_ebs_bandwidth_mbps: nil, baseline_performance_factors: nil, burstable_performance: nil, cpu_manufacturers: nil, excluded_instance_types: nil, instance_generations: nil, local_storage: nil, local_storage_types: nil, max_spot_price_as_percentage_of_optimal_on_demand_price: nil, memory_gib_per_v_cpu: nil, memory_mib: nil, network_bandwidth_gbps: nil, network_interface_count: nil, on_demand_max_price_percentage_over_lowest_price: nil, require_encryption_in_transit: nil, require_hibernate_support: nil, spot_max_price_percentage_over_lowest_price: nil, total_local_storage_gb: nil, v_cpu_count: nil) ⇒ InstanceRequirementsRequestProperty

Returns a new instance of InstanceRequirementsRequestProperty.

Parameters:

  • accelerator_count (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::AcceleratorCountRequestProperty, nil) (defaults to: nil)

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

  • accelerator_manufacturers (Array<String>, nil) (defaults to: nil)

    Indicates whether instance types must have accelerators by specific manufacturers.

  • accelerator_names (Array<String>, nil) (defaults to: nil)

    The accelerators that must be on the instance type.

  • accelerator_total_memory_mib (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::AcceleratorTotalMemoryMiBRequestProperty, nil) (defaults to: nil)

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

  • accelerator_types (Array<String>, nil) (defaults to: nil)

    The accelerator types that must be on the instance type.

  • allowed_instance_types (Array<String>, nil) (defaults to: nil)

    The instance types to apply your specified attributes against.

  • bare_metal (String, nil) (defaults to: nil)

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

  • baseline_ebs_bandwidth_mbps (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::BaselineEbsBandwidthMbpsRequestProperty, nil) (defaults to: nil)

    The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.

  • baseline_performance_factors (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::BaselinePerformanceFactorsRequestProperty, nil) (defaults to: nil)

    The baseline performance to consider, using an instance family as a baseline reference.

  • burstable_performance (String, nil) (defaults to: nil)

    Indicates whether burstable performance T instance types are included, excluded, or required.

  • cpu_manufacturers (Array<String>, nil) (defaults to: nil)

    The CPU manufacturers to include.

  • excluded_instance_types (Array<String>, nil) (defaults to: nil)

    The instance types to exclude.

  • instance_generations (Array<String>, nil) (defaults to: nil)

    Indicates whether current or previous generation instance types are included.

  • local_storage (String, nil) (defaults to: nil)

    Indicates whether instance types with instance store volumes are included, excluded, or required.

  • local_storage_types (Array<String>, nil) (defaults to: nil)

    The type of local storage that is required.

  • max_spot_price_as_percentage_of_optimal_on_demand_price (Numeric, nil) (defaults to: nil)

    [Price protection] The price protection threshold for Spot Instances, as a percentage of an identified On-Demand price.

  • memory_gib_per_v_cpu (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::MemoryGiBPerVCpuRequestProperty, nil) (defaults to: nil)

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

  • memory_mib (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::MemoryMiBRequestProperty, nil) (defaults to: nil)

    The minimum and maximum amount of memory, in MiB.

  • network_bandwidth_gbps (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::NetworkBandwidthGbpsRequestProperty, nil) (defaults to: nil)

    The minimum and maximum amount of baseline network bandwidth, in gigabits per second (Gbps).

  • network_interface_count (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::NetworkInterfaceCountRequestProperty, nil) (defaults to: nil)

    The minimum and maximum number of network interfaces.

  • on_demand_max_price_percentage_over_lowest_price (Numeric, nil) (defaults to: nil)

    [Price protection] The price protection threshold for On-Demand Instances, as a percentage higher than an identified On-Demand price.

  • require_encryption_in_transit (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    Specifies whether instance types must support encrypting in-transit traffic between instances.

  • require_hibernate_support (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

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

  • spot_max_price_percentage_over_lowest_price (Numeric, nil) (defaults to: nil)

    [Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified Spot price.

  • total_local_storage_gb (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::TotalLocalStorageGBRequestProperty, nil) (defaults to: nil)

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

  • v_cpu_count (AWSCDK::IResolvable, AWSCDK::EC2::CfnSpotFleet::VCpuCountRangeRequestProperty, nil) (defaults to: nil)

    The minimum and maximum number of vCPUs.



1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
# File 'ec2/cfn_spot_fleet.rb', line 1373

def initialize(accelerator_count: nil, accelerator_manufacturers: nil, accelerator_names: nil, accelerator_total_memory_mib: nil, accelerator_types: nil, allowed_instance_types: nil, bare_metal: nil, baseline_ebs_bandwidth_mbps: nil, baseline_performance_factors: nil, burstable_performance: nil, cpu_manufacturers: nil, excluded_instance_types: nil, instance_generations: nil, local_storage: nil, local_storage_types: nil, max_spot_price_as_percentage_of_optimal_on_demand_price: nil, memory_gib_per_v_cpu: nil, memory_mib: nil, network_bandwidth_gbps: nil, network_interface_count: nil, on_demand_max_price_percentage_over_lowest_price: nil, require_encryption_in_transit: nil, require_hibernate_support: nil, spot_max_price_percentage_over_lowest_price: nil, total_local_storage_gb: nil, v_cpu_count: nil)
  @accelerator_count = accelerator_count.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::AcceleratorCountRequestProperty.new(**accelerator_count.transform_keys(&:to_sym)) : accelerator_count
  Jsii::Type.check_type(@accelerator_count, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0LkFjY2VsZXJhdG9yQ291bnRSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "acceleratorCount") unless @accelerator_count.nil?
  @accelerator_manufacturers = accelerator_manufacturers
  Jsii::Type.check_type(@accelerator_manufacturers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "acceleratorManufacturers") unless @accelerator_manufacturers.nil?
  @accelerator_names = accelerator_names
  Jsii::Type.check_type(@accelerator_names, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "acceleratorNames") unless @accelerator_names.nil?
  @accelerator_total_memory_mib = accelerator_total_memory_mib.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::AcceleratorTotalMemoryMiBRequestProperty.new(**accelerator_total_memory_mib.transform_keys(&:to_sym)) : accelerator_total_memory_mib
  Jsii::Type.check_type(@accelerator_total_memory_mib, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0LkFjY2VsZXJhdG9yVG90YWxNZW1vcnlNaUJSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "acceleratorTotalMemoryMiB") unless @accelerator_total_memory_mib.nil?
  @accelerator_types = accelerator_types
  Jsii::Type.check_type(@accelerator_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "acceleratorTypes") unless @accelerator_types.nil?
  @allowed_instance_types = allowed_instance_types
  Jsii::Type.check_type(@allowed_instance_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "allowedInstanceTypes") unless @allowed_instance_types.nil?
  @bare_metal = bare_metal
  Jsii::Type.check_type(@bare_metal, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "bareMetal") unless @bare_metal.nil?
  @baseline_ebs_bandwidth_mbps = baseline_ebs_bandwidth_mbps.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::BaselineEbsBandwidthMbpsRequestProperty.new(**baseline_ebs_bandwidth_mbps.transform_keys(&:to_sym)) : baseline_ebs_bandwidth_mbps
  Jsii::Type.check_type(@baseline_ebs_bandwidth_mbps, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0LkJhc2VsaW5lRWJzQmFuZHdpZHRoTWJwc1JlcXVlc3RQcm9wZXJ0eSJ9XX19")), "baselineEbsBandwidthMbps") unless @baseline_ebs_bandwidth_mbps.nil?
  @baseline_performance_factors = baseline_performance_factors.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::BaselinePerformanceFactorsRequestProperty.new(**baseline_performance_factors.transform_keys(&:to_sym)) : baseline_performance_factors
  Jsii::Type.check_type(@baseline_performance_factors, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0LkJhc2VsaW5lUGVyZm9ybWFuY2VGYWN0b3JzUmVxdWVzdFByb3BlcnR5In1dfX0=")), "baselinePerformanceFactors") unless @baseline_performance_factors.nil?
  @burstable_performance = burstable_performance
  Jsii::Type.check_type(@burstable_performance, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "burstablePerformance") unless @burstable_performance.nil?
  @cpu_manufacturers = cpu_manufacturers
  Jsii::Type.check_type(@cpu_manufacturers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "cpuManufacturers") unless @cpu_manufacturers.nil?
  @excluded_instance_types = excluded_instance_types
  Jsii::Type.check_type(@excluded_instance_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "excludedInstanceTypes") unless @excluded_instance_types.nil?
  @instance_generations = instance_generations
  Jsii::Type.check_type(@instance_generations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "instanceGenerations") unless @instance_generations.nil?
  @local_storage = local_storage
  Jsii::Type.check_type(@local_storage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "localStorage") unless @local_storage.nil?
  @local_storage_types = local_storage_types
  Jsii::Type.check_type(@local_storage_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "localStorageTypes") unless @local_storage_types.nil?
  @max_spot_price_as_percentage_of_optimal_on_demand_price = max_spot_price_as_percentage_of_optimal_on_demand_price
  Jsii::Type.check_type(@max_spot_price_as_percentage_of_optimal_on_demand_price, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxSpotPriceAsPercentageOfOptimalOnDemandPrice") unless @max_spot_price_as_percentage_of_optimal_on_demand_price.nil?
  @memory_gib_per_v_cpu = memory_gib_per_v_cpu.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::MemoryGiBPerVCpuRequestProperty.new(**memory_gib_per_v_cpu.transform_keys(&:to_sym)) : memory_gib_per_v_cpu
  Jsii::Type.check_type(@memory_gib_per_v_cpu, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0Lk1lbW9yeUdpQlBlclZDcHVSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "memoryGiBPerVCpu") unless @memory_gib_per_v_cpu.nil?
  @memory_mib = memory_mib.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::MemoryMiBRequestProperty.new(**memory_mib.transform_keys(&:to_sym)) : memory_mib
  Jsii::Type.check_type(@memory_mib, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0Lk1lbW9yeU1pQlJlcXVlc3RQcm9wZXJ0eSJ9XX19")), "memoryMiB") unless @memory_mib.nil?
  @network_bandwidth_gbps = network_bandwidth_gbps.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::NetworkBandwidthGbpsRequestProperty.new(**network_bandwidth_gbps.transform_keys(&:to_sym)) : network_bandwidth_gbps
  Jsii::Type.check_type(@network_bandwidth_gbps, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0Lk5ldHdvcmtCYW5kd2lkdGhHYnBzUmVxdWVzdFByb3BlcnR5In1dfX0=")), "networkBandwidthGbps") unless @network_bandwidth_gbps.nil?
  @network_interface_count = network_interface_count.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::NetworkInterfaceCountRequestProperty.new(**network_interface_count.transform_keys(&:to_sym)) : network_interface_count
  Jsii::Type.check_type(@network_interface_count, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0Lk5ldHdvcmtJbnRlcmZhY2VDb3VudFJlcXVlc3RQcm9wZXJ0eSJ9XX19")), "networkInterfaceCount") unless @network_interface_count.nil?
  @on_demand_max_price_percentage_over_lowest_price = on_demand_max_price_percentage_over_lowest_price
  Jsii::Type.check_type(@on_demand_max_price_percentage_over_lowest_price, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "onDemandMaxPricePercentageOverLowestPrice") unless @on_demand_max_price_percentage_over_lowest_price.nil?
  @require_encryption_in_transit = require_encryption_in_transit
  Jsii::Type.check_type(@require_encryption_in_transit, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "requireEncryptionInTransit") unless @require_encryption_in_transit.nil?
  @require_hibernate_support = require_hibernate_support
  Jsii::Type.check_type(@require_hibernate_support, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "requireHibernateSupport") unless @require_hibernate_support.nil?
  @spot_max_price_percentage_over_lowest_price = spot_max_price_percentage_over_lowest_price
  Jsii::Type.check_type(@spot_max_price_percentage_over_lowest_price, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "spotMaxPricePercentageOverLowestPrice") unless @spot_max_price_percentage_over_lowest_price.nil?
  @total_local_storage_gb = total_local_storage_gb.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::TotalLocalStorageGBRequestProperty.new(**total_local_storage_gb.transform_keys(&:to_sym)) : total_local_storage_gb
  Jsii::Type.check_type(@total_local_storage_gb, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0LlRvdGFsTG9jYWxTdG9yYWdlR0JSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "totalLocalStorageGb") unless @total_local_storage_gb.nil?
  @v_cpu_count = v_cpu_count.is_a?(Hash) ? ::AWSCDK::EC2::CfnSpotFleet::VCpuCountRangeRequestProperty.new(**v_cpu_count.transform_keys(&:to_sym)) : v_cpu_count
  Jsii::Type.check_type(@v_cpu_count, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuU3BvdEZsZWV0LlZDcHVDb3VudFJhbmdlUmVxdWVzdFByb3BlcnR5In1dfX0=")), "vCpuCount") unless @v_cpu_count.nil?
end

Instance Attribute Details

#accelerator_countAWSCDK::IResolvable, ... (readonly)

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

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

Default: No minimum or maximum limits



1436
1437
1438
# File 'ec2/cfn_spot_fleet.rb', line 1436

def accelerator_count
  @accelerator_count
end

#accelerator_manufacturersArray<String>? (readonly)

Indicates whether instance types must have accelerators by specific manufacturers.

  • For instance types with AWS devices, specify amazon-web-services .
  • For instance types with AMD devices, specify amd .
  • For instance types with Habana devices, specify habana .
  • For instance types with NVIDIA devices, specify nvidia .
  • For instance types with Xilinx devices, specify xilinx .

Default: Any manufacturer



1449
1450
1451
# File 'ec2/cfn_spot_fleet.rb', line 1449

def accelerator_manufacturers
  @accelerator_manufacturers
end

#accelerator_namesArray<String>? (readonly)

The accelerators that must be on the instance type.

  • For instance types with NVIDIA A10G GPUs, specify a10g .
  • For instance types with NVIDIA A100 GPUs, specify a100 .
  • For instance types with NVIDIA H100 GPUs, specify h100 .
  • For instance types with AWS Inferentia chips, specify inferentia .
  • For instance types with AWS Inferentia2 chips, specify inferentia2 .
  • For instance types with Habana Gaudi HL-205 GPUs, specify gaudi-hl-205 .
  • For instance types with NVIDIA GRID K520 GPUs, specify k520 .
  • For instance types with NVIDIA K80 GPUs, specify k80 .
  • For instance types with NVIDIA L4 GPUs, specify l4 .
  • For instance types with NVIDIA L40S GPUs, specify l40s .
  • 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 AWS Trainium chips, specify trainium .
  • For instance types with AWS Trainium2 chips, specify trainium2 .
  • For instance types with NVIDIA T4 GPUs, specify t4 .
  • For instance types with NVIDIA T4G GPUs, specify t4g .
  • For instance types with Xilinx U30 cards, specify u30 .
  • For instance types with Xilinx VU9P FPGAs, specify vu9p .
  • For instance types with NVIDIA V100 GPUs, specify v100 .

Default: Any accelerator



1476
1477
1478
# File 'ec2/cfn_spot_fleet.rb', line 1476

def accelerator_names
  @accelerator_names
end

#accelerator_total_memory_mibAWSCDK::IResolvable, ... (readonly)

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

Default: No minimum or maximum limits



1483
1484
1485
# File 'ec2/cfn_spot_fleet.rb', line 1483

def accelerator_total_memory_mib
  @accelerator_total_memory_mib
end

#accelerator_typesArray<String>? (readonly)

The accelerator types that must be on the instance type.

  • For instance types with FPGA accelerators, specify fpga .
  • For instance types with GPU accelerators, specify gpu .
  • For instance types with Inference accelerators, specify inference .
  • For instance types with Media accelerators, specify media .

Default: Any accelerator type



1495
1496
1497
# File 'ec2/cfn_spot_fleet.rb', line 1495

def accelerator_types
  @accelerator_types
end

#allowed_instance_typesArray<String>? (readonly)

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



1510
1511
1512
# File 'ec2/cfn_spot_fleet.rb', line 1510

def allowed_instance_types
  @allowed_instance_types
end

#bare_metalString? (readonly)

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



1521
1522
1523
# File 'ec2/cfn_spot_fleet.rb', line 1521

def bare_metal
  @bare_metal
end

#baseline_ebs_bandwidth_mbpsAWSCDK::IResolvable, ... (readonly)

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



1530
1531
1532
# File 'ec2/cfn_spot_fleet.rb', line 1530

def baseline_ebs_bandwidth_mbps
  @baseline_ebs_bandwidth_mbps
end

#baseline_performance_factorsAWSCDK::IResolvable, ... (readonly)

The baseline performance to consider, using an instance family as a baseline reference.

The instance family establishes the lowest acceptable level of performance. Amazon EC2 uses this baseline to guide instance type selection, but there is no guarantee that the selected instance types will always exceed the baseline for every application. Currently, this parameter only supports CPU performance as a baseline performance factor. For more information, see Performance protection in the Amazon EC2 User Guide .



1537
1538
1539
# File 'ec2/cfn_spot_fleet.rb', line 1537

def baseline_performance_factors
  @baseline_performance_factors
end

#burstable_performanceString? (readonly)

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



1550
1551
1552
# File 'ec2/cfn_spot_fleet.rb', line 1550

def burstable_performance
  @burstable_performance
end

#cpu_manufacturersArray<String>? (readonly)

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 AWS CPUs, specify amazon-web-services .
  • For instance types with Apple CPUs, specify apple .

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



1564
1565
1566
# File 'ec2/cfn_spot_fleet.rb', line 1564

def cpu_manufacturers
  @cpu_manufacturers
end

#excluded_instance_typesArray<String>? (readonly)

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



1577
1578
1579
# File 'ec2/cfn_spot_fleet.rb', line 1577

def excluded_instance_types
  @excluded_instance_types
end

#instance_generationsArray<String>? (readonly)

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



1590
1591
1592
# File 'ec2/cfn_spot_fleet.rb', line 1590

def instance_generations
  @instance_generations
end

#local_storageString? (readonly)

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



1603
1604
1605
# File 'ec2/cfn_spot_fleet.rb', line 1603

def local_storage
  @local_storage
end

#local_storage_typesArray<String>? (readonly)

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



1613
1614
1615
# File 'ec2/cfn_spot_fleet.rb', line 1613

def local_storage_types
  @local_storage_types
end

#max_spot_price_as_percentage_of_optimal_on_demand_priceNumeric? (readonly)

[Price protection] The price protection threshold for Spot Instances, as a percentage of 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 the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold.

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

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

Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as 999999 .



1626
1627
1628
# File 'ec2/cfn_spot_fleet.rb', line 1626

def max_spot_price_as_percentage_of_optimal_on_demand_price
  @max_spot_price_as_percentage_of_optimal_on_demand_price
end

#memory_gib_per_v_cpuAWSCDK::IResolvable, ... (readonly)

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

Default: No minimum or maximum limits



1633
1634
1635
# File 'ec2/cfn_spot_fleet.rb', line 1633

def memory_gib_per_v_cpu
  @memory_gib_per_v_cpu
end

#memory_mibAWSCDK::IResolvable, ... (readonly)

The minimum and maximum amount of memory, in MiB.



1638
1639
1640
# File 'ec2/cfn_spot_fleet.rb', line 1638

def memory_mib
  @memory_mib
end

#network_bandwidth_gbpsAWSCDK::IResolvable, ... (readonly)

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



1647
1648
1649
# File 'ec2/cfn_spot_fleet.rb', line 1647

def network_bandwidth_gbps
  @network_bandwidth_gbps
end

#network_interface_countAWSCDK::IResolvable, ... (readonly)

The minimum and maximum number of network interfaces.

Default: No minimum or maximum limits



1654
1655
1656
# File 'ec2/cfn_spot_fleet.rb', line 1654

def network_interface_count
  @network_interface_count
end

#on_demand_max_price_percentage_over_lowest_priceNumeric? (readonly)

[Price protection] 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. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose price exceeds your specified threshold.

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

To indicate no price protection threshold, 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



1671
1672
1673
# File 'ec2/cfn_spot_fleet.rb', line 1671

def on_demand_max_price_percentage_over_lowest_price
  @on_demand_max_price_percentage_over_lowest_price
end

#require_encryption_in_transitBoolean, ... (readonly)

Specifies whether instance types must support encrypting in-transit traffic between instances.

For more information, including the supported instance types, see Encryption in transit in the Amazon EC2 User Guide .

Default: false



1680
1681
1682
# File 'ec2/cfn_spot_fleet.rb', line 1680

def require_encryption_in_transit
  @require_encryption_in_transit
end

#require_hibernate_supportBoolean, ... (readonly)

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

This parameter is not supported for GetSpotPlacementScores .

Default: false



1689
1690
1691
# File 'ec2/cfn_spot_fleet.rb', line 1689

def require_hibernate_support
  @require_hibernate_support
end

#spot_max_price_percentage_over_lowest_priceNumeric? (readonly)

[Price protection] The price protection threshold for Spot Instances, as a percentage higher than an identified Spot price.

The identified Spot price is the Spot 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 Spot price is from the lowest priced current generation instance types, and failing that, from the lowest priced previous generation instance types that match your attributes. When Amazon EC2 selects instance types with your attributes, it will exclude instance types whose Spot price exceeds your specified threshold.

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

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.

This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements .

Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't specify either, Amazon EC2 will automatically apply optimal price protection to consistently select from a wide range of instance types. To indicate no price protection threshold for Spot Instances, meaning you want to consider all instance types that match your attributes, include one of these parameters and specify a high value, such as 999999 .

Default: 100



1706
1707
1708
# File 'ec2/cfn_spot_fleet.rb', line 1706

def spot_max_price_percentage_over_lowest_price
  @spot_max_price_percentage_over_lowest_price
end

#total_local_storage_gbAWSCDK::IResolvable, ... (readonly)

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

Default: No minimum or maximum limits



1713
1714
1715
# File 'ec2/cfn_spot_fleet.rb', line 1713

def total_local_storage_gb
  @total_local_storage_gb
end

#v_cpu_countAWSCDK::IResolvable, ... (readonly)

The minimum and maximum number of vCPUs.



1718
1719
1720
# File 'ec2/cfn_spot_fleet.rb', line 1718

def v_cpu_count
  @v_cpu_count
end

Class Method Details

.jsii_propertiesObject



1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
# File 'ec2/cfn_spot_fleet.rb', line 1720

def self.jsii_properties
  {
    :accelerator_count => "acceleratorCount",
    :accelerator_manufacturers => "acceleratorManufacturers",
    :accelerator_names => "acceleratorNames",
    :accelerator_total_memory_mib => "acceleratorTotalMemoryMiB",
    :accelerator_types => "acceleratorTypes",
    :allowed_instance_types => "allowedInstanceTypes",
    :bare_metal => "bareMetal",
    :baseline_ebs_bandwidth_mbps => "baselineEbsBandwidthMbps",
    :baseline_performance_factors => "baselinePerformanceFactors",
    :burstable_performance => "burstablePerformance",
    :cpu_manufacturers => "cpuManufacturers",
    :excluded_instance_types => "excludedInstanceTypes",
    :instance_generations => "instanceGenerations",
    :local_storage => "localStorage",
    :local_storage_types => "localStorageTypes",
    :max_spot_price_as_percentage_of_optimal_on_demand_price => "maxSpotPriceAsPercentageOfOptimalOnDemandPrice",
    :memory_gib_per_v_cpu => "memoryGiBPerVCpu",
    :memory_mib => "memoryMiB",
    :network_bandwidth_gbps => "networkBandwidthGbps",
    :network_interface_count => "networkInterfaceCount",
    :on_demand_max_price_percentage_over_lowest_price => "onDemandMaxPricePercentageOverLowestPrice",
    :require_encryption_in_transit => "requireEncryptionInTransit",
    :require_hibernate_support => "requireHibernateSupport",
    :spot_max_price_percentage_over_lowest_price => "spotMaxPricePercentageOverLowestPrice",
    :total_local_storage_gb => "totalLocalStorageGb",
    :v_cpu_count => "vCpuCount",
  }
end

Instance Method Details

#to_jsiiObject



1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
# File 'ec2/cfn_spot_fleet.rb', line 1751

def to_jsii
  result = {}
  result.merge!({
    "acceleratorCount" => @accelerator_count,
    "acceleratorManufacturers" => @accelerator_manufacturers,
    "acceleratorNames" => @accelerator_names,
    "acceleratorTotalMemoryMiB" => @accelerator_total_memory_mib,
    "acceleratorTypes" => @accelerator_types,
    "allowedInstanceTypes" => @allowed_instance_types,
    "bareMetal" => @bare_metal,
    "baselineEbsBandwidthMbps" => @baseline_ebs_bandwidth_mbps,
    "baselinePerformanceFactors" => @baseline_performance_factors,
    "burstablePerformance" => @burstable_performance,
    "cpuManufacturers" => @cpu_manufacturers,
    "excludedInstanceTypes" => @excluded_instance_types,
    "instanceGenerations" => @instance_generations,
    "localStorage" => @local_storage,
    "localStorageTypes" => @local_storage_types,
    "maxSpotPriceAsPercentageOfOptimalOnDemandPrice" => @max_spot_price_as_percentage_of_optimal_on_demand_price,
    "memoryGiBPerVCpu" => @memory_gib_per_v_cpu,
    "memoryMiB" => @memory_mib,
    "networkBandwidthGbps" => @network_bandwidth_gbps,
    "networkInterfaceCount" => @network_interface_count,
    "onDemandMaxPricePercentageOverLowestPrice" => @on_demand_max_price_percentage_over_lowest_price,
    "requireEncryptionInTransit" => @require_encryption_in_transit,
    "requireHibernateSupport" => @require_hibernate_support,
    "spotMaxPricePercentageOverLowestPrice" => @spot_max_price_percentage_over_lowest_price,
    "totalLocalStorageGb" => @total_local_storage_gb,
    "vCpuCount" => @v_cpu_count,
  })
  result.compact
end