Class: AWSCDK::EC2::InstanceRequirementsConfig

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

Overview

The attributes for the instance types for a mixed instances policy.

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.

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(memory_min:, v_cpu_count_min:, accelerator_count_max: nil, accelerator_count_min: nil, accelerator_manufacturers: nil, accelerator_names: nil, accelerator_total_memory_max: nil, accelerator_total_memory_min: nil, accelerator_types: nil, allowed_instance_types: nil, bare_metal: nil, baseline_ebs_bandwidth_mbps_max: nil, baseline_ebs_bandwidth_mbps_min: 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_max: nil, memory_per_v_cpu_max: nil, memory_per_v_cpu_min: nil, network_bandwidth_gbps_max: nil, network_bandwidth_gbps_min: nil, network_interface_count_max: nil, network_interface_count_min: nil, on_demand_max_price_percentage_over_lowest_price: nil, require_hibernate_support: nil, spot_max_price_percentage_over_lowest_price: nil, total_local_storage_gb_max: nil, total_local_storage_gb_min: nil, v_cpu_count_max: nil) ⇒ InstanceRequirementsConfig

Returns a new instance of InstanceRequirementsConfig.

Parameters:

  • memory_min (AWSCDK::Size)

    The minimum instance memory size for an instance type, in MiB.

  • v_cpu_count_min (Numeric)

    The minimum number of vCPUs for an instance type.

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

    The maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type.

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

    The minimum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type.

  • accelerator_manufacturers (Array<AWSCDK::EC2::AcceleratorManufacturer>, nil) (defaults to: nil)

    Indicates whether instance types must have accelerators by specific manufacturers.

  • accelerator_names (Array<AWSCDK::EC2::AcceleratorName>, nil) (defaults to: nil)

    Lists the accelerators that must be on an instance type.

  • accelerator_total_memory_max (AWSCDK::Size, nil) (defaults to: nil)

    The maximum total memory size for the accelerators on an instance type, in MiB.

  • accelerator_total_memory_min (AWSCDK::Size, nil) (defaults to: nil)

    The minimum total memory size for the accelerators on an instance type, in MiB.

  • accelerator_types (Array<AWSCDK::EC2::AcceleratorType>, nil) (defaults to: nil)

    Lists the accelerator types that must be on an instance type.

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

    The instance types to apply your specified attributes against.

  • bare_metal (AWSCDK::EC2::BareMetal, nil) (defaults to: nil)

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

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

    The maximum baseline bandwidth performance for an instance type, in Mbps.

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

    The minimum baseline bandwidth performance for an instance type, in Mbps.

  • burstable_performance (AWSCDK::EC2::BurstablePerformance, nil) (defaults to: nil)

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

  • cpu_manufacturers (Array<AWSCDK::EC2::CpuManufacturer>, nil) (defaults to: nil)

    Lists which specific CPU manufacturers to include.

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

    The instance types to exclude.

  • instance_generations (Array<AWSCDK::EC2::InstanceGeneration>, nil) (defaults to: nil)

    Indicates whether current or previous generation instance types are included.

  • local_storage (AWSCDK::EC2::LocalStorage, nil) (defaults to: nil)

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

  • local_storage_types (Array<AWSCDK::EC2::LocalStorageType>, nil) (defaults to: nil)

    Indicates 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_max (AWSCDK::Size, nil) (defaults to: nil)

    The maximum instance memory size for an instance type, in MiB.

  • memory_per_v_cpu_max (AWSCDK::Size, nil) (defaults to: nil)

    The maximum amount of memory per vCPU for an instance type, in GiB.

  • memory_per_v_cpu_min (AWSCDK::Size, nil) (defaults to: nil)

    The minimum amount of memory per vCPU for an instance type, in GiB.

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

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

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

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

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

    The maximum number of network interfaces for an instance type.

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

    The minimum number of network interfaces for an instance type.

  • 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_hibernate_support (Boolean, nil) (defaults to: nil)

    Indicates whether instance types must provide On-Demand Instance hibernation support.

  • 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_max (Numeric, nil) (defaults to: nil)

    The maximum total local storage size for an instance type, in GB.

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

    The minimum total local storage size for an instance type, in GB.

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

    The maximum number of vCPUs for an instance type.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'ec2/instance_requirements_config.rb', line 49

def initialize(memory_min:, v_cpu_count_min:, accelerator_count_max: nil, accelerator_count_min: nil, accelerator_manufacturers: nil, accelerator_names: nil, accelerator_total_memory_max: nil, accelerator_total_memory_min: nil, accelerator_types: nil, allowed_instance_types: nil, bare_metal: nil, baseline_ebs_bandwidth_mbps_max: nil, baseline_ebs_bandwidth_mbps_min: 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_max: nil, memory_per_v_cpu_max: nil, memory_per_v_cpu_min: nil, network_bandwidth_gbps_max: nil, network_bandwidth_gbps_min: nil, network_interface_count_max: nil, network_interface_count_min: nil, on_demand_max_price_percentage_over_lowest_price: nil, require_hibernate_support: nil, spot_max_price_percentage_over_lowest_price: nil, total_local_storage_gb_max: nil, total_local_storage_gb_min: nil, v_cpu_count_max: nil)
  @memory_min = memory_min
  Jsii::Type.check_type(@memory_min, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "memoryMin")
  @v_cpu_count_min = v_cpu_count_min
  Jsii::Type.check_type(@v_cpu_count_min, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "vCpuCountMin")
  @accelerator_count_max = accelerator_count_max
  Jsii::Type.check_type(@accelerator_count_max, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "acceleratorCountMax") unless @accelerator_count_max.nil?
  @accelerator_count_min = accelerator_count_min
  Jsii::Type.check_type(@accelerator_count_min, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "acceleratorCountMin") unless @accelerator_count_min.nil?
  @accelerator_manufacturers = accelerator_manufacturers
  Jsii::Type.check_type(@accelerator_manufacturers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQWNjZWxlcmF0b3JNYW51ZmFjdHVyZXIifSwia2luZCI6ImFycmF5In19")), "acceleratorManufacturers") unless @accelerator_manufacturers.nil?
  @accelerator_names = accelerator_names
  Jsii::Type.check_type(@accelerator_names, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQWNjZWxlcmF0b3JOYW1lIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "acceleratorNames") unless @accelerator_names.nil?
  @accelerator_total_memory_max = accelerator_total_memory_max
  Jsii::Type.check_type(@accelerator_total_memory_max, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "acceleratorTotalMemoryMax") unless @accelerator_total_memory_max.nil?
  @accelerator_total_memory_min = accelerator_total_memory_min
  Jsii::Type.check_type(@accelerator_total_memory_min, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "acceleratorTotalMemoryMin") unless @accelerator_total_memory_min.nil?
  @accelerator_types = accelerator_types
  Jsii::Type.check_type(@accelerator_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQWNjZWxlcmF0b3JUeXBlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkJhcmVNZXRhbCJ9")), "bareMetal") unless @bare_metal.nil?
  @baseline_ebs_bandwidth_mbps_max = baseline_ebs_bandwidth_mbps_max
  Jsii::Type.check_type(@baseline_ebs_bandwidth_mbps_max, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "baselineEbsBandwidthMbpsMax") unless @baseline_ebs_bandwidth_mbps_max.nil?
  @baseline_ebs_bandwidth_mbps_min = baseline_ebs_bandwidth_mbps_min
  Jsii::Type.check_type(@baseline_ebs_bandwidth_mbps_min, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "baselineEbsBandwidthMbpsMin") unless @baseline_ebs_bandwidth_mbps_min.nil?
  @burstable_performance = burstable_performance
  Jsii::Type.check_type(@burstable_performance, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkJ1cnN0YWJsZVBlcmZvcm1hbmNlIn0=")), "burstablePerformance") unless @burstable_performance.nil?
  @cpu_manufacturers = cpu_manufacturers
  Jsii::Type.check_type(@cpu_manufacturers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuQ3B1TWFudWZhY3R1cmVyIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "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("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSW5zdGFuY2VHZW5lcmF0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "instanceGenerations") unless @instance_generations.nil?
  @local_storage = local_storage
  Jsii::Type.check_type(@local_storage, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkxvY2FsU3RvcmFnZSJ9")), "localStorage") unless @local_storage.nil?
  @local_storage_types = local_storage_types
  Jsii::Type.check_type(@local_storage_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuTG9jYWxTdG9yYWdlVHlwZSJ9LCJraW5kIjoiYXJyYXkifX0=")), "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_max = memory_max
  Jsii::Type.check_type(@memory_max, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "memoryMax") unless @memory_max.nil?
  @memory_per_v_cpu_max = memory_per_v_cpu_max
  Jsii::Type.check_type(@memory_per_v_cpu_max, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "memoryPerVCpuMax") unless @memory_per_v_cpu_max.nil?
  @memory_per_v_cpu_min = memory_per_v_cpu_min
  Jsii::Type.check_type(@memory_per_v_cpu_min, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "memoryPerVCpuMin") unless @memory_per_v_cpu_min.nil?
  @network_bandwidth_gbps_max = network_bandwidth_gbps_max
  Jsii::Type.check_type(@network_bandwidth_gbps_max, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "networkBandwidthGbpsMax") unless @network_bandwidth_gbps_max.nil?
  @network_bandwidth_gbps_min = network_bandwidth_gbps_min
  Jsii::Type.check_type(@network_bandwidth_gbps_min, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "networkBandwidthGbpsMin") unless @network_bandwidth_gbps_min.nil?
  @network_interface_count_max = network_interface_count_max
  Jsii::Type.check_type(@network_interface_count_max, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "networkInterfaceCountMax") unless @network_interface_count_max.nil?
  @network_interface_count_min = network_interface_count_min
  Jsii::Type.check_type(@network_interface_count_min, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "networkInterfaceCountMin") unless @network_interface_count_min.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_hibernate_support = require_hibernate_support
  Jsii::Type.check_type(@require_hibernate_support, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "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_max = total_local_storage_gb_max
  Jsii::Type.check_type(@total_local_storage_gb_max, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "totalLocalStorageGBMax") unless @total_local_storage_gb_max.nil?
  @total_local_storage_gb_min = total_local_storage_gb_min
  Jsii::Type.check_type(@total_local_storage_gb_min, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "totalLocalStorageGBMin") unless @total_local_storage_gb_min.nil?
  @v_cpu_count_max = v_cpu_count_max
  Jsii::Type.check_type(@v_cpu_count_max, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "vCpuCountMax") unless @v_cpu_count_max.nil?
end

Instance Attribute Details

#accelerator_count_maxNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type.

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

Returns:

  • (Numeric, nil)


136
137
138
# File 'ec2/instance_requirements_config.rb', line 136

def accelerator_count_max
  @accelerator_count_max
end

#accelerator_count_minNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The minimum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type.

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

Returns:

  • (Numeric, nil)


143
144
145
# File 'ec2/instance_requirements_config.rb', line 143

def accelerator_count_min
  @accelerator_count_min
end

#accelerator_manufacturersArray<AWSCDK::EC2::AcceleratorManufacturer>? (readonly)

Note:

Default: - Any manufacturer

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 AWS devices, specify amazon-web-services.
  • For instance types with Xilinx devices, specify xilinx.

Returns:



153
154
155
# File 'ec2/instance_requirements_config.rb', line 153

def accelerator_manufacturers
  @accelerator_manufacturers
end

#accelerator_namesArray<AWSCDK::EC2::AcceleratorName>? (readonly)

Note:

Default: - Any accelerator

Lists the accelerators that must be on an 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.

Returns:



166
167
168
# File 'ec2/instance_requirements_config.rb', line 166

def accelerator_names
  @accelerator_names
end

#accelerator_total_memory_maxAWSCDK::Size? (readonly)

Note:

Default: - No minimum or maximum limits

The maximum total memory size for the accelerators on an instance type, in MiB.

Returns:



171
172
173
# File 'ec2/instance_requirements_config.rb', line 171

def accelerator_total_memory_max
  @accelerator_total_memory_max
end

#accelerator_total_memory_minAWSCDK::Size? (readonly)

Note:

Default: - No minimum or maximum limits

The minimum total memory size for the accelerators on an instance type, in MiB.

Returns:



176
177
178
# File 'ec2/instance_requirements_config.rb', line 176

def accelerator_total_memory_min
  @accelerator_total_memory_min
end

#accelerator_typesArray<AWSCDK::EC2::AcceleratorType>? (readonly)

Note:

Default: - Any accelerator type

Lists the accelerator types that must be on an 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.

Returns:



185
186
187
# File 'ec2/instance_requirements_config.rb', line 185

def accelerator_types
  @accelerator_types
end

#allowed_instance_typesArray<String>? (readonly)

Note:

Default: - All instance types

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 Auto Scaling will allow the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.*, Amazon EC2 Auto Scaling will allow all the M5a instance types, but not the M5n instance types.

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

Returns:

  • (Array<String>, nil)


198
199
200
# File 'ec2/instance_requirements_config.rb', line 198

def allowed_instance_types
  @allowed_instance_types
end

#bare_metalAWSCDK::EC2::BareMetal? (readonly)

Note:

Default: - excluded

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

Returns:



203
204
205
# File 'ec2/instance_requirements_config.rb', line 203

def bare_metal
  @bare_metal
end

#baseline_ebs_bandwidth_mbps_maxNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The maximum baseline bandwidth performance for an instance type, in Mbps.

For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide.

Returns:

  • (Numeric, nil)


210
211
212
# File 'ec2/instance_requirements_config.rb', line 210

def baseline_ebs_bandwidth_mbps_max
  @baseline_ebs_bandwidth_mbps_max
end

#baseline_ebs_bandwidth_mbps_minNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The minimum baseline bandwidth performance for an instance type, in Mbps.

For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide.

Returns:

  • (Numeric, nil)


217
218
219
# File 'ec2/instance_requirements_config.rb', line 217

def baseline_ebs_bandwidth_mbps_min
  @baseline_ebs_bandwidth_mbps_min
end

#burstable_performanceAWSCDK::EC2::BurstablePerformance? (readonly)

Note:

Default: - excluded

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

For more information, see Burstable performance instances in the Amazon EC2 User Guide.



224
225
226
# File 'ec2/instance_requirements_config.rb', line 224

def burstable_performance
  @burstable_performance
end

#cpu_manufacturersArray<AWSCDK::EC2::CpuManufacturer>? (readonly)

Note:

Default: - Any manufacturer

Lists which specific 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.

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

Returns:



236
237
238
# File 'ec2/instance_requirements_config.rb', line 236

def cpu_manufacturers
  @cpu_manufacturers
end

#excluded_instance_typesArray<String>? (readonly)

Note:

Default: - No excluded instance types

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*, you are excluding the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.*, Amazon EC2 Auto Scaling will exclude all the M5a instance types, but not the M5n instance types.

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

Returns:

  • (Array<String>, nil)


247
248
249
# File 'ec2/instance_requirements_config.rb', line 247

def excluded_instance_types
  @excluded_instance_types
end

#instance_generationsArray<AWSCDK::EC2::InstanceGeneration>? (readonly)

Note:

Default: - Any current or previous generation

Indicates whether current or previous generation instance types are included.

  • For current generation instance types, specify current. The current generation includes EC2 instance types currently recommended for use. This typically includes the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide.
  • For previous generation instance types, specify previous.

Returns:



255
256
257
# File 'ec2/instance_requirements_config.rb', line 255

def instance_generations
  @instance_generations
end

#local_storageAWSCDK::EC2::LocalStorage? (readonly)

Note:

Default: - included

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

For more information, see Amazon EC2 instance store in the Amazon EC2 User Guide.

Returns:



262
263
264
# File 'ec2/instance_requirements_config.rb', line 262

def local_storage
  @local_storage
end

#local_storage_typesArray<AWSCDK::EC2::LocalStorageType>? (readonly)

Note:

Default: - Any local storage type

Indicates 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.

Returns:



270
271
272
# File 'ec2/instance_requirements_config.rb', line 270

def local_storage_types
  @local_storage_types
end

#max_spot_price_as_percentage_of_optimal_on_demand_priceNumeric? (readonly)

Note:

Default: - Automatic optimal price protection

[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 either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.

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

If you set DesiredCapacityType 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.

Note: Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't specify either, Amazon EC2 Auto Scaling 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.

Returns:

  • (Numeric, nil)


283
284
285
# File 'ec2/instance_requirements_config.rb', line 283

def max_spot_price_as_percentage_of_optimal_on_demand_price
  @max_spot_price_as_percentage_of_optimal_on_demand_price
end

#memory_maxAWSCDK::Size? (readonly)

Note:

Default: - No maximum limit

The maximum instance memory size for an instance type, in MiB.

Returns:



288
289
290
# File 'ec2/instance_requirements_config.rb', line 288

def memory_max
  @memory_max
end

#memory_minAWSCDK::Size (readonly)

The minimum instance memory size for an instance type, in MiB.

Required: Yes

Returns:



123
124
125
# File 'ec2/instance_requirements_config.rb', line 123

def memory_min
  @memory_min
end

#memory_per_v_cpu_maxAWSCDK::Size? (readonly)

Note:

Default: - No minimum or maximum limits

The maximum amount of memory per vCPU for an instance type, in GiB.

Returns:



293
294
295
# File 'ec2/instance_requirements_config.rb', line 293

def memory_per_v_cpu_max
  @memory_per_v_cpu_max
end

#memory_per_v_cpu_minAWSCDK::Size? (readonly)

Note:

Default: - No minimum or maximum limits

The minimum amount of memory per vCPU for an instance type, in GiB.

Returns:



298
299
300
# File 'ec2/instance_requirements_config.rb', line 298

def memory_per_v_cpu_min
  @memory_per_v_cpu_min
end

#network_bandwidth_gbps_maxNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

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

Returns:

  • (Numeric, nil)


303
304
305
# File 'ec2/instance_requirements_config.rb', line 303

def network_bandwidth_gbps_max
  @network_bandwidth_gbps_max
end

#network_bandwidth_gbps_minNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

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

Returns:

  • (Numeric, nil)


308
309
310
# File 'ec2/instance_requirements_config.rb', line 308

def network_bandwidth_gbps_min
  @network_bandwidth_gbps_min
end

#network_interface_count_maxNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The maximum number of network interfaces for an instance type.

Returns:

  • (Numeric, nil)


313
314
315
# File 'ec2/instance_requirements_config.rb', line 313

def network_interface_count_max
  @network_interface_count_max
end

#network_interface_count_minNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The minimum number of network interfaces for an instance type.

Returns:

  • (Numeric, nil)


318
319
320
# File 'ec2/instance_requirements_config.rb', line 318

def network_interface_count_min
  @network_interface_count_min
end

#on_demand_max_price_percentage_over_lowest_priceNumeric? (readonly)

Note:

Default: - 20

[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. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.

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

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

If you set DesiredCapacityType 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.

Returns:

  • (Numeric, nil)


331
332
333
# File 'ec2/instance_requirements_config.rb', line 331

def on_demand_max_price_percentage_over_lowest_price
  @on_demand_max_price_percentage_over_lowest_price
end

#require_hibernate_supportBoolean? (readonly)

Note:

Default: - false

Indicates whether instance types must provide On-Demand Instance hibernation support.

Returns:

  • (Boolean, nil)


336
337
338
# File 'ec2/instance_requirements_config.rb', line 336

def require_hibernate_support
  @require_hibernate_support
end

#spot_max_price_percentage_over_lowest_priceNumeric? (readonly)

Note:

Default: - Automatic optimal price protection

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

The identified Spot price is the price of the lowest priced current generation C, M, or R instance type with your specified attributes. If no current generation C, M, or R instance type matches your attributes, then the identified price is from either the lowest priced current generation instance types or, failing that, the lowest priced previous generation instance types that match your attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.

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

If you set DesiredCapacityType 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.

Note: Only one of SpotMaxPricePercentageOverLowestPrice or MaxSpotPriceAsPercentageOfOptimalOnDemandPrice can be specified. If you don't specify either, Amazon EC2 Auto Scaling 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.

Returns:

  • (Numeric, nil)


349
350
351
# File 'ec2/instance_requirements_config.rb', line 349

def spot_max_price_percentage_over_lowest_price
  @spot_max_price_percentage_over_lowest_price
end

#total_local_storage_gb_maxNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The maximum total local storage size for an instance type, in GB.

Returns:

  • (Numeric, nil)


354
355
356
# File 'ec2/instance_requirements_config.rb', line 354

def total_local_storage_gb_max
  @total_local_storage_gb_max
end

#total_local_storage_gb_minNumeric? (readonly)

Note:

Default: - No minimum or maximum limits

The minimum total local storage size for an instance type, in GB.

Returns:

  • (Numeric, nil)


359
360
361
# File 'ec2/instance_requirements_config.rb', line 359

def total_local_storage_gb_min
  @total_local_storage_gb_min
end

#v_cpu_count_maxNumeric? (readonly)

Note:

Default: - No maximum limit

The maximum number of vCPUs for an instance type.

Returns:

  • (Numeric, nil)


364
365
366
# File 'ec2/instance_requirements_config.rb', line 364

def v_cpu_count_max
  @v_cpu_count_max
end

#v_cpu_count_minNumeric (readonly)

The minimum number of vCPUs for an instance type.

Required: Yes

Returns:

  • (Numeric)


129
130
131
# File 'ec2/instance_requirements_config.rb', line 129

def v_cpu_count_min
  @v_cpu_count_min
end

Class Method Details

.jsii_propertiesObject



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'ec2/instance_requirements_config.rb', line 366

def self.jsii_properties
  {
    :memory_min => "memoryMin",
    :v_cpu_count_min => "vCpuCountMin",
    :accelerator_count_max => "acceleratorCountMax",
    :accelerator_count_min => "acceleratorCountMin",
    :accelerator_manufacturers => "acceleratorManufacturers",
    :accelerator_names => "acceleratorNames",
    :accelerator_total_memory_max => "acceleratorTotalMemoryMax",
    :accelerator_total_memory_min => "acceleratorTotalMemoryMin",
    :accelerator_types => "acceleratorTypes",
    :allowed_instance_types => "allowedInstanceTypes",
    :bare_metal => "bareMetal",
    :baseline_ebs_bandwidth_mbps_max => "baselineEbsBandwidthMbpsMax",
    :baseline_ebs_bandwidth_mbps_min => "baselineEbsBandwidthMbpsMin",
    :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_max => "memoryMax",
    :memory_per_v_cpu_max => "memoryPerVCpuMax",
    :memory_per_v_cpu_min => "memoryPerVCpuMin",
    :network_bandwidth_gbps_max => "networkBandwidthGbpsMax",
    :network_bandwidth_gbps_min => "networkBandwidthGbpsMin",
    :network_interface_count_max => "networkInterfaceCountMax",
    :network_interface_count_min => "networkInterfaceCountMin",
    :on_demand_max_price_percentage_over_lowest_price => "onDemandMaxPricePercentageOverLowestPrice",
    :require_hibernate_support => "requireHibernateSupport",
    :spot_max_price_percentage_over_lowest_price => "spotMaxPricePercentageOverLowestPrice",
    :total_local_storage_gb_max => "totalLocalStorageGBMax",
    :total_local_storage_gb_min => "totalLocalStorageGBMin",
    :v_cpu_count_max => "vCpuCountMax",
  }
end

Instance Method Details

#to_jsiiObject



404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'ec2/instance_requirements_config.rb', line 404

def to_jsii
  result = {}
  result.merge!({
    "memoryMin" => @memory_min,
    "vCpuCountMin" => @v_cpu_count_min,
    "acceleratorCountMax" => @accelerator_count_max,
    "acceleratorCountMin" => @accelerator_count_min,
    "acceleratorManufacturers" => @accelerator_manufacturers,
    "acceleratorNames" => @accelerator_names,
    "acceleratorTotalMemoryMax" => @accelerator_total_memory_max,
    "acceleratorTotalMemoryMin" => @accelerator_total_memory_min,
    "acceleratorTypes" => @accelerator_types,
    "allowedInstanceTypes" => @allowed_instance_types,
    "bareMetal" => @bare_metal,
    "baselineEbsBandwidthMbpsMax" => @baseline_ebs_bandwidth_mbps_max,
    "baselineEbsBandwidthMbpsMin" => @baseline_ebs_bandwidth_mbps_min,
    "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,
    "memoryMax" => @memory_max,
    "memoryPerVCpuMax" => @memory_per_v_cpu_max,
    "memoryPerVCpuMin" => @memory_per_v_cpu_min,
    "networkBandwidthGbpsMax" => @network_bandwidth_gbps_max,
    "networkBandwidthGbpsMin" => @network_bandwidth_gbps_min,
    "networkInterfaceCountMax" => @network_interface_count_max,
    "networkInterfaceCountMin" => @network_interface_count_min,
    "onDemandMaxPricePercentageOverLowestPrice" => @on_demand_max_price_percentage_over_lowest_price,
    "requireHibernateSupport" => @require_hibernate_support,
    "spotMaxPricePercentageOverLowestPrice" => @spot_max_price_percentage_over_lowest_price,
    "totalLocalStorageGBMax" => @total_local_storage_gb_max,
    "totalLocalStorageGBMin" => @total_local_storage_gb_min,
    "vCpuCountMax" => @v_cpu_count_max,
  })
  result.compact
end