class CfnEC2FleetPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.EC2.Mixins.CfnEC2FleetPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awsec2/mixins#CfnEC2FleetPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.ec2.mixins.CfnEC2FleetPropsMixin |
Python | aws_cdk.mixins_preview.aws_ec2.mixins.CfnEC2FleetPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_ec2 » mixins » CfnEC2FleetPropsMixin |
Implements
IMixin
Extends
Mixin
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 .
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ec2fleet.html
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { mixins } from '@aws-cdk/mixins-preview';
import { mixins as ec2_mixins } from '@aws-cdk/mixins-preview/aws-ec2';
const cfnEC2FleetPropsMixin = new ec2_mixins.CfnEC2FleetPropsMixin({
context: 'context',
excessCapacityTerminationPolicy: 'excessCapacityTerminationPolicy',
launchTemplateConfigs: [{
launchTemplateSpecification: {
launchTemplateId: 'launchTemplateId',
launchTemplateName: 'launchTemplateName',
version: 'version',
},
overrides: [{
availabilityZone: 'availabilityZone',
blockDeviceMappings: [{
deviceName: 'deviceName',
ebs: {
deleteOnTermination: false,
encrypted: false,
iops: 123,
kmsKeyId: 'kmsKeyId',
snapshotId: 'snapshotId',
volumeSize: 123,
volumeType: 'volumeType',
},
noDevice: 'noDevice',
virtualName: 'virtualName',
}],
instanceRequirements: {
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,
},
baselinePerformanceFactors: {
cpu: {
references: [{
instanceFamily: 'instanceFamily',
}],
},
},
burstablePerformance: 'burstablePerformance',
cpuManufacturers: ['cpuManufacturers'],
excludedInstanceTypes: ['excludedInstanceTypes'],
instanceGenerations: ['instanceGenerations'],
localStorage: 'localStorage',
localStorageTypes: ['localStorageTypes'],
maxSpotPriceAsPercentageOfOptimalOnDemandPrice: 123,
memoryGiBPerVCpu: {
max: 123,
min: 123,
},
memoryMiB: {
max: 123,
min: 123,
},
networkBandwidthGbps: {
max: 123,
min: 123,
},
networkInterfaceCount: {
max: 123,
min: 123,
},
onDemandMaxPricePercentageOverLowestPrice: 123,
requireEncryptionInTransit: false,
requireHibernateSupport: false,
spotMaxPricePercentageOverLowestPrice: 123,
totalLocalStorageGb: {
max: 123,
min: 123,
},
vCpuCount: {
max: 123,
min: 123,
},
},
instanceType: 'instanceType',
maxPrice: 'maxPrice',
placement: {
affinity: 'affinity',
availabilityZone: 'availabilityZone',
groupName: 'groupName',
hostId: 'hostId',
hostResourceGroupArn: 'hostResourceGroupArn',
partitionNumber: 123,
spreadDomain: 'spreadDomain',
tenancy: 'tenancy',
},
priority: 123,
subnetId: 'subnetId',
weightedCapacity: 123,
}],
}],
onDemandOptions: {
allocationStrategy: 'allocationStrategy',
capacityReservationOptions: {
usageStrategy: 'usageStrategy',
},
maxTotalPrice: 'maxTotalPrice',
minTargetCapacity: 123,
singleAvailabilityZone: false,
singleInstanceType: false,
},
replaceUnhealthyInstances: false,
spotOptions: {
allocationStrategy: 'allocationStrategy',
instanceInterruptionBehavior: 'instanceInterruptionBehavior',
instancePoolsToUseCount: 123,
maintenanceStrategies: {
capacityRebalance: {
replacementStrategy: 'replacementStrategy',
terminationDelay: 123,
},
},
maxTotalPrice: 'maxTotalPrice',
minTargetCapacity: 123,
singleAvailabilityZone: false,
singleInstanceType: false,
},
tagSpecifications: [{
resourceType: 'resourceType',
tags: [{
key: 'key',
value: 'value',
}],
}],
targetCapacitySpecification: {
defaultTargetCapacityType: 'defaultTargetCapacityType',
onDemandTargetCapacity: 123,
spotTargetCapacity: 123,
targetCapacityUnitType: 'targetCapacityUnitType',
totalTargetCapacity: 123,
},
terminateInstancesWithExpiration: false,
type: 'type',
validFrom: 'validFrom',
validUntil: 'validUntil',
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnEC2FleetPropsMixin(props: CfnEC2FleetMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.EC2 Fleet Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::EC2::EC2Fleet.
Properties
| Name | Type | Description |
|---|---|---|
| props | Cfn | |
| strategy | Property | |
| static CFN_PROPERTY_KEYS | string[] |
props
Type:
Cfn
strategy
Type:
Property
static CFN_PROPERTY_KEYS
Type:
string[]
Methods
| Name | Description |
|---|---|
| apply | Apply the mixin properties to the construct. |
| supports(construct) | Check if this mixin supports the given construct. |
applyTo(construct)
public applyTo(construct: IConstruct): IConstruct
Parameters
- construct
IConstruct
Returns
Apply the mixin properties to the construct.
supports(construct)
public supports(construct: IConstruct): boolean
Parameters
- construct
IConstruct
Returns
boolean
Check if this mixin supports the given construct.

.NET
Go
Java
Python
TypeScript