class CfnSpotFleetPropsMixin
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Mixins.Preview.AWS.EC2.Mixins.CfnSpotFleetPropsMixin |
Go | github.com/aws/aws-cdk-go/awscdkmixinspreview/v2/awsec2/mixins#CfnSpotFleetPropsMixin |
Java | software.amazon.awscdk.mixins.preview.services.ec2.mixins.CfnSpotFleetPropsMixin |
Python | aws_cdk.mixins_preview.aws_ec2.mixins.CfnSpotFleetPropsMixin |
TypeScript | @aws-cdk/mixins-preview » aws_ec2 » mixins » CfnSpotFleetPropsMixin |
Implements
IMixin
Extends
Mixin
Specifies a Spot Fleet request.
The Spot Fleet request specifies the total target capacity and the On-Demand target capacity. Amazon EC2 calculates the difference between the total capacity and On-Demand capacity, and launches the difference as Spot capacity.
You can submit a single request that includes multiple launch specifications that vary by instance type, AMI, Availability Zone, or subnet.
By default, the Spot Fleet requests Spot Instances in the Spot Instance pool where the price per unit is the lowest. Each launch specification can include its own instance weighting that reflects the value of the instance type to your application workload.
Alternatively, you can specify that the Spot Fleet distribute the target capacity across the Spot pools included in its launch specifications. By ensuring that the Spot Instances in your Spot Fleet are in different Spot pools, you can improve the availability of your fleet.
You can specify tags for the Spot Fleet request and instances launched by the fleet. You cannot tag other resource types in a Spot Fleet request because only the spot-fleet-request and instance resource types are supported.
For more information, see Spot Fleet in the Amazon EC2 User Guide .
See also: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-spotfleet.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 cfnSpotFleetPropsMixin = new ec2_mixins.CfnSpotFleetPropsMixin({
spotFleetRequestConfigData: {
allocationStrategy: 'allocationStrategy',
context: 'context',
excessCapacityTerminationPolicy: 'excessCapacityTerminationPolicy',
iamFleetRole: 'iamFleetRole',
instanceInterruptionBehavior: 'instanceInterruptionBehavior',
instancePoolsToUseCount: 123,
launchSpecifications: [{
blockDeviceMappings: [{
deviceName: 'deviceName',
ebs: {
deleteOnTermination: false,
encrypted: false,
iops: 123,
snapshotId: 'snapshotId',
volumeSize: 123,
volumeType: 'volumeType',
},
noDevice: 'noDevice',
virtualName: 'virtualName',
}],
ebsOptimized: false,
iamInstanceProfile: {
arn: 'arn',
},
imageId: 'imageId',
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',
kernelId: 'kernelId',
keyName: 'keyName',
monitoring: {
enabled: false,
},
networkInterfaces: [{
associatePublicIpAddress: false,
deleteOnTermination: false,
description: 'description',
deviceIndex: 123,
groups: ['groups'],
ipv6AddressCount: 123,
ipv6Addresses: [{
ipv6Address: 'ipv6Address',
}],
networkInterfaceId: 'networkInterfaceId',
privateIpAddresses: [{
primary: false,
privateIpAddress: 'privateIpAddress',
}],
secondaryPrivateIpAddressCount: 123,
subnetId: 'subnetId',
}],
placement: {
availabilityZone: 'availabilityZone',
groupName: 'groupName',
tenancy: 'tenancy',
},
ramdiskId: 'ramdiskId',
securityGroups: [{
groupId: 'groupId',
}],
spotPrice: 'spotPrice',
subnetId: 'subnetId',
tagSpecifications: [{
resourceType: 'resourceType',
tags: [{
key: 'key',
value: 'value',
}],
}],
userData: 'userData',
weightedCapacity: 123,
}],
launchTemplateConfigs: [{
launchTemplateSpecification: {
launchTemplateId: 'launchTemplateId',
launchTemplateName: 'launchTemplateName',
version: 'version',
},
overrides: [{
availabilityZone: 'availabilityZone',
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',
priority: 123,
spotPrice: 'spotPrice',
subnetId: 'subnetId',
weightedCapacity: 123,
}],
}],
loadBalancersConfig: {
classicLoadBalancersConfig: {
classicLoadBalancers: [{
name: 'name',
}],
},
targetGroupsConfig: {
targetGroups: [{
arn: 'arn',
}],
},
},
onDemandAllocationStrategy: 'onDemandAllocationStrategy',
onDemandMaxTotalPrice: 'onDemandMaxTotalPrice',
onDemandTargetCapacity: 123,
replaceUnhealthyInstances: false,
spotMaintenanceStrategies: {
capacityRebalance: {
replacementStrategy: 'replacementStrategy',
terminationDelay: 123,
},
},
spotMaxTotalPrice: 'spotMaxTotalPrice',
spotPrice: 'spotPrice',
tagSpecifications: [{
resourceType: 'resourceType',
tags: [{
key: 'key',
value: 'value',
}],
}],
targetCapacity: 123,
targetCapacityUnitType: 'targetCapacityUnitType',
terminateInstancesWithExpiration: false,
type: 'type',
validFrom: 'validFrom',
validUntil: 'validUntil',
},
tags: [{
key: 'key',
value: 'value',
}],
}, /* all optional props */ {
strategy: mixins.PropertyMergeStrategy.OVERRIDE,
});
Initializer
new CfnSpotFleetPropsMixin(props: CfnSpotFleetMixinProps, options?: CfnPropertyMixinOptions)
Parameters
- props
Cfn— L1 properties to apply.Spot Fleet Mixin Props - options
Cfn— Mixin options.Property Mixin Options
Create a mixin to apply properties to AWS::EC2::SpotFleet.
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