Interface CfnSpotFleet.ISpotFleetLaunchSpecificationProperty
Specifies the launch specification for one or more Spot Instances.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ISpotFleetLaunchSpecificationProperty
Syntax (vb)
Public Interface ISpotFleetLaunchSpecificationProperty
Remarks
If you include On-Demand capacity in your fleet request, you can't use SpotFleetLaunchSpecification
; you must use LaunchTemplateConfig .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var spotFleetLaunchSpecificationProperty = new SpotFleetLaunchSpecificationProperty {
ImageId = "imageId",
// the properties below are optional
BlockDeviceMappings = new [] { new BlockDeviceMappingProperty {
DeviceName = "deviceName",
// the properties below are optional
Ebs = new EbsBlockDeviceProperty {
DeleteOnTermination = false,
Encrypted = false,
Iops = 123,
SnapshotId = "snapshotId",
VolumeSize = 123,
VolumeType = "volumeType"
},
NoDevice = "noDevice",
VirtualName = "virtualName"
} },
EbsOptimized = false,
IamInstanceProfile = new IamInstanceProfileSpecificationProperty {
Arn = "arn"
},
InstanceRequirements = new InstanceRequirementsRequestProperty {
AcceleratorCount = new AcceleratorCountRequestProperty {
Max = 123,
Min = 123
},
AcceleratorManufacturers = new [] { "acceleratorManufacturers" },
AcceleratorNames = new [] { "acceleratorNames" },
AcceleratorTotalMemoryMiB = new AcceleratorTotalMemoryMiBRequestProperty {
Max = 123,
Min = 123
},
AcceleratorTypes = new [] { "acceleratorTypes" },
AllowedInstanceTypes = new [] { "allowedInstanceTypes" },
BareMetal = "bareMetal",
BaselineEbsBandwidthMbps = new BaselineEbsBandwidthMbpsRequestProperty {
Max = 123,
Min = 123
},
BaselinePerformanceFactors = new BaselinePerformanceFactorsRequestProperty {
Cpu = new CpuPerformanceFactorRequestProperty {
References = new [] { new PerformanceFactorReferenceRequestProperty {
InstanceFamily = "instanceFamily"
} }
}
},
BurstablePerformance = "burstablePerformance",
CpuManufacturers = new [] { "cpuManufacturers" },
ExcludedInstanceTypes = new [] { "excludedInstanceTypes" },
InstanceGenerations = new [] { "instanceGenerations" },
LocalStorage = "localStorage",
LocalStorageTypes = new [] { "localStorageTypes" },
MaxSpotPriceAsPercentageOfOptimalOnDemandPrice = 123,
MemoryGiBPerVCpu = new MemoryGiBPerVCpuRequestProperty {
Max = 123,
Min = 123
},
MemoryMiB = new MemoryMiBRequestProperty {
Max = 123,
Min = 123
},
NetworkBandwidthGbps = new NetworkBandwidthGbpsRequestProperty {
Max = 123,
Min = 123
},
NetworkInterfaceCount = new NetworkInterfaceCountRequestProperty {
Max = 123,
Min = 123
},
OnDemandMaxPricePercentageOverLowestPrice = 123,
RequireHibernateSupport = false,
SpotMaxPricePercentageOverLowestPrice = 123,
TotalLocalStorageGb = new TotalLocalStorageGBRequestProperty {
Max = 123,
Min = 123
},
VCpuCount = new VCpuCountRangeRequestProperty {
Max = 123,
Min = 123
}
},
InstanceType = "instanceType",
KernelId = "kernelId",
KeyName = "keyName",
Monitoring = new SpotFleetMonitoringProperty {
Enabled = false
},
NetworkInterfaces = new [] { new InstanceNetworkInterfaceSpecificationProperty {
AssociatePublicIpAddress = false,
DeleteOnTermination = false,
Description = "description",
DeviceIndex = 123,
Groups = new [] { "groups" },
Ipv6AddressCount = 123,
Ipv6Addresses = new [] { new InstanceIpv6AddressProperty {
Ipv6Address = "ipv6Address"
} },
NetworkInterfaceId = "networkInterfaceId",
PrivateIpAddresses = new [] { new PrivateIpAddressSpecificationProperty {
PrivateIpAddress = "privateIpAddress",
// the properties below are optional
Primary = false
} },
SecondaryPrivateIpAddressCount = 123,
SubnetId = "subnetId"
} },
Placement = new SpotPlacementProperty {
AvailabilityZone = "availabilityZone",
GroupName = "groupName",
Tenancy = "tenancy"
},
RamdiskId = "ramdiskId",
SecurityGroups = new [] { new GroupIdentifierProperty {
GroupId = "groupId"
} },
SpotPrice = "spotPrice",
SubnetId = "subnetId",
TagSpecifications = new [] { new SpotFleetTagSpecificationProperty {
ResourceType = "resourceType",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
} },
UserData = "userData",
WeightedCapacity = 123
};
Synopsis
Properties
BlockDeviceMappings | One or more block devices that are mapped to the Spot Instances. |
EbsOptimized | Indicates whether the instances are optimized for EBS I/O. |
IamInstanceProfile | The IAM instance profile. |
ImageId | The ID of the AMI. |
InstanceRequirements | The attributes for the instance types. |
InstanceType | The instance type. |
KernelId | The ID of the kernel. |
KeyName | The name of the key pair. |
Monitoring | Enable or disable monitoring for the instances. |
NetworkInterfaces | The network interfaces. |
Placement | The placement information. |
RamdiskId | The ID of the RAM disk. |
SecurityGroups | The security groups. |
SpotPrice | The maximum price per unit hour that you are willing to pay for a Spot Instance. |
SubnetId | The IDs of the subnets in which to launch the instances. |
TagSpecifications | The tags to apply during creation. |
UserData | The base64-encoded user data that instances use when starting up. |
WeightedCapacity | The number of units provided by the specified instance type. |
Properties
BlockDeviceMappings
One or more block devices that are mapped to the Spot Instances.
virtual object BlockDeviceMappings { get; }
Property Value
System.Object
Remarks
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
Indicates whether the instances are optimized for EBS I/O.
virtual object EbsOptimized { get; }
Property Value
System.Object
Remarks
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
Default: - false
IamInstanceProfile
The IAM instance profile.
virtual object IamInstanceProfile { get; }
Property Value
System.Object
Remarks
ImageId
The ID of the AMI.
string ImageId { get; }
Property Value
System.String
Remarks
InstanceRequirements
The attributes for the instance types.
virtual object InstanceRequirements { get; }
Property Value
System.Object
Remarks
When you specify instance attributes, Amazon EC2 will identify instance types with those attributes.
If you specify InstanceRequirements
, you can't specify InstanceType
.
InstanceType
The instance type.
virtual string InstanceType { get; }
Property Value
System.String
Remarks
KernelId
The ID of the kernel.
virtual string KernelId { get; }
Property Value
System.String
Remarks
KeyName
The name of the key pair.
virtual string KeyName { get; }
Property Value
System.String
Remarks
Monitoring
Enable or disable monitoring for the instances.
virtual object Monitoring { get; }
Property Value
System.Object
Remarks
NetworkInterfaces
The network interfaces.
virtual object NetworkInterfaces { get; }
Property Value
System.Object
Remarks
Placement
The placement information.
virtual object Placement { get; }
Property Value
System.Object
Remarks
RamdiskId
The ID of the RAM disk.
virtual string RamdiskId { get; }
Property Value
System.String
Remarks
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
The security groups.
virtual object SecurityGroups { get; }
Property Value
System.Object
Remarks
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
SpotPrice
The maximum price per unit hour that you are willing to pay for a Spot Instance.
virtual string SpotPrice { get; }
Property Value
System.String
Remarks
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
The IDs of the subnets in which to launch the instances.
virtual string SubnetId { get; }
Property Value
System.String
Remarks
To specify multiple subnets, separate them using commas; for example, "subnet-1234abcdeexample1, subnet-0987cdef6example2".
If you specify a network interface, you must specify any subnets as part of the network interface instead of using this parameter.
TagSpecifications
The tags to apply during creation.
virtual object TagSpecifications { get; }
Property Value
System.Object
Remarks
UserData
The base64-encoded user data that instances use when starting up.
virtual string UserData { get; }
Property Value
System.String
Remarks
WeightedCapacity
The number of units provided by the specified instance type.
virtual Nullable<double> WeightedCapacity { get; }
Property Value
System.Nullable<System.Double>
Remarks
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.
When specifying weights, the price used in the lowestPrice
and priceCapacityOptimized
allocation strategies is per unit hour (where the instance price is divided by the specified weight). However, if all the specified weights are above the requested TargetCapacity
, resulting in only 1 instance being launched, the price used is per instance hour.