Class CfnSpotFleet.SpotFleetLaunchSpecificationProperty
Specifies the launch specification for one or more Spot Instances.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnSpotFleet.SpotFleetLaunchSpecificationProperty : CfnSpotFleet.ISpotFleetLaunchSpecificationProperty
Syntax (vb)
Public Class CfnSpotFleet.SpotFleetLaunchSpecificationProperty Implements CfnSpotFleet.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
Constructors
| SpotFleetLaunchSpecificationProperty() | Specifies the launch specification for one or more Spot Instances. |
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. |
Constructors
SpotFleetLaunchSpecificationProperty()
Specifies the launch specification for one or more Spot Instances.
public SpotFleetLaunchSpecificationProperty()
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
};
Properties
BlockDeviceMappings
One or more block devices that are mapped to the Spot Instances.
public object? BlockDeviceMappings { get; set; }
Property Value
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.
Type union: either IResolvable or (either IResolvable or CfnSpotFleet.IBlockDeviceMappingProperty)[]
EbsOptimized
Indicates whether the instances are optimized for EBS I/O.
public object? EbsOptimized { get; set; }
Property Value
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
Type union: either bool or IResolvable
IamInstanceProfile
The IAM instance profile.
public object? IamInstanceProfile { get; set; }
Property Value
Remarks
ImageId
The ID of the AMI.
public string ImageId { get; set; }
Property Value
Remarks
InstanceRequirements
The attributes for the instance types.
public object? InstanceRequirements { get; set; }
Property Value
Remarks
When you specify instance attributes, Amazon EC2 will identify instance types with those attributes.
If you specify <code>InstanceRequirements</code> , you can't specify <code>InstanceType</code> .
Type union: either IResolvable or CfnSpotFleet.IInstanceRequirementsRequestProperty
InstanceType
The instance type.
public string? InstanceType { get; set; }
Property Value
Remarks
KernelId
The ID of the kernel.
public string? KernelId { get; set; }
Property Value
Remarks
KeyName
The name of the key pair.
public string? KeyName { get; set; }
Property Value
Remarks
Monitoring
Enable or disable monitoring for the instances.
public object? Monitoring { get; set; }
Property Value
Remarks
NetworkInterfaces
The network interfaces.
public object? NetworkInterfaces { get; set; }
Property Value
Remarks
Type union: either IResolvable or (either IResolvable or CfnSpotFleet.IInstanceNetworkInterfaceSpecificationProperty)[]
Placement
The placement information.
public object? Placement { get; set; }
Property Value
Remarks
RamdiskId
The ID of the RAM disk.
public string? RamdiskId { get; set; }
Property Value
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.
public object? SecurityGroups { get; set; }
Property Value
Remarks
If you specify a network interface, you must specify any security groups as part of the network interface instead of using this parameter.
Type union: either IResolvable or (either IResolvable or CfnSpotFleet.IGroupIdentifierProperty)[]
SpotPrice
The maximum price per unit hour that you are willing to pay for a Spot Instance.
public string? SpotPrice { get; set; }
Property Value
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.
public string? SubnetId { get; set; }
Property Value
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.
public object? TagSpecifications { get; set; }
Property Value
Remarks
Type union: either IResolvable or (either IResolvable or CfnSpotFleet.ISpotFleetTagSpecificationProperty)[]
UserData
The base64-encoded user data that instances use when starting up.
public string? UserData { get; set; }
Property Value
Remarks
WeightedCapacity
The number of units provided by the specified instance type.
public double? WeightedCapacity { get; set; }
Property Value
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 <code>lowestPrice</code> and <code>priceCapacityOptimized</code> allocation strategies is per <em>unit</em> hour (where the instance price is divided by the specified weight). However, if all the specified weights are above the requested <code>TargetCapacity</code> , resulting in only 1 instance being launched, the price used is per <em>instance</em> hour.