Class CfnEC2FleetPropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.ec2.CfnEC2FleetPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-03-11T13:19:58.360Z") @Stability(Stable) public class CfnEC2FleetPropsMixin extends Mixin implements software.constructs.IMixin
Specifies the configuration information to launch a fleet--or group--of instances.

An EC2 Fleet can launch multiple instance types across multiple Availability Zones, using the On-Demand Instance, Reserved Instance, and Spot Instance purchasing models together. Using EC2 Fleet, you can define separate On-Demand and Spot capacity targets, specify the instance types that work best for your applications, and specify how Amazon EC2 should distribute your fleet capacity within each purchasing model. For more information, see Launching an EC2 Fleet 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.cfnpropertymixins.services.ec2.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnEC2FleetPropsMixin cfnEC2FleetPropsMixin = CfnEC2FleetPropsMixin.Builder.create(CfnEC2FleetMixinProps.builder()
         .context("context")
         .excessCapacityTerminationPolicy("excessCapacityTerminationPolicy")
         .launchTemplateConfigs(List.of(FleetLaunchTemplateConfigRequestProperty.builder()
                 .launchTemplateSpecification(FleetLaunchTemplateSpecificationRequestProperty.builder()
                         .launchTemplateId("launchTemplateId")
                         .launchTemplateName("launchTemplateName")
                         .version("version")
                         .build())
                 .overrides(List.of(FleetLaunchTemplateOverridesRequestProperty.builder()
                         .availabilityZone("availabilityZone")
                         .availabilityZoneId("availabilityZoneId")
                         .blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
                                 .deviceName("deviceName")
                                 .ebs(EbsBlockDeviceProperty.builder()
                                         .deleteOnTermination(false)
                                         .encrypted(false)
                                         .iops(123)
                                         .kmsKeyId("kmsKeyId")
                                         .snapshotId("snapshotId")
                                         .volumeSize(123)
                                         .volumeType("volumeType")
                                         .build())
                                 .noDevice("noDevice")
                                 .virtualName("virtualName")
                                 .build()))
                         .instanceRequirements(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())
                                 .baselinePerformanceFactors(BaselinePerformanceFactorsRequestProperty.builder()
                                         .cpu(CpuPerformanceFactorRequestProperty.builder()
                                                 .references(List.of(PerformanceFactorReferenceRequestProperty.builder()
                                                         .instanceFamily("instanceFamily")
                                                         .build()))
                                                 .build())
                                         .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)
                                 .requireEncryptionInTransit(false)
                                 .requireHibernateSupport(false)
                                 .spotMaxPricePercentageOverLowestPrice(123)
                                 .totalLocalStorageGb(TotalLocalStorageGBRequestProperty.builder()
                                         .max(123)
                                         .min(123)
                                         .build())
                                 .vCpuCount(VCpuCountRangeRequestProperty.builder()
                                         .max(123)
                                         .min(123)
                                         .build())
                                 .build())
                         .instanceType("instanceType")
                         .maxPrice("maxPrice")
                         .placement(PlacementProperty.builder()
                                 .affinity("affinity")
                                 .availabilityZone("availabilityZone")
                                 .groupName("groupName")
                                 .hostId("hostId")
                                 .hostResourceGroupArn("hostResourceGroupArn")
                                 .partitionNumber(123)
                                 .spreadDomain("spreadDomain")
                                 .tenancy("tenancy")
                                 .build())
                         .priority(123)
                         .subnetId("subnetId")
                         .weightedCapacity(123)
                         .build()))
                 .build()))
         .onDemandOptions(OnDemandOptionsRequestProperty.builder()
                 .allocationStrategy("allocationStrategy")
                 .capacityReservationOptions(CapacityReservationOptionsRequestProperty.builder()
                         .usageStrategy("usageStrategy")
                         .build())
                 .maxTotalPrice("maxTotalPrice")
                 .minTargetCapacity(123)
                 .singleAvailabilityZone(false)
                 .singleInstanceType(false)
                 .build())
         .replaceUnhealthyInstances(false)
         .spotOptions(SpotOptionsRequestProperty.builder()
                 .allocationStrategy("allocationStrategy")
                 .instanceInterruptionBehavior("instanceInterruptionBehavior")
                 .instancePoolsToUseCount(123)
                 .maintenanceStrategies(MaintenanceStrategiesProperty.builder()
                         .capacityRebalance(CapacityRebalanceProperty.builder()
                                 .replacementStrategy("replacementStrategy")
                                 .terminationDelay(123)
                                 .build())
                         .build())
                 .maxTotalPrice("maxTotalPrice")
                 .minTargetCapacity(123)
                 .singleAvailabilityZone(false)
                 .singleInstanceType(false)
                 .build())
         .tagSpecifications(List.of(TagSpecificationProperty.builder()
                 .resourceType("resourceType")
                 .tags(List.of(CfnTag.builder()
                         .key("key")
                         .value("value")
                         .build()))
                 .build()))
         .targetCapacitySpecification(TargetCapacitySpecificationRequestProperty.builder()
                 .defaultTargetCapacityType("defaultTargetCapacityType")
                 .onDemandTargetCapacity(123)
                 .spotTargetCapacity(123)
                 .targetCapacityUnitType("targetCapacityUnitType")
                 .totalTargetCapacity(123)
                 .build())
         .terminateInstancesWithExpiration(false)
         .type("type")
         .validFrom("validFrom")
         .validUntil("validUntil")
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnEC2FleetPropsMixin

      protected CfnEC2FleetPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnEC2FleetPropsMixin

      protected CfnEC2FleetPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnEC2FleetPropsMixin

      @Stability(Stable) public CfnEC2FleetPropsMixin(@NotNull CfnEC2FleetMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::EC2::EC2Fleet.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnEC2FleetPropsMixin

      @Stability(Stable) public CfnEC2FleetPropsMixin(@NotNull CfnEC2FleetMixinProps props)
      Create a mixin to apply properties to AWS::EC2::EC2Fleet.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnEC2FleetMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()