public static interface CfnSpotFleet.InstanceRequirementsRequestProperty
When you specify instance attributes, Amazon EC2 will identify instance types with these attributes.
When you specify multiple attributes, you get instance types that satisfy all of the specified attributes. If you specify multiple values for an attribute, you get instance types that satisfy any of the specified values.
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.
You must specify
VCpuCount
andMemoryMiB
. All other attributes are optional. Any unspecified optional attribute is set to its default.
For more information, see Attribute-based instance type selection for EC2 Fleet , Attribute-based instance type selection for Spot Fleet , and Spot placement score in the Amazon EC2 User Guide .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.ec2.*; InstanceRequirementsRequestProperty instanceRequirementsRequestProperty = InstanceRequirementsRequestProperty.builder() .acceleratorCount(AcceleratorCountRequestProperty.builder() .max(123) .min(123) .build()) .acceleratorManufacturers(List.of("acceleratorManufacturers")) .acceleratorNames(List.of("acceleratorNames")) .acceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBRequestProperty.builder() .max(123) .min(123) .build()) .acceleratorTypes(List.of("acceleratorTypes")) .allowedInstanceTypes(List.of("allowedInstanceTypes")) .bareMetal("bareMetal") .baselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsRequestProperty.builder() .max(123) .min(123) .build()) .burstablePerformance("burstablePerformance") .cpuManufacturers(List.of("cpuManufacturers")) .excludedInstanceTypes(List.of("excludedInstanceTypes")) .instanceGenerations(List.of("instanceGenerations")) .localStorage("localStorage") .localStorageTypes(List.of("localStorageTypes")) .memoryGiBPerVCpu(MemoryGiBPerVCpuRequestProperty.builder() .max(123) .min(123) .build()) .memoryMiB(MemoryMiBRequestProperty.builder() .max(123) .min(123) .build()) .networkBandwidthGbps(NetworkBandwidthGbpsRequestProperty.builder() .max(123) .min(123) .build()) .networkInterfaceCount(NetworkInterfaceCountRequestProperty.builder() .max(123) .min(123) .build()) .onDemandMaxPricePercentageOverLowestPrice(123) .requireHibernateSupport(false) .spotMaxPricePercentageOverLowestPrice(123) .totalLocalStorageGb(TotalLocalStorageGBRequestProperty.builder() .max(123) .min(123) .build()) .vCpuCount(VCpuCountRangeRequestProperty.builder() .max(123) .min(123) .build()) .build();
Modifier and Type | Interface and Description |
---|---|
static class |
CfnSpotFleet.InstanceRequirementsRequestProperty.Builder
A builder for
CfnSpotFleet.InstanceRequirementsRequestProperty |
static class |
CfnSpotFleet.InstanceRequirementsRequestProperty.Jsii$Proxy
An implementation for
CfnSpotFleet.InstanceRequirementsRequestProperty |
Modifier and Type | Method and Description |
---|---|
static CfnSpotFleet.InstanceRequirementsRequestProperty.Builder |
builder() |
default java.lang.Object |
getAcceleratorCount()
The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.
|
default java.util.List<java.lang.String> |
getAcceleratorManufacturers()
Indicates whether instance types must have accelerators by specific manufacturers.
|
default java.util.List<java.lang.String> |
getAcceleratorNames()
The accelerators that must be on the instance type.
|
default java.lang.Object |
getAcceleratorTotalMemoryMiB()
The minimum and maximum amount of total accelerator memory, in MiB.
|
default java.util.List<java.lang.String> |
getAcceleratorTypes()
The accelerator types that must be on the instance type.
|
default java.util.List<java.lang.String> |
getAllowedInstanceTypes()
The instance types to apply your specified attributes against.
|
default java.lang.String |
getBareMetal()
Indicates whether bare metal instance types must be included, excluded, or required.
|
default java.lang.Object |
getBaselineEbsBandwidthMbps()
The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.
|
default java.lang.String |
getBurstablePerformance()
Indicates whether burstable performance T instance types are included, excluded, or required.
|
default java.util.List<java.lang.String> |
getCpuManufacturers()
The CPU manufacturers to include.
|
default java.util.List<java.lang.String> |
getExcludedInstanceTypes()
The instance types to exclude.
|
default java.util.List<java.lang.String> |
getInstanceGenerations()
Indicates whether current or previous generation instance types are included.
|
default java.lang.String |
getLocalStorage()
Indicates whether instance types with instance store volumes are included, excluded, or required.
|
default java.util.List<java.lang.String> |
getLocalStorageTypes()
The type of local storage that is required.
|
default java.lang.Object |
getMemoryGiBPerVCpu()
The minimum and maximum amount of memory per vCPU, in GiB.
|
default java.lang.Object |
getMemoryMiB()
The minimum and maximum amount of memory, in MiB.
|
default java.lang.Object |
getNetworkBandwidthGbps()
The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).
|
default java.lang.Object |
getNetworkInterfaceCount()
The minimum and maximum number of network interfaces.
|
default java.lang.Number |
getOnDemandMaxPricePercentageOverLowestPrice()
The price protection threshold for On-Demand Instances.
|
default java.lang.Object |
getRequireHibernateSupport()
Indicates whether instance types must support hibernation for On-Demand Instances.
|
default java.lang.Number |
getSpotMaxPricePercentageOverLowestPrice()
The price protection threshold for Spot Instance.
|
default java.lang.Object |
getTotalLocalStorageGb()
The minimum and maximum amount of total local storage, in GB.
|
default java.lang.Object |
getVCpuCount()
The minimum and maximum number of vCPUs.
|
default java.lang.Object getAcceleratorCount()
To exclude accelerator-enabled instance types, set Max
to 0
.
Default: No minimum or maximum limits
default java.util.List<java.lang.String> getAcceleratorManufacturers()
nvidia
.amd
.amazon-web-services
.xilinx
.Default: Any manufacturer
default java.util.List<java.lang.String> getAcceleratorNames()
a100
.v100
.k80
.t4
.m60
.radeon-pro-v520
.vu9p
.inferentia
.k520
.Default: Any accelerator
default java.lang.Object getAcceleratorTotalMemoryMiB()
Default: No minimum or maximum limits
default java.util.List<java.lang.String> getAcceleratorTypes()
gpu
.fpga
.inference
.Default: Any accelerator type
default java.util.List<java.lang.String> getAllowedInstanceTypes()
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 specifyExcludedInstanceTypes
.
Default: All instance types
default java.lang.String getBareMetal()
included
.required
.excluded
.
Default: excluded
default java.lang.Object getBaselineEbsBandwidthMbps()
For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide .
Default: No minimum or maximum limits
default java.lang.String getBurstablePerformance()
For more information, see Burstable performance instances .
included
.required
.excluded
.
Default: excluded
default java.util.List<java.lang.String> getCpuManufacturers()
intel
.amd
.amazon-web-services
.
Don't confuse the CPU manufacturer with the CPU architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template.
Default: Any manufacturer
default java.util.List<java.lang.String> getExcludedInstanceTypes()
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 specifyAllowedInstanceTypes
.
Default: No excluded instance types
default java.util.List<java.lang.String> getInstanceGenerations()
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
default java.lang.String getLocalStorage()
For more information, Amazon EC2 instance store in the Amazon EC2 User Guide .
included
.required
.excluded
.
Default: included
default java.util.List<java.lang.String> getLocalStorageTypes()
hdd
.ssd
.
Default: hdd
and ssd
default java.lang.Object getMemoryGiBPerVCpu()
Default: No minimum or maximum limits
default java.lang.Object getMemoryMiB()
default java.lang.Object getNetworkBandwidthGbps()
Default: No minimum or maximum limits
default java.lang.Object getNetworkInterfaceCount()
Default: No minimum or maximum limits
default java.lang.Number getOnDemandMaxPricePercentageOverLowestPrice()
This is the maximum you’ll pay for an On-Demand Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.
The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
To turn off price protection, specify a high value, such as 999999
.
This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements .
If you set
TargetCapacityUnitType
tovcpu
ormemory-mib
, the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.
Default: 20
default java.lang.Object getRequireHibernateSupport()
This parameter is not supported for GetSpotPlacementScores .
Default: false
default java.lang.Number getSpotMaxPricePercentageOverLowestPrice()
This is the maximum you’ll pay for an Spot Instance, expressed as a percentage above the least expensive current generation M, C, or R instance type with your specified attributes. When Amazon EC2 selects instance types with your attributes, it excludes instance types priced above your threshold.
The parameter accepts an integer, which Amazon EC2 interprets as a percentage.
To turn off price protection, specify a high value, such as 999999
.
This parameter is not supported for GetSpotPlacementScores and GetInstanceTypesFromInstanceRequirements .
If you set
TargetCapacityUnitType
tovcpu
ormemory-mib
, the price protection threshold is applied based on the per-vCPU or per-memory price instead of the per-instance price.
Default: 100
default java.lang.Object getTotalLocalStorageGb()
Default: No minimum or maximum limits
default java.lang.Object getVCpuCount()
static CfnSpotFleet.InstanceRequirementsRequestProperty.Builder builder()