Skip to content
v2.275.0

FleetLaunchTemplateOverridesRequestProperty Struct ​

Specifies overrides for a launch template for an EC2 Fleet.

FleetLaunchTemplateOverridesRequest is a property of the FleetLaunchTemplateConfigRequest property type.

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 fleetLaunchTemplateOverridesRequestProperty: ec2.CfnEC2Fleet.FleetLaunchTemplateOverridesRequestProperty = {
  availabilityZone: 'availabilityZone',
  availabilityZoneId: 'availabilityZoneId',
  blockDeviceMappings: [{
    deviceName: 'deviceName',
    ebs: {
      deleteOnTermination: false,
      encrypted: false,
      iops: 123,
      kmsKeyId: 'kmsKeyId',
      multiAvailabilityZoneConfiguration: {
        configurationType: 'configurationType',
        standbyAvailabilityZones: [{
          availabilityZone: 'availabilityZone',
          availabilityZoneId: 'availabilityZoneId',
        }],
      },
      snapshotId: 'snapshotId',
      volumeSize: 123,
      volumeType: 'volumeType',
    },
    noDevice: 'noDevice',
    virtualName: 'virtualName',
  }],
  iamInstanceProfile: {
    arn: 'arn',
    name: 'name',
  },
  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',
  keyName: 'keyName',
  maxPrice: 'maxPrice',
  metadataOptions: {
    httpEndpoint: 'httpEndpoint',
    httpPutResponseHopLimit: 123,
    httpTokens: 'httpTokens',
  },
  networkInterfaces: [{
    associatePublicIpAddress: false,
    deleteOnTermination: false,
    description: 'description',
    deviceIndex: 123,
    groups: ['groups'],
    interfaceType: 'interfaceType',
    ipv6AddressCount: 123,
    ipv6Addresses: [{
      ipv6Address: 'ipv6Address',
    }],
    networkCardIndex: 123,
    networkInterfaceId: 'networkInterfaceId',
    privateIpAddress: 'privateIpAddress',
    privateIpAddresses: [{
      primary: false,
      privateIpAddress: 'privateIpAddress',
    }],
    secondaryPrivateIpAddressCount: 123,
    subnetId: 'subnetId',
  }],
  placement: {
    affinity: 'affinity',
    availabilityZone: 'availabilityZone',
    groupName: 'groupName',
    hostId: 'hostId',
    hostResourceGroupArn: 'hostResourceGroupArn',
    partitionNumber: 123,
    spreadDomain: 'spreadDomain',
    tenancy: 'tenancy',
  },
  priority: 123,
  subnetId: 'subnetId',
  weightedCapacity: 123,
};

Properties ​

availabilityZoneoptionalstringavailability_zoneoptionalstravailabilityZoneoptionalStringAvailabilityZoneoptionalstringAvailabilityZoneoptional*string#
The Availability Zone in which to launch the instances. For example, `us-east-2a` .

Either AvailabilityZone or AvailabilityZoneId must be specified in the request, but not both.

availabilityZoneIdoptionalstringavailability_zone_idoptionalstravailabilityZoneIdoptionalStringAvailabilityZoneIdoptionalstringAvailabilityZoneIdoptional*string#
The ID of the Availability Zone in which to launch the instances. For example, `use2-az1` .

Either AvailabilityZone or AvailabilityZoneId must be specified in the request, but not both.

blockDeviceMappingsoptionalIResolvable | IResolvable | CfnEC2Fleet.BlockDeviceMappingProperty[]block_device_mappingsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, BlockDeviceMappingProperty]]]blockDeviceMappingsoptionalIResolvableBlockDeviceMappingsoptionalIResolvableBlockDeviceMappingsoptionalinterface{}#
The block device mappings, which define the EBS volumes and instance store volumes to attach to the instance at launch.
notes

Supported only for fleets of type instant .

For more information, see Block device mappings for volumes on Amazon EC2 instances in the Amazon EC2 User Guide .

iamInstanceProfileoptionalIResolvable | CfnEC2Fleet.IamInstanceProfileSpecificationPropertyiam_instance_profileoptionaltyping.Union[IResolvable, IamInstanceProfileSpecificationProperty]iamInstanceProfileoptionalIResolvableIamInstanceProfileoptionalIResolvableIamInstanceProfileoptionalinterface{}#
instanceRequirementsoptionalIResolvable | CfnEC2Fleet.InstanceRequirementsRequestPropertyinstance_requirementsoptionaltyping.Union[IResolvable, InstanceRequirementsRequestProperty]instanceRequirementsoptionalIResolvableInstanceRequirementsoptionalIResolvableInstanceRequirementsoptionalinterface{}#
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 .

instanceTypeoptionalstringinstance_typeoptionalstrinstanceTypeoptionalStringInstanceTypeoptionalstringInstanceTypeoptional*string#
The instance type.

mac1.metal is not supported as a launch template override.

If you specify InstanceType , you can't specify InstanceRequirements .

keyNameoptionalstringkey_nameoptionalstrkeyNameoptionalStringKeyNameoptionalstringKeyNameoptional*string#
maxPriceoptionalstringmax_priceoptionalstrmaxPriceoptionalStringMaxPriceoptionalstringMaxPriceoptional*string#
The maximum price per unit hour that you are willing to pay for a Spot Instance.
notes

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.

If you specify a maximum price, it must be more than USD $0.001. Specifying a value below USD $0.001 will result in an InvalidParameterValue error message.

metadataOptionsoptionalIResolvable | CfnEC2Fleet.InstanceMetadataOptionsRequestPropertymetadata_optionsoptionaltyping.Union[IResolvable, InstanceMetadataOptionsRequestProperty]metadataOptionsoptionalIResolvableMetadataOptionsoptionalIResolvableMetadataOptionsoptionalinterface{}#
networkInterfacesoptionalIResolvable | IResolvable | CfnEC2Fleet.NetworkInterfaceSpecificationRequestProperty[]network_interfacesoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, NetworkInterfaceSpecificationRequestProperty]]]networkInterfacesoptionalIResolvableNetworkInterfacesoptionalIResolvableNetworkInterfacesoptionalinterface{}#
placementoptionalIResolvable | CfnEC2Fleet.PlacementPropertyplacementoptionaltyping.Union[IResolvable, PlacementProperty]placementoptionalIResolvablePlacementoptionalIResolvablePlacementoptionalinterface{}#
The location where the instance launched, if applicable.
priorityoptionalnumberpriorityoptionalint | floatpriorityoptionalNumberPriorityoptionaldoublePriorityoptional*float64#
The priority for the launch template override. The highest priority is launched first.
notes

If the On-Demand AllocationStrategy is set to prioritized , EC2 Fleet uses priority to determine which launch template override to use first in fulfilling On-Demand capacity.

If the Spot AllocationStrategy is set to capacity-optimized-prioritized , EC2 Fleet uses priority on a best-effort basis to determine which launch template override to use in fulfilling Spot capacity, but optimizes for capacity first.

Valid values are whole numbers starting at 0 . The lower the number, the higher the priority. If no number is set, the launch template override has the lowest priority. You can set the same priority for different launch template overrides.

subnetIdoptionalstringsubnet_idoptionalstrsubnetIdoptionalStringSubnetIdoptionalstringSubnetIdoptional*string#
The IDs of the subnets in which to launch the instances.

Separate multiple subnet IDs using commas (for example, subnet-1234abcdeexample1, subnet-0987cdef6example2 ). A request of type instant can have only one subnet ID.

weightedCapacityoptionalnumberweighted_capacityoptionalint | floatweightedCapacityoptionalNumberWeightedCapacityoptionaldoubleWeightedCapacityoptional*float64#
The number of units provided by the specified instance type.
notes

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 lowest-price and price-capacity-optimized 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.