Class: AWSCDK::EC2::CfnEC2Fleet::InstanceRequirementsRequestProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_ec2_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::CfnEC2Fleet::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::CfnEC2Fleet::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::CfnEC2Fleet::BaselineEbsBandwidthMbpsRequestProperty, nil) (defaults to: nil)

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

  • baseline_performance_factors (AWSCDK::IResolvable, AWSCDK::EC2::CfnEC2Fleet::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::CfnEC2Fleet::MemoryGiBPerVCpuRequestProperty, nil) (defaults to: nil)

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

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

    The minimum and maximum amount of memory, in MiB.

  • network_bandwidth_gbps (AWSCDK::IResolvable, AWSCDK::EC2::CfnEC2Fleet::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::CfnEC2Fleet::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::CfnEC2Fleet::TotalLocalStorageGBRequestProperty, nil) (defaults to: nil)

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

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

    The minimum and maximum number of vCPUs.



1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
# File 'ec2/cfn_ec2_fleet.rb', line 1651

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::CfnEC2Fleet::AcceleratorCountRequestProperty.new(**accelerator_count.transform_keys(&:to_sym)) : accelerator_count
  Jsii::Type.check_type(@accelerator_count, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuQWNjZWxlcmF0b3JDb3VudFJlcXVlc3RQcm9wZXJ0eSJ9XX19")), "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::CfnEC2Fleet::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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuQWNjZWxlcmF0b3JUb3RhbE1lbW9yeU1pQlJlcXVlc3RQcm9wZXJ0eSJ9XX19")), "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::CfnEC2Fleet::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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuQmFzZWxpbmVFYnNCYW5kd2lkdGhNYnBzUmVxdWVzdFByb3BlcnR5In1dfX0=")), "baselineEbsBandwidthMbps") unless @baseline_ebs_bandwidth_mbps.nil?
  @baseline_performance_factors = baseline_performance_factors.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::BaselinePerformanceFactorsRequestProperty.new(**baseline_performance_factors.transform_keys(&:to_sym)) : baseline_performance_factors
  Jsii::Type.check_type(@baseline_performance_factors, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuQmFzZWxpbmVQZXJmb3JtYW5jZUZhY3RvcnNSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "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::CfnEC2Fleet::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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuTWVtb3J5R2lCUGVyVkNwdVJlcXVlc3RQcm9wZXJ0eSJ9XX19")), "memoryGiBPerVCpu") unless @memory_gib_per_v_cpu.nil?
  @memory_mib = memory_mib.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::MemoryMiBRequestProperty.new(**memory_mib.transform_keys(&:to_sym)) : memory_mib
  Jsii::Type.check_type(@memory_mib, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuTWVtb3J5TWlCUmVxdWVzdFByb3BlcnR5In1dfX0=")), "memoryMiB") unless @memory_mib.nil?
  @network_bandwidth_gbps = network_bandwidth_gbps.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::NetworkBandwidthGbpsRequestProperty.new(**network_bandwidth_gbps.transform_keys(&:to_sym)) : network_bandwidth_gbps
  Jsii::Type.check_type(@network_bandwidth_gbps, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuTmV0d29ya0JhbmR3aWR0aEdicHNSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "networkBandwidthGbps") unless @network_bandwidth_gbps.nil?
  @network_interface_count = network_interface_count.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::NetworkInterfaceCountRequestProperty.new(**network_interface_count.transform_keys(&:to_sym)) : network_interface_count
  Jsii::Type.check_type(@network_interface_count, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuTmV0d29ya0ludGVyZmFjZUNvdW50UmVxdWVzdFByb3BlcnR5In1dfX0=")), "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::CfnEC2Fleet::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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuVG90YWxMb2NhbFN0b3JhZ2VHQlJlcXVlc3RQcm9wZXJ0eSJ9XX19")), "totalLocalStorageGb") unless @total_local_storage_gb.nil?
  @v_cpu_count = v_cpu_count.is_a?(Hash) ? ::AWSCDK::EC2::CfnEC2Fleet::VCpuCountRangeRequestProperty.new(**v_cpu_count.transform_keys(&:to_sym)) : v_cpu_count
  Jsii::Type.check_type(@v_cpu_count, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ2ZuRUMyRmxlZXQuVkNwdUNvdW50UmFuZ2VSZXF1ZXN0UHJvcGVydHkifV19fQ==")), "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



1714
1715
1716
# File 'ec2/cfn_ec2_fleet.rb', line 1714

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



1727
1728
1729
# File 'ec2/cfn_ec2_fleet.rb', line 1727

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



1754
1755
1756
# File 'ec2/cfn_ec2_fleet.rb', line 1754

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



1761
1762
1763
# File 'ec2/cfn_ec2_fleet.rb', line 1761

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



1773
1774
1775
# File 'ec2/cfn_ec2_fleet.rb', line 1773

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



1788
1789
1790
# File 'ec2/cfn_ec2_fleet.rb', line 1788

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



1799
1800
1801
# File 'ec2/cfn_ec2_fleet.rb', line 1799

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



1808
1809
1810
# File 'ec2/cfn_ec2_fleet.rb', line 1808

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 .



1815
1816
1817
# File 'ec2/cfn_ec2_fleet.rb', line 1815

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



1828
1829
1830
# File 'ec2/cfn_ec2_fleet.rb', line 1828

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



1842
1843
1844
# File 'ec2/cfn_ec2_fleet.rb', line 1842

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



1855
1856
1857
# File 'ec2/cfn_ec2_fleet.rb', line 1855

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



1868
1869
1870
# File 'ec2/cfn_ec2_fleet.rb', line 1868

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



1881
1882
1883
# File 'ec2/cfn_ec2_fleet.rb', line 1881

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



1891
1892
1893
# File 'ec2/cfn_ec2_fleet.rb', line 1891

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 .



1904
1905
1906
# File 'ec2/cfn_ec2_fleet.rb', line 1904

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



1911
1912
1913
# File 'ec2/cfn_ec2_fleet.rb', line 1911

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.



1916
1917
1918
# File 'ec2/cfn_ec2_fleet.rb', line 1916

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



1925
1926
1927
# File 'ec2/cfn_ec2_fleet.rb', line 1925

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



1932
1933
1934
# File 'ec2/cfn_ec2_fleet.rb', line 1932

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



1949
1950
1951
# File 'ec2/cfn_ec2_fleet.rb', line 1949

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



1958
1959
1960
# File 'ec2/cfn_ec2_fleet.rb', line 1958

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



1967
1968
1969
# File 'ec2/cfn_ec2_fleet.rb', line 1967

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



1984
1985
1986
# File 'ec2/cfn_ec2_fleet.rb', line 1984

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



1991
1992
1993
# File 'ec2/cfn_ec2_fleet.rb', line 1991

def total_local_storage_gb
  @total_local_storage_gb
end

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

The minimum and maximum number of vCPUs.



1996
1997
1998
# File 'ec2/cfn_ec2_fleet.rb', line 1996

def v_cpu_count
  @v_cpu_count
end

Class Method Details

.jsii_propertiesObject



1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
# File 'ec2/cfn_ec2_fleet.rb', line 1998

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



2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
# File 'ec2/cfn_ec2_fleet.rb', line 2029

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