# TargetCapacitySpecificationRequestProperty

Specifies the number of units to request for an EC2 Fleet.

You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is `maintain` , you can specify a target capacity of `0` and add capacity later.

`TargetCapacitySpecificationRequest` is a property of the [AWS::EC2::EC2Fleet](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-ec2fleet.html) resource.

- Source: Generated code
- Type last changed: v2.93.0 · 23 Aug 2023

## 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 targetCapacitySpecificationRequestProperty: ec2.CfnEC2Fleet.TargetCapacitySpecificationRequestProperty = {
  totalTargetCapacity: 123,

  // the properties below are optional
  defaultTargetCapacityType: 'defaultTargetCapacityType',
  onDemandTargetCapacity: 123,
  spotTargetCapacity: 123,
  targetCapacityUnitType: 'targetCapacityUnitType',
};
```

## Properties

- `defaultTargetCapacityType`: string — The default target capacity type.

- `onDemandTargetCapacity`: number — The number of On-Demand units to request.

- `spotTargetCapacity`: number — The number of Spot units to request.

- `targetCapacityUnitType`: string — The unit for the target capacity. You can specify this parameter only when using attributed-based instance type selection.

  Default: `units` (the number of instances)

- `totalTargetCapacity`: number (required) — The number of units to request, filled using the default target capacity type.
