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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance.static interfaceThe minimum and maximum amount of total accelerator memory, in MiB.static interfaceThe minimum and maximum baseline bandwidth to Amazon EBS, in Mbps.static interfaceThe baseline performance to consider, using an instance family as a baseline reference.static interfaceDescribes a block device mapping, which defines the EBS volumes and instance store volumes to attach to an instance at launch.static final classA fluent builder forCfnEC2FleetPropsMixin.static interfaceThe Spot Instance replacement strategy to use when Amazon EC2 emits a rebalance notification signal that your Spot Instance is at an elevated risk of being interrupted.static interfaceDescribes the strategy for using unused Capacity Reservations for fulfilling On-Demand capacity.static interfaceThe CPU performance to consider, using an instance family as the baseline reference.static interfaceDescribes a block device for an EBS volume.static interfaceSpecifies a launch template and overrides for an EC2 Fleet.static interfaceSpecifies overrides for a launch template for an EC2 Fleet.static interfaceSpecifies the launch template to be used by the EC2 Fleet for configuring Amazon EC2 instances.static interfaceThe attributes for the instance types.static interfaceThe strategies for managing your Spot Instances that are at an elevated risk of being interrupted.static interfaceThe minimum and maximum amount of memory per vCPU, in GiB.static interfaceThe minimum and maximum amount of memory, in MiB.static interfaceThe minimum and maximum amount of network bandwidth, in gigabits per second (Gbps).static interfaceThe minimum and maximum number of network interfaces.static interfaceSpecifies the allocation strategy of On-Demand Instances in an EC2 Fleet.static interfaceSpecify an instance family to use as the baseline reference for CPU performance.static interfaceDescribes the placement of an instance.static interfaceSpecifies the configuration of Spot Instances for an EC2 Fleet.static interfaceSpecifies the tags to apply to a resource when the resource is being created for an EC2 Fleet.static interfaceSpecifies the number of units to request for an EC2 Fleet.static interfaceThe minimum and maximum amount of total local storage, in GB.static interfaceThe minimum and maximum number of vCPUs.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::EC2::EC2Fleet.CfnEC2FleetPropsMixin(CfnEC2FleetMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::EC2::EC2Fleet.protectedCfnEC2FleetPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnEC2FleetPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnEC2FleetMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 toAWS::EC2::EC2Fleet.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnEC2FleetPropsMixin
Create a mixin to apply properties toAWS::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. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-