aws-cdk-lib.aws_ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty

interface SpotFleetLaunchSpecificationProperty

LanguageType name
.NETAmazon.CDK.AWS.EC2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#CfnSpotFleet_SpotFleetLaunchSpecificationProperty
Javasoftware.amazon.awscdk.services.ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty
Pythonaws_cdk.aws_ec2.CfnSpotFleet.SpotFleetLaunchSpecificationProperty
TypeScript aws-cdk-lib » 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 { aws_ec2 as ec2 } from 'aws-cdk-lib';
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

NameTypeDescription
imageIdstringThe ID of the AMI.
blockDeviceMappings?IResolvable | IResolvable | BlockDeviceMappingProperty[]One or more block devices that are mapped to the Spot Instances.
ebsOptimized?boolean | IResolvableIndicates whether the instances are optimized for EBS I/O.
iamInstanceProfile?IResolvable | IamInstanceProfileSpecificationPropertyThe IAM instance profile.
instanceRequirements?IResolvable | InstanceRequirementsRequestPropertyThe attributes for the instance types.
instanceType?stringThe instance type.
kernelId?stringThe ID of the kernel.
keyName?stringThe name of the key pair.
monitoring?IResolvable | SpotFleetMonitoringPropertyEnable or disable monitoring for the instances.
networkInterfaces?IResolvable | IResolvable | InstanceNetworkInterfaceSpecificationProperty[]One or more network interfaces.
placement?IResolvable | SpotPlacementPropertyThe placement information.
ramdiskId?stringThe ID of the RAM disk.
securityGroups?IResolvable | IResolvable | GroupIdentifierProperty[]The security groups.
spotPrice?stringThe maximum price per unit hour that you are willing to pay for a Spot Instance.
subnetId?stringThe IDs of the subnets in which to launch the instances.
tagSpecifications?IResolvable | IResolvable | SpotFleetTagSpecificationProperty[]The tags to apply during creation.
userData?stringThe base64-encoded user data that instances use when starting up.
weightedCapacity?numberThe number of units provided by the specified instance type.

imageId

Type: string

The ID of the AMI.


blockDeviceMappings?

Type: IResolvable | IResolvable | BlockDeviceMappingProperty[] (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 | IamInstanceProfileSpecificationProperty (optional)

The IAM instance profile.


instanceRequirements?

Type: IResolvable | InstanceRequirementsRequestProperty (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 specify InstanceType .


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 | SpotFleetMonitoringProperty (optional)

Enable or disable monitoring for the instances.


networkInterfaces?

Type: IResolvable | IResolvable | InstanceNetworkInterfaceSpecificationProperty[] (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 | SpotPlacementProperty (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 | GroupIdentifierProperty[] (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 | SpotFleetTagSpecificationProperty[] (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.