CfnSpotFleetProps Struct
Properties for defining a CfnSpotFleet.
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const cfnSpotFleetProps: ec2.CfnSpotFleetProps = {
spotFleetRequestConfigData: {
iamFleetRole: 'iamFleetRole',
targetCapacity: 123,
// the properties below are optional
allocationStrategy: 'allocationStrategy',
context: 'context',
excessCapacityTerminationPolicy: 'excessCapacityTerminationPolicy',
instanceInterruptionBehavior: 'instanceInterruptionBehavior',
instancePoolsToUseCount: 123,
launchSpecifications: [{
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,
},
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: [{
privateIpAddress: 'privateIpAddress',
// the properties below are optional
primary: false,
}],
secondaryPrivateIpAddressCount: 123,
subnetId: 'subnetId',
}],
placement: {
availabilityZone: 'availabilityZone',
availabilityZoneId: 'availabilityZoneId',
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: {
version: 'version',
// the properties below are optional
launchTemplateId: 'launchTemplateId',
launchTemplateName: 'launchTemplateName',
},
overrides: [{
availabilityZone: 'availabilityZone',
availabilityZoneId: 'availabilityZoneId',
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',
}],
}],
targetCapacityUnitType: 'targetCapacityUnitType',
terminateInstancesWithExpiration: false,
type: 'type',
validFrom: 'validFrom',
validUntil: 'validUntil',
},
// the properties below are optional
tags: [{
key: 'key',
value: 'value',
}],
};
python
from aws_cdk import CfnTag, CfnTag, CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2
cfn_spot_fleet_props = ec2.CfnSpotFleetProps(
spot_fleet_request_config_data=ec2.CfnSpotFleet.SpotFleetRequestConfigDataProperty(
iam_fleet_role="iamFleetRole",
target_capacity=123,
# the properties below are optional
allocation_strategy="allocationStrategy",
context="context",
excess_capacity_termination_policy="excessCapacityTerminationPolicy",
instance_interruption_behavior="instanceInterruptionBehavior",
instance_pools_to_use_count=123,
launch_specifications=[ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty(
image_id="imageId",
# the properties below are optional
block_device_mappings=[ec2.CfnSpotFleet.BlockDeviceMappingProperty(
device_name="deviceName",
# the properties below are optional
ebs=ec2.CfnSpotFleet.EbsBlockDeviceProperty(
delete_on_termination=False,
encrypted=False,
iops=123,
snapshot_id="snapshotId",
volume_size=123,
volume_type="volumeType"
),
no_device="noDevice",
virtual_name="virtualName"
)],
ebs_optimized=False,
iam_instance_profile=ec2.CfnSpotFleet.IamInstanceProfileSpecificationProperty(
arn="arn"
),
instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
max=123,
min=123
),
accelerator_manufacturers=["acceleratorManufacturers"],
accelerator_names=["acceleratorNames"],
accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
max=123,
min=123
),
accelerator_types=["acceleratorTypes"],
allowed_instance_types=["allowedInstanceTypes"],
bare_metal="bareMetal",
baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.BaselineEbsBandwidthMbpsRequestProperty(
max=123,
min=123
),
baseline_performance_factors=ec2.CfnSpotFleet.BaselinePerformanceFactorsRequestProperty(
cpu=ec2.CfnSpotFleet.CpuPerformanceFactorRequestProperty(
references=[ec2.CfnSpotFleet.PerformanceFactorReferenceRequestProperty(
instance_family="instanceFamily"
)]
)
),
burstable_performance="burstablePerformance",
cpu_manufacturers=["cpuManufacturers"],
excluded_instance_types=["excludedInstanceTypes"],
instance_generations=["instanceGenerations"],
local_storage="localStorage",
local_storage_types=["localStorageTypes"],
max_spot_price_as_percentage_of_optimal_on_demand_price=123,
memory_gi_b_per_v_cpu=ec2.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
max=123,
min=123
),
memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
max=123,
min=123
),
network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
max=123,
min=123
),
network_interface_count=ec2.CfnSpotFleet.NetworkInterfaceCountRequestProperty(
max=123,
min=123
),
on_demand_max_price_percentage_over_lowest_price=123,
require_encryption_in_transit=False,
require_hibernate_support=False,
spot_max_price_percentage_over_lowest_price=123,
total_local_storage_gb=ec2.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
max=123,
min=123
),
v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
max=123,
min=123
)
),
instance_type="instanceType",
kernel_id="kernelId",
key_name="keyName",
monitoring=ec2.CfnSpotFleet.SpotFleetMonitoringProperty(
enabled=False
),
network_interfaces=[ec2.CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty(
associate_public_ip_address=False,
delete_on_termination=False,
description="description",
device_index=123,
groups=["groups"],
ipv6_address_count=123,
ipv6_addresses=[ec2.CfnSpotFleet.InstanceIpv6AddressProperty(
ipv6_address="ipv6Address"
)],
network_interface_id="networkInterfaceId",
private_ip_addresses=[ec2.CfnSpotFleet.PrivateIpAddressSpecificationProperty(
private_ip_address="privateIpAddress",
# the properties below are optional
primary=False
)],
secondary_private_ip_address_count=123,
subnet_id="subnetId"
)],
placement=ec2.CfnSpotFleet.SpotPlacementProperty(
availability_zone="availabilityZone",
availability_zone_id="availabilityZoneId",
group_name="groupName",
tenancy="tenancy"
),
ramdisk_id="ramdiskId",
security_groups=[ec2.CfnSpotFleet.GroupIdentifierProperty(
group_id="groupId"
)],
spot_price="spotPrice",
subnet_id="subnetId",
tag_specifications=[ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
resource_type="resourceType",
tags=[CfnTag(
key="key",
value="value"
)]
)],
user_data="userData",
weighted_capacity=123
)],
launch_template_configs=[ec2.CfnSpotFleet.LaunchTemplateConfigProperty(
launch_template_specification=ec2.CfnSpotFleet.FleetLaunchTemplateSpecificationProperty(
version="version",
# the properties below are optional
launch_template_id="launchTemplateId",
launch_template_name="launchTemplateName"
),
overrides=[ec2.CfnSpotFleet.LaunchTemplateOverridesProperty(
availability_zone="availabilityZone",
availability_zone_id="availabilityZoneId",
instance_requirements=ec2.CfnSpotFleet.InstanceRequirementsRequestProperty(
accelerator_count=ec2.CfnSpotFleet.AcceleratorCountRequestProperty(
max=123,
min=123
),
accelerator_manufacturers=["acceleratorManufacturers"],
accelerator_names=["acceleratorNames"],
accelerator_total_memory_mi_b=ec2.CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty(
max=123,
min=123
),
accelerator_types=["acceleratorTypes"],
allowed_instance_types=["allowedInstanceTypes"],
bare_metal="bareMetal",
baseline_ebs_bandwidth_mbps=ec2.CfnSpotFleet.BaselineEbsBandwidthMbpsRequestProperty(
max=123,
min=123
),
baseline_performance_factors=ec2.CfnSpotFleet.BaselinePerformanceFactorsRequestProperty(
cpu=ec2.CfnSpotFleet.CpuPerformanceFactorRequestProperty(
references=[ec2.CfnSpotFleet.PerformanceFactorReferenceRequestProperty(
instance_family="instanceFamily"
)]
)
),
burstable_performance="burstablePerformance",
cpu_manufacturers=["cpuManufacturers"],
excluded_instance_types=["excludedInstanceTypes"],
instance_generations=["instanceGenerations"],
local_storage="localStorage",
local_storage_types=["localStorageTypes"],
max_spot_price_as_percentage_of_optimal_on_demand_price=123,
memory_gi_b_per_v_cpu=ec2.CfnSpotFleet.MemoryGiBPerVCpuRequestProperty(
max=123,
min=123
),
memory_mi_b=ec2.CfnSpotFleet.MemoryMiBRequestProperty(
max=123,
min=123
),
network_bandwidth_gbps=ec2.CfnSpotFleet.NetworkBandwidthGbpsRequestProperty(
max=123,
min=123
),
network_interface_count=ec2.CfnSpotFleet.NetworkInterfaceCountRequestProperty(
max=123,
min=123
),
on_demand_max_price_percentage_over_lowest_price=123,
require_encryption_in_transit=False,
require_hibernate_support=False,
spot_max_price_percentage_over_lowest_price=123,
total_local_storage_gb=ec2.CfnSpotFleet.TotalLocalStorageGBRequestProperty(
max=123,
min=123
),
v_cpu_count=ec2.CfnSpotFleet.VCpuCountRangeRequestProperty(
max=123,
min=123
)
),
instance_type="instanceType",
priority=123,
spot_price="spotPrice",
subnet_id="subnetId",
weighted_capacity=123
)]
)],
load_balancers_config=ec2.CfnSpotFleet.LoadBalancersConfigProperty(
classic_load_balancers_config=ec2.CfnSpotFleet.ClassicLoadBalancersConfigProperty(
classic_load_balancers=[ec2.CfnSpotFleet.ClassicLoadBalancerProperty(
name="name"
)]
),
target_groups_config=ec2.CfnSpotFleet.TargetGroupsConfigProperty(
target_groups=[ec2.CfnSpotFleet.TargetGroupProperty(
arn="arn"
)]
)
),
on_demand_allocation_strategy="onDemandAllocationStrategy",
on_demand_max_total_price="onDemandMaxTotalPrice",
on_demand_target_capacity=123,
replace_unhealthy_instances=False,
spot_maintenance_strategies=ec2.CfnSpotFleet.SpotMaintenanceStrategiesProperty(
capacity_rebalance=ec2.CfnSpotFleet.SpotCapacityRebalanceProperty(
replacement_strategy="replacementStrategy",
termination_delay=123
)
),
spot_max_total_price="spotMaxTotalPrice",
spot_price="spotPrice",
tag_specifications=[ec2.CfnSpotFleet.SpotFleetTagSpecificationProperty(
resource_type="resourceType",
tags=[CfnTag(
key="key",
value="value"
)]
)],
target_capacity_unit_type="targetCapacityUnitType",
terminate_instances_with_expiration=False,
type="type",
valid_from="validFrom",
valid_until="validUntil"
),
# the properties below are optional
tags=[CfnTag(
key="key",
value="value"
)]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
CfnSpotFleetProps cfnSpotFleetProps = CfnSpotFleetProps.builder()
.spotFleetRequestConfigData(SpotFleetRequestConfigDataProperty.builder()
.iamFleetRole("iamFleetRole")
.targetCapacity(123)
// the properties below are optional
.allocationStrategy("allocationStrategy")
.context("context")
.excessCapacityTerminationPolicy("excessCapacityTerminationPolicy")
.instanceInterruptionBehavior("instanceInterruptionBehavior")
.instancePoolsToUseCount(123)
.launchSpecifications(List.of(SpotFleetLaunchSpecificationProperty.builder()
.imageId("imageId")
// the properties below are optional
.blockDeviceMappings(List.of(BlockDeviceMappingProperty.builder()
.deviceName("deviceName")
// the properties below are optional
.ebs(EbsBlockDeviceProperty.builder()
.deleteOnTermination(false)
.encrypted(false)
.iops(123)
.snapshotId("snapshotId")
.volumeSize(123)
.volumeType("volumeType")
.build())
.noDevice("noDevice")
.virtualName("virtualName")
.build()))
.ebsOptimized(false)
.iamInstanceProfile(IamInstanceProfileSpecificationProperty.builder()
.arn("arn")
.build())
.instanceRequirements(InstanceRequirementsRequestProperty.builder()
.acceleratorCount(AcceleratorCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorManufacturers(List.of("acceleratorManufacturers"))
.acceleratorNames(List.of("acceleratorNames"))
.acceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorTypes(List.of("acceleratorTypes"))
.allowedInstanceTypes(List.of("allowedInstanceTypes"))
.bareMetal("bareMetal")
.baselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsRequestProperty.builder()
.max(123)
.min(123)
.build())
.baselinePerformanceFactors(BaselinePerformanceFactorsRequestProperty.builder()
.cpu(CpuPerformanceFactorRequestProperty.builder()
.references(List.of(PerformanceFactorReferenceRequestProperty.builder()
.instanceFamily("instanceFamily")
.build()))
.build())
.build())
.burstablePerformance("burstablePerformance")
.cpuManufacturers(List.of("cpuManufacturers"))
.excludedInstanceTypes(List.of("excludedInstanceTypes"))
.instanceGenerations(List.of("instanceGenerations"))
.localStorage("localStorage")
.localStorageTypes(List.of("localStorageTypes"))
.maxSpotPriceAsPercentageOfOptimalOnDemandPrice(123)
.memoryGiBPerVCpu(MemoryGiBPerVCpuRequestProperty.builder()
.max(123)
.min(123)
.build())
.memoryMiB(MemoryMiBRequestProperty.builder()
.max(123)
.min(123)
.build())
.networkBandwidthGbps(NetworkBandwidthGbpsRequestProperty.builder()
.max(123)
.min(123)
.build())
.networkInterfaceCount(NetworkInterfaceCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.onDemandMaxPricePercentageOverLowestPrice(123)
.requireEncryptionInTransit(false)
.requireHibernateSupport(false)
.spotMaxPricePercentageOverLowestPrice(123)
.totalLocalStorageGb(TotalLocalStorageGBRequestProperty.builder()
.max(123)
.min(123)
.build())
.vCpuCount(VCpuCountRangeRequestProperty.builder()
.max(123)
.min(123)
.build())
.build())
.instanceType("instanceType")
.kernelId("kernelId")
.keyName("keyName")
.monitoring(SpotFleetMonitoringProperty.builder()
.enabled(false)
.build())
.networkInterfaces(List.of(InstanceNetworkInterfaceSpecificationProperty.builder()
.associatePublicIpAddress(false)
.deleteOnTermination(false)
.description("description")
.deviceIndex(123)
.groups(List.of("groups"))
.ipv6AddressCount(123)
.ipv6Addresses(List.of(InstanceIpv6AddressProperty.builder()
.ipv6Address("ipv6Address")
.build()))
.networkInterfaceId("networkInterfaceId")
.privateIpAddresses(List.of(PrivateIpAddressSpecificationProperty.builder()
.privateIpAddress("privateIpAddress")
// the properties below are optional
.primary(false)
.build()))
.secondaryPrivateIpAddressCount(123)
.subnetId("subnetId")
.build()))
.placement(SpotPlacementProperty.builder()
.availabilityZone("availabilityZone")
.availabilityZoneId("availabilityZoneId")
.groupName("groupName")
.tenancy("tenancy")
.build())
.ramdiskId("ramdiskId")
.securityGroups(List.of(GroupIdentifierProperty.builder()
.groupId("groupId")
.build()))
.spotPrice("spotPrice")
.subnetId("subnetId")
.tagSpecifications(List.of(SpotFleetTagSpecificationProperty.builder()
.resourceType("resourceType")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build()))
.userData("userData")
.weightedCapacity(123)
.build()))
.launchTemplateConfigs(List.of(LaunchTemplateConfigProperty.builder()
.launchTemplateSpecification(FleetLaunchTemplateSpecificationProperty.builder()
.version("version")
// the properties below are optional
.launchTemplateId("launchTemplateId")
.launchTemplateName("launchTemplateName")
.build())
.overrides(List.of(LaunchTemplateOverridesProperty.builder()
.availabilityZone("availabilityZone")
.availabilityZoneId("availabilityZoneId")
.instanceRequirements(InstanceRequirementsRequestProperty.builder()
.acceleratorCount(AcceleratorCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorManufacturers(List.of("acceleratorManufacturers"))
.acceleratorNames(List.of("acceleratorNames"))
.acceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorTypes(List.of("acceleratorTypes"))
.allowedInstanceTypes(List.of("allowedInstanceTypes"))
.bareMetal("bareMetal")
.baselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsRequestProperty.builder()
.max(123)
.min(123)
.build())
.baselinePerformanceFactors(BaselinePerformanceFactorsRequestProperty.builder()
.cpu(CpuPerformanceFactorRequestProperty.builder()
.references(List.of(PerformanceFactorReferenceRequestProperty.builder()
.instanceFamily("instanceFamily")
.build()))
.build())
.build())
.burstablePerformance("burstablePerformance")
.cpuManufacturers(List.of("cpuManufacturers"))
.excludedInstanceTypes(List.of("excludedInstanceTypes"))
.instanceGenerations(List.of("instanceGenerations"))
.localStorage("localStorage")
.localStorageTypes(List.of("localStorageTypes"))
.maxSpotPriceAsPercentageOfOptimalOnDemandPrice(123)
.memoryGiBPerVCpu(MemoryGiBPerVCpuRequestProperty.builder()
.max(123)
.min(123)
.build())
.memoryMiB(MemoryMiBRequestProperty.builder()
.max(123)
.min(123)
.build())
.networkBandwidthGbps(NetworkBandwidthGbpsRequestProperty.builder()
.max(123)
.min(123)
.build())
.networkInterfaceCount(NetworkInterfaceCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.onDemandMaxPricePercentageOverLowestPrice(123)
.requireEncryptionInTransit(false)
.requireHibernateSupport(false)
.spotMaxPricePercentageOverLowestPrice(123)
.totalLocalStorageGb(TotalLocalStorageGBRequestProperty.builder()
.max(123)
.min(123)
.build())
.vCpuCount(VCpuCountRangeRequestProperty.builder()
.max(123)
.min(123)
.build())
.build())
.instanceType("instanceType")
.priority(123)
.spotPrice("spotPrice")
.subnetId("subnetId")
.weightedCapacity(123)
.build()))
.build()))
.loadBalancersConfig(LoadBalancersConfigProperty.builder()
.classicLoadBalancersConfig(ClassicLoadBalancersConfigProperty.builder()
.classicLoadBalancers(List.of(ClassicLoadBalancerProperty.builder()
.name("name")
.build()))
.build())
.targetGroupsConfig(TargetGroupsConfigProperty.builder()
.targetGroups(List.of(TargetGroupProperty.builder()
.arn("arn")
.build()))
.build())
.build())
.onDemandAllocationStrategy("onDemandAllocationStrategy")
.onDemandMaxTotalPrice("onDemandMaxTotalPrice")
.onDemandTargetCapacity(123)
.replaceUnhealthyInstances(false)
.spotMaintenanceStrategies(SpotMaintenanceStrategiesProperty.builder()
.capacityRebalance(SpotCapacityRebalanceProperty.builder()
.replacementStrategy("replacementStrategy")
.terminationDelay(123)
.build())
.build())
.spotMaxTotalPrice("spotMaxTotalPrice")
.spotPrice("spotPrice")
.tagSpecifications(List.of(SpotFleetTagSpecificationProperty.builder()
.resourceType("resourceType")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build()))
.targetCapacityUnitType("targetCapacityUnitType")
.terminateInstancesWithExpiration(false)
.type("type")
.validFrom("validFrom")
.validUntil("validUntil")
.build())
// the properties below are optional
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// 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 cfnSpotFleetProps = new CfnSpotFleetProps {
SpotFleetRequestConfigData = new SpotFleetRequestConfigDataProperty {
IamFleetRole = "iamFleetRole",
TargetCapacity = 123,
// the properties below are optional
AllocationStrategy = "allocationStrategy",
Context = "context",
ExcessCapacityTerminationPolicy = "excessCapacityTerminationPolicy",
InstanceInterruptionBehavior = "instanceInterruptionBehavior",
InstancePoolsToUseCount = 123,
LaunchSpecifications = new [] { 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,
RequireEncryptionInTransit = false,
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",
AvailabilityZoneId = "availabilityZoneId",
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
} },
LaunchTemplateConfigs = new [] { new LaunchTemplateConfigProperty {
LaunchTemplateSpecification = new FleetLaunchTemplateSpecificationProperty {
Version = "version",
// the properties below are optional
LaunchTemplateId = "launchTemplateId",
LaunchTemplateName = "launchTemplateName"
},
Overrides = new [] { new LaunchTemplateOverridesProperty {
AvailabilityZone = "availabilityZone",
AvailabilityZoneId = "availabilityZoneId",
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,
RequireEncryptionInTransit = false,
RequireHibernateSupport = false,
SpotMaxPricePercentageOverLowestPrice = 123,
TotalLocalStorageGb = new TotalLocalStorageGBRequestProperty {
Max = 123,
Min = 123
},
VCpuCount = new VCpuCountRangeRequestProperty {
Max = 123,
Min = 123
}
},
InstanceType = "instanceType",
Priority = 123,
SpotPrice = "spotPrice",
SubnetId = "subnetId",
WeightedCapacity = 123
} }
} },
LoadBalancersConfig = new LoadBalancersConfigProperty {
ClassicLoadBalancersConfig = new ClassicLoadBalancersConfigProperty {
ClassicLoadBalancers = new [] { new ClassicLoadBalancerProperty {
Name = "name"
} }
},
TargetGroupsConfig = new TargetGroupsConfigProperty {
TargetGroups = new [] { new TargetGroupProperty {
Arn = "arn"
} }
}
},
OnDemandAllocationStrategy = "onDemandAllocationStrategy",
OnDemandMaxTotalPrice = "onDemandMaxTotalPrice",
OnDemandTargetCapacity = 123,
ReplaceUnhealthyInstances = false,
SpotMaintenanceStrategies = new SpotMaintenanceStrategiesProperty {
CapacityRebalance = new SpotCapacityRebalanceProperty {
ReplacementStrategy = "replacementStrategy",
TerminationDelay = 123
}
},
SpotMaxTotalPrice = "spotMaxTotalPrice",
SpotPrice = "spotPrice",
TagSpecifications = new [] { new SpotFleetTagSpecificationProperty {
ResourceType = "resourceType",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
} },
TargetCapacityUnitType = "targetCapacityUnitType",
TerminateInstancesWithExpiration = false,
Type = "type",
ValidFrom = "validFrom",
ValidUntil = "validUntil"
},
// the properties below are optional
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
cfnSpotFleetProps := &CfnSpotFleetProps{
SpotFleetRequestConfigData: &SpotFleetRequestConfigDataProperty{
IamFleetRole: jsii.String("iamFleetRole"),
TargetCapacity: jsii.Number(123),
// the properties below are optional
AllocationStrategy: jsii.String("allocationStrategy"),
Context: jsii.String("context"),
ExcessCapacityTerminationPolicy: jsii.String("excessCapacityTerminationPolicy"),
InstanceInterruptionBehavior: jsii.String("instanceInterruptionBehavior"),
InstancePoolsToUseCount: jsii.Number(123),
LaunchSpecifications: []interface{}{
&SpotFleetLaunchSpecificationProperty{
ImageId: jsii.String("imageId"),
// the properties below are optional
BlockDeviceMappings: []interface{}{
&BlockDeviceMappingProperty{
DeviceName: jsii.String("deviceName"),
// the properties below are optional
Ebs: &EbsBlockDeviceProperty{
DeleteOnTermination: jsii.Boolean(false),
Encrypted: jsii.Boolean(false),
Iops: jsii.Number(123),
SnapshotId: jsii.String("snapshotId"),
VolumeSize: jsii.Number(123),
VolumeType: jsii.String("volumeType"),
},
NoDevice: jsii.String("noDevice"),
VirtualName: jsii.String("virtualName"),
},
},
EbsOptimized: jsii.Boolean(false),
IamInstanceProfile: &IamInstanceProfileSpecificationProperty{
Arn: jsii.String("arn"),
},
InstanceRequirements: &InstanceRequirementsRequestProperty{
AcceleratorCount: &AcceleratorCountRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
AcceleratorManufacturers: []*string{
jsii.String("acceleratorManufacturers"),
},
AcceleratorNames: []*string{
jsii.String("acceleratorNames"),
},
AcceleratorTotalMemoryMiB: &AcceleratorTotalMemoryMiBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
AcceleratorTypes: []*string{
jsii.String("acceleratorTypes"),
},
AllowedInstanceTypes: []*string{
jsii.String("allowedInstanceTypes"),
},
BareMetal: jsii.String("bareMetal"),
BaselineEbsBandwidthMbps: &BaselineEbsBandwidthMbpsRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
BaselinePerformanceFactors: &BaselinePerformanceFactorsRequestProperty{
Cpu: &CpuPerformanceFactorRequestProperty{
References: []interface{}{
&PerformanceFactorReferenceRequestProperty{
InstanceFamily: jsii.String("instanceFamily"),
},
},
},
},
BurstablePerformance: jsii.String("burstablePerformance"),
CpuManufacturers: []*string{
jsii.String("cpuManufacturers"),
},
ExcludedInstanceTypes: []*string{
jsii.String("excludedInstanceTypes"),
},
InstanceGenerations: []*string{
jsii.String("instanceGenerations"),
},
LocalStorage: jsii.String("localStorage"),
LocalStorageTypes: []*string{
jsii.String("localStorageTypes"),
},
MaxSpotPriceAsPercentageOfOptimalOnDemandPrice: jsii.Number(123),
MemoryGiBPerVCpu: &MemoryGiBPerVCpuRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
MemoryMiB: &MemoryMiBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
NetworkBandwidthGbps: &NetworkBandwidthGbpsRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
NetworkInterfaceCount: &NetworkInterfaceCountRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
OnDemandMaxPricePercentageOverLowestPrice: jsii.Number(123),
RequireEncryptionInTransit: jsii.Boolean(false),
RequireHibernateSupport: jsii.Boolean(false),
SpotMaxPricePercentageOverLowestPrice: jsii.Number(123),
TotalLocalStorageGb: &TotalLocalStorageGBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
VCpuCount: &VCpuCountRangeRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
},
InstanceType: jsii.String("instanceType"),
KernelId: jsii.String("kernelId"),
KeyName: jsii.String("keyName"),
Monitoring: &SpotFleetMonitoringProperty{
Enabled: jsii.Boolean(false),
},
NetworkInterfaces: []interface{}{
&InstanceNetworkInterfaceSpecificationProperty{
AssociatePublicIpAddress: jsii.Boolean(false),
DeleteOnTermination: jsii.Boolean(false),
Description: jsii.String("description"),
DeviceIndex: jsii.Number(123),
Groups: []*string{
jsii.String("groups"),
},
Ipv6AddressCount: jsii.Number(123),
Ipv6Addresses: []interface{}{
&InstanceIpv6AddressProperty{
Ipv6Address: jsii.String("ipv6Address"),
},
},
NetworkInterfaceId: jsii.String("networkInterfaceId"),
PrivateIpAddresses: []interface{}{
&PrivateIpAddressSpecificationProperty{
PrivateIpAddress: jsii.String("privateIpAddress"),
// the properties below are optional
Primary: jsii.Boolean(false),
},
},
SecondaryPrivateIpAddressCount: jsii.Number(123),
SubnetId: jsii.String("subnetId"),
},
},
Placement: &SpotPlacementProperty{
AvailabilityZone: jsii.String("availabilityZone"),
AvailabilityZoneId: jsii.String("availabilityZoneId"),
GroupName: jsii.String("groupName"),
Tenancy: jsii.String("tenancy"),
},
RamdiskId: jsii.String("ramdiskId"),
SecurityGroups: []interface{}{
&GroupIdentifierProperty{
GroupId: jsii.String("groupId"),
},
},
SpotPrice: jsii.String("spotPrice"),
SubnetId: jsii.String("subnetId"),
TagSpecifications: []interface{}{
&SpotFleetTagSpecificationProperty{
ResourceType: jsii.String("resourceType"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
},
},
UserData: jsii.String("userData"),
WeightedCapacity: jsii.Number(123),
},
},
LaunchTemplateConfigs: []interface{}{
&LaunchTemplateConfigProperty{
LaunchTemplateSpecification: &FleetLaunchTemplateSpecificationProperty{
Version: jsii.String("version"),
// the properties below are optional
LaunchTemplateId: jsii.String("launchTemplateId"),
LaunchTemplateName: jsii.String("launchTemplateName"),
},
Overrides: []interface{}{
&LaunchTemplateOverridesProperty{
AvailabilityZone: jsii.String("availabilityZone"),
AvailabilityZoneId: jsii.String("availabilityZoneId"),
InstanceRequirements: &InstanceRequirementsRequestProperty{
AcceleratorCount: &AcceleratorCountRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
AcceleratorManufacturers: []*string{
jsii.String("acceleratorManufacturers"),
},
AcceleratorNames: []*string{
jsii.String("acceleratorNames"),
},
AcceleratorTotalMemoryMiB: &AcceleratorTotalMemoryMiBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
AcceleratorTypes: []*string{
jsii.String("acceleratorTypes"),
},
AllowedInstanceTypes: []*string{
jsii.String("allowedInstanceTypes"),
},
BareMetal: jsii.String("bareMetal"),
BaselineEbsBandwidthMbps: &BaselineEbsBandwidthMbpsRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
BaselinePerformanceFactors: &BaselinePerformanceFactorsRequestProperty{
Cpu: &CpuPerformanceFactorRequestProperty{
References: []interface{}{
&PerformanceFactorReferenceRequestProperty{
InstanceFamily: jsii.String("instanceFamily"),
},
},
},
},
BurstablePerformance: jsii.String("burstablePerformance"),
CpuManufacturers: []*string{
jsii.String("cpuManufacturers"),
},
ExcludedInstanceTypes: []*string{
jsii.String("excludedInstanceTypes"),
},
InstanceGenerations: []*string{
jsii.String("instanceGenerations"),
},
LocalStorage: jsii.String("localStorage"),
LocalStorageTypes: []*string{
jsii.String("localStorageTypes"),
},
MaxSpotPriceAsPercentageOfOptimalOnDemandPrice: jsii.Number(123),
MemoryGiBPerVCpu: &MemoryGiBPerVCpuRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
MemoryMiB: &MemoryMiBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
NetworkBandwidthGbps: &NetworkBandwidthGbpsRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
NetworkInterfaceCount: &NetworkInterfaceCountRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
OnDemandMaxPricePercentageOverLowestPrice: jsii.Number(123),
RequireEncryptionInTransit: jsii.Boolean(false),
RequireHibernateSupport: jsii.Boolean(false),
SpotMaxPricePercentageOverLowestPrice: jsii.Number(123),
TotalLocalStorageGb: &TotalLocalStorageGBRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
VCpuCount: &VCpuCountRangeRequestProperty{
Max: jsii.Number(123),
Min: jsii.Number(123),
},
},
InstanceType: jsii.String("instanceType"),
Priority: jsii.Number(123),
SpotPrice: jsii.String("spotPrice"),
SubnetId: jsii.String("subnetId"),
WeightedCapacity: jsii.Number(123),
},
},
},
},
LoadBalancersConfig: &LoadBalancersConfigProperty{
ClassicLoadBalancersConfig: &ClassicLoadBalancersConfigProperty{
ClassicLoadBalancers: []interface{}{
&ClassicLoadBalancerProperty{
Name: jsii.String("name"),
},
},
},
TargetGroupsConfig: &TargetGroupsConfigProperty{
TargetGroups: []interface{}{
&TargetGroupProperty{
Arn: jsii.String("arn"),
},
},
},
},
OnDemandAllocationStrategy: jsii.String("onDemandAllocationStrategy"),
OnDemandMaxTotalPrice: jsii.String("onDemandMaxTotalPrice"),
OnDemandTargetCapacity: jsii.Number(123),
ReplaceUnhealthyInstances: jsii.Boolean(false),
SpotMaintenanceStrategies: &SpotMaintenanceStrategiesProperty{
CapacityRebalance: &SpotCapacityRebalanceProperty{
ReplacementStrategy: jsii.String("replacementStrategy"),
TerminationDelay: jsii.Number(123),
},
},
SpotMaxTotalPrice: jsii.String("spotMaxTotalPrice"),
SpotPrice: jsii.String("spotPrice"),
TagSpecifications: []interface{}{
&SpotFleetTagSpecificationProperty{
ResourceType: jsii.String("resourceType"),
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
},
},
TargetCapacityUnitType: jsii.String("targetCapacityUnitType"),
TerminateInstancesWithExpiration: jsii.Boolean(false),
Type: jsii.String("type"),
ValidFrom: jsii.String("validFrom"),
ValidUntil: jsii.String("validUntil"),
},
// the properties below are optional
Tags: []CfnTag{
&CfnTag{
Key: jsii.String("key"),
Value: jsii.String("value"),
},
},
}
Properties
spotFleetRequestConfigDataIResolvable | CfnSpotFleet.spot_fleet_request_config_datatyping.Union[IResolvable, SpotFleetRequestConfigDataProperty]spotFleetRequestConfigDataIResolvableSpotFleetRequestConfigDataIResolvableSpotFleetRequestConfigDatainterface{} required #Describes the configuration of a Spot Fleet request.