interface SpotFleetLaunchSpecificationProperty
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty |
![]() | software.amazon.awscdk.services.ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty |
![]() | aws_cdk.aws_ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty |
![]() | @aws-cdk/aws-ec2 » CfnSpotFleet » SpotFleetLaunchSpecificationProperty |
Specifies the launch specification for one or more Spot Instances.
If you include On-Demand capacity in your fleet request, you can't use SpotFleetLaunchSpecification
; you must use LaunchTemplateConfig .
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as ec2 from '@aws-cdk/aws-ec2';
const spotFleetLaunchSpecificationProperty: ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty = {
imageId: 'imageId',
// the properties below are optional
blockDeviceMappings: [{
deviceName: 'deviceName',
// the properties below are optional
ebs: {
deleteOnTermination: false,
encrypted: false,
iops: 123,
snapshotId: 'snapshotId',
volumeSize: 123,
volumeType: 'volumeType',
},
noDevice: 'noDevice',
virtualName: 'virtualName',
}],
ebsOptimized: false,
iamInstanceProfile: {
arn: 'arn',
},
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,
},
burstablePerformance: 'burstablePerformance',
cpuManufacturers: ['cpuManufacturers'],
excludedInstanceTypes: ['excludedInstanceTypes'],
instanceGenerations: ['instanceGenerations'],
localStorage: 'localStorage',
localStorageTypes: ['localStorageTypes'],
memoryGiBPerVCpu: {
max: 123,
min: 123,
},
memoryMiB: {
max: 123,
min: 123,
},
networkBandwidthGbps: {
max: 123,
min: 123,
},
networkInterfaceCount: {
max: 123,
min: 123,
},
onDemandMaxPricePercentageOverLowestPrice: 123,
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: [{
privateIpAddress: 'privateIpAddress',
// the properties below are optional
primary: false,
}],
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,
};
Properties
Name | Type | Description |
---|---|---|
image | string | The ID of the AMI. |
block | IResolvable | IResolvable | Block [] | One or more block devices that are mapped to the Spot Instances. |
ebs | boolean | IResolvable | Indicates whether the instances are optimized for EBS I/O. |
iam | IResolvable | Iam | The IAM instance profile. |
instance | IResolvable | Instance | The attributes for the instance types. |
instance | string | The instance type. |
kernel | string | The ID of the kernel. |
key | string | The name of the key pair. |
monitoring? | IResolvable | Spot | Enable or disable monitoring for the instances. |
network | IResolvable | IResolvable | Instance [] | One or more network interfaces. |
placement? | IResolvable | Spot | The placement information. |
ramdisk | string | The ID of the RAM disk. |
security | IResolvable | IResolvable | Group [] | The security groups. |
spot | string | The maximum price per unit hour that you are willing to pay for a Spot Instance. |
subnet | string | The IDs of the subnets in which to launch the instances. |
tag | IResolvable | IResolvable | Spot [] | The tags to apply during creation. |
user | string | The base64-encoded user data that instances use when starting up. |
weighted | number | The number of units provided by the specified instance type. |
imageId
Type:
string
The ID of the AMI.
blockDeviceMappings?
Type:
IResolvable
|
IResolvable
|
Block
[]
(optional)
One or more block devices that are mapped to the Spot Instances.
You can't specify both a snapshot ID and an encryption value. This is because only blank volumes can be encrypted on creation. If a snapshot is the basis for a volume, it is not blank and its encryption status is used for the volume encryption status.
ebsOptimized?
Type:
boolean |
IResolvable
(optional)
Indicates whether the instances are optimized for EBS I/O.
This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.
Default: false
iamInstanceProfile?
Type:
IResolvable
|
Iam
(optional)
The IAM instance profile.
instanceRequirements?
Type:
IResolvable
|
Instance
(optional)
The attributes for the instance types.
When you specify instance attributes, Amazon EC2 will identify instance types with those attributes.
If you specify
InstanceRequirements
, you can't specifyInstanceType
.
instanceType?
Type:
string
(optional)
The instance type.
kernelId?
Type:
string
(optional)
The ID of the kernel.
keyName?
Type:
string
(optional)
The name of the key pair.
monitoring?
Type:
IResolvable
|
Spot
(optional)
Enable or disable monitoring for the instances.
networkInterfaces?
Type:
IResolvable
|
IResolvable
|
Instance
[]
(optional)
One or more network interfaces.
If you specify a network interface, you must specify subnet IDs and security group IDs using the network interface.
SpotFleetLaunchSpecification
currently does not support Elastic Fabric Adapter (EFA). To specify an EFA, you must use LaunchTemplateConfig .
placement?
Type:
IResolvable
|
Spot
(optional)
The placement information.
ramdiskId?
Type:
string
(optional)
The ID of the RAM disk.
Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.
securityGroups?
Type:
IResolvable
|
IResolvable
|
Group
[]
(optional)
The security groups.
spotPrice?
Type:
string
(optional)
The maximum price per unit hour that you are willing to pay for a Spot Instance.
We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.
If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
subnetId?
Type:
string
(optional)
The IDs of the subnets in which to launch the instances.
To specify multiple subnets, separate them using commas; for example, "subnet-1234abcdeexample1, subnet-0987cdef6example2".
tagSpecifications?
Type:
IResolvable
|
IResolvable
|
Spot
[]
(optional)
The tags to apply during creation.
userData?
Type:
string
(optional)
The base64-encoded user data that instances use when starting up.
User data is limited to 16 KB.
weightedCapacity?
Type:
number
(optional)
The number of units provided by the specified instance type.
These are the same units that you chose to set the target capacity in terms of instances, or a performance characteristic such as vCPUs, memory, or I/O.
If the target capacity divided by this value is not a whole number, Amazon EC2 rounds the number of instances to the next whole number. If this value is not specified, the default is 1.