Interface CfnSpotFleet.InstanceRequirementsRequestProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnSpotFleet.InstanceRequirementsRequestProperty.Jsii$Proxy
Enclosing class:
CfnSpotFleet

@Stability(Stable) public static interface CfnSpotFleet.InstanceRequirementsRequestProperty extends software.amazon.jsii.JsiiSerializable
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 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"))
         .maxSpotPriceAsPercentageOfOptimalOnDemandPrice(123)
         .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();
 

See Also: