InstanceRequirementsRequestProperty Struct
The instance requirements for attribute-based instance type selection.
Instead of specifying exact instance types, you define requirements such as vCPU count, memory size, network performance, and accelerator specifications. Amazon ECS automatically selects Amazon EC2 instance types that match these requirements, providing flexibility and helping to mitigate capacity constraints.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const instanceRequirementsRequestProperty: ecs.CfnCapacityProvider.InstanceRequirementsRequestProperty = {
memoryMiB: {
min: 123,
// the properties below are optional
max: 123,
},
vCpuCount: {
min: 123,
// the properties below are optional
max: 123,
},
// the properties below are optional
acceleratorCount: {
max: 123,
min: 123,
},
acceleratorManufacturers: ['acceleratorManufacturers'],
acceleratorNames: ['acceleratorNames'],
acceleratorTotalMemoryMiB: {
max: 123,
min: 123,
},
acceleratorTypes: ['acceleratorTypes'],
allowedInstanceTypes: ['allowedInstanceTypes'],
bareMetal: 'bareMetal',
baselineEbsBandwidthMbps: {
max: 123,
min: 123,
},
burstablePerformance: 'burstablePerformance',
cpuManufacturers: ['cpuManufacturers'],
excludedInstanceTypes: ['excludedInstanceTypes'],
instanceGenerations: ['instanceGenerations'],
localStorage: 'localStorage',
localStorageTypes: ['localStorageTypes'],
maxSpotPriceAsPercentageOfOptimalOnDemandPrice: 123,
memoryGiBPerVCpu: {
max: 123,
min: 123,
},
networkBandwidthGbps: {
max: 123,
min: 123,
},
networkInterfaceCount: {
max: 123,
min: 123,
},
onDemandMaxPricePercentageOverLowestPrice: 123,
requireHibernateSupport: false,
spotMaxPricePercentageOverLowestPrice: 123,
totalLocalStorageGb: {
max: 123,
min: 123,
},
};
Properties
acceleratorCountoptionalIResolvable | CfnCapacityProvider.AcceleratorCountRequestPropertyaccelerator_countoptionaltyping.Union[IResolvable, AcceleratorCountRequestProperty]acceleratorCountoptionalIResolvableAcceleratorCountoptionalIResolvableAcceleratorCountoptionalinterface{}#This is used when you need instances with specific numbers of GPUs or other accelerators.
acceleratorManufacturersoptionalstring[]accelerator_manufacturersoptionaltyping.List[str]acceleratorManufacturersoptionalList<String>AcceleratorManufacturersoptionalstring[]AcceleratorManufacturersoptional*[]*string#You can specify nvidia , amd , amazon-web-services , or xilinx depending on your accelerator requirements.
acceleratorNamesoptionalstring[]accelerator_namesoptionaltyping.List[str]acceleratorNamesoptionalList<String>AcceleratorNamesoptionalstring[]AcceleratorNamesoptional*[]*string#For example, you can specify a100 , v100 , k80 , or other specific accelerator models.
acceleratorTotalMemoryMiBoptionalIResolvable | CfnCapacityProvider.AcceleratorTotalMemoryMiBRequestPropertyaccelerator_total_memory_mi_boptionaltyping.Union[IResolvable, AcceleratorTotalMemoryMiBRequestProperty]acceleratorTotalMemoryMiBoptionalIResolvableAcceleratorTotalMemoryMiBoptionalIResolvableAcceleratorTotalMemoryMiBoptionalinterface{}#This is important for GPU workloads that require specific amounts of video memory.
acceleratorTypesoptionalstring[]accelerator_typesoptionaltyping.List[str]acceleratorTypesoptionalList<String>AcceleratorTypesoptionalstring[]AcceleratorTypesoptional*[]*string#You can specify gpu for graphics processing units, fpga for field programmable gate arrays, or inference for machine learning inference accelerators.
allowedInstanceTypesoptionalstring[]allowed_instance_typesoptionaltyping.List[str]allowedInstanceTypesoptionalList<String>AllowedInstanceTypesoptionalstring[]AllowedInstanceTypesoptional*[]*string#When specified, Amazon ECS only considers these instance types, subject to the other requirements specified.
bareMetaloptionalstringbare_metaloptionalstrbareMetaloptionalStringBareMetaloptionalstringBareMetaloptional*string#Set to included to allow bare metal instances, excluded to exclude them, or required to use only bare metal instances.
baselineEbsBandwidthMbpsoptionalIResolvable | CfnCapacityProvider.BaselineEbsBandwidthMbpsRequestPropertybaseline_ebs_bandwidth_mbpsoptionaltyping.Union[IResolvable, BaselineEbsBandwidthMbpsRequestProperty]baselineEbsBandwidthMbpsoptionalIResolvableBaselineEbsBandwidthMbpsoptionalIResolvableBaselineEbsBandwidthMbpsoptionalinterface{}#This is important for workloads with high storage I/O requirements.
burstablePerformanceoptionalstringburstable_performanceoptionalstrburstablePerformanceoptionalStringBurstablePerformanceoptionalstringBurstablePerformanceoptional*string#Set to included to allow burstable instances, excluded to exclude them, or required to use only burstable instances.
cpuManufacturersoptionalstring[]cpu_manufacturersoptionaltyping.List[str]cpuManufacturersoptionalList<String>CpuManufacturersoptionalstring[]CpuManufacturersoptional*[]*string#You can specify intel , amd , or amazon-web-services to control which CPU types are used for your workloads.
excludedInstanceTypesoptionalstring[]excluded_instance_typesoptionaltyping.List[str]excludedInstanceTypesoptionalList<String>ExcludedInstanceTypesoptionalstring[]ExcludedInstanceTypesoptional*[]*string#Use this to prevent Amazon ECS from selecting specific instance types that may not be suitable for your workloads.
instanceGenerationsoptionalstring[]instance_generationsoptionaltyping.List[str]instanceGenerationsoptionalList<String>InstanceGenerationsoptionalstring[]InstanceGenerationsoptional*[]*string#You can specify current to use the latest generation instances, or previous to include previous generation instances for cost optimization.
localStorageoptionalstringlocal_storageoptionalstrlocalStorageoptionalStringLocalStorageoptionalstringLocalStorageoptional*string#Set to included to allow local storage, excluded to exclude it, or required to use only instances with local storage.
localStorageTypesoptionalstring[]local_storage_typesoptionaltyping.List[str]localStorageTypesoptionalList<String>LocalStorageTypesoptionalstring[]LocalStorageTypesoptional*[]*string#You can specify hdd for hard disk drives, ssd for solid state drives, or both.
maxSpotPriceAsPercentageOfOptimalOnDemandPriceoptionalnumbermax_spot_price_as_percentage_of_optimal_on_demand_priceoptionalint | floatmaxSpotPriceAsPercentageOfOptimalOnDemandPriceoptionalNumberMaxSpotPriceAsPercentageOfOptimalOnDemandPriceoptionaldoubleMaxSpotPriceAsPercentageOfOptimalOnDemandPriceoptional*float64#This provides more precise cost control for Spot instance selection.
memoryGiBPerVCpuoptionalIResolvable | CfnCapacityProvider.MemoryGiBPerVCpuRequestPropertymemory_gi_b_per_v_cpuoptionaltyping.Union[IResolvable, MemoryGiBPerVCpuRequestProperty]memoryGiBPerVCpuoptionalIResolvableMemoryGiBPerVCpuoptionalIResolvableMemoryGiBPerVCpuoptionalinterface{}#This helps ensure that instance types have the appropriate memory-to-CPU ratio for your workloads.
memoryMiBIResolvable | CfnCapacityProvider.MemoryMiBRequestPropertymemory_mi_btyping.Union[IResolvable, MemoryMiBRequestProperty]memoryMiBIResolvableMemoryMiBIResolvableMemoryMiBinterface{}required#Amazon ECS selects instance types that have memory within this range.
networkBandwidthGbpsoptionalIResolvable | CfnCapacityProvider.NetworkBandwidthGbpsRequestPropertynetwork_bandwidth_gbpsoptionaltyping.Union[IResolvable, NetworkBandwidthGbpsRequestProperty]networkBandwidthGbpsoptionalIResolvableNetworkBandwidthGbpsoptionalIResolvableNetworkBandwidthGbpsoptionalinterface{}#This is crucial for network-intensive workloads that require high throughput.
networkInterfaceCountoptionalIResolvable | CfnCapacityProvider.NetworkInterfaceCountRequestPropertynetwork_interface_countoptionaltyping.Union[IResolvable, NetworkInterfaceCountRequestProperty]networkInterfaceCountoptionalIResolvableNetworkInterfaceCountoptionalIResolvableNetworkInterfaceCountoptionalinterface{}#This is useful for workloads that require multiple network interfaces.
onDemandMaxPricePercentageOverLowestPriceoptionalnumberon_demand_max_price_percentage_over_lowest_priceoptionalint | floatonDemandMaxPricePercentageOverLowestPriceoptionalNumberOnDemandMaxPricePercentageOverLowestPriceoptionaldoubleOnDemandMaxPricePercentageOverLowestPriceoptional*float64#notes
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 ECS selects instance types with your attributes, we will exclude instance types whose price exceeds your specified threshold.
requireHibernateSupportoptionalboolean | IResolvablerequire_hibernate_supportoptionaltyping.Union[bool, IResolvable]requireHibernateSupportoptionalBooleanRequireHibernateSupportoptionalboolRequireHibernateSupportoptionalinterface{}#When set to true , only instance types that support hibernation are selected.
spotMaxPricePercentageOverLowestPriceoptionalnumberspot_max_price_percentage_over_lowest_priceoptionalint | floatspotMaxPricePercentageOverLowestPriceoptionalNumberSpotMaxPricePercentageOverLowestPriceoptionaldoubleSpotMaxPricePercentageOverLowestPriceoptional*float64#This helps control Spot instance costs while maintaining access to capacity.
totalLocalStorageGboptionalIResolvable | CfnCapacityProvider.TotalLocalStorageGBRequestPropertytotal_local_storage_gboptionaltyping.Union[IResolvable, TotalLocalStorageGBRequestProperty]totalLocalStorageGboptionalIResolvableTotalLocalStorageGboptionalIResolvableTotalLocalStorageGboptionalinterface{}#vCpuCountIResolvable | CfnCapacityProvider.VCpuCountRangeRequestPropertyv_cpu_counttyping.Union[IResolvable, VCpuCountRangeRequestProperty]vCpuCountIResolvableVCpuCountIResolvableVCpuCountinterface{}required#Amazon ECS selects instance types that have vCPU counts within this range.