This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html). # AWS::EC2::EC2Fleet TargetCapacitySpecificationRequest 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. ## Syntax To declare this entity in your CloudFormation template, use the following syntax: ### JSON ``` { "[DefaultTargetCapacityType](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-defaulttargetcapacitytype)" : {{String}}, "[OnDemandTargetCapacity](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-ondemandtargetcapacity)" : {{Integer}}, "[SpotTargetCapacity](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-spottargetcapacity)" : {{Integer}}, "[TargetCapacityUnitType](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-targetcapacityunittype)" : {{String}}, "[TotalTargetCapacity](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-totaltargetcapacity)" : {{Integer}} } ``` ### YAML ``` [DefaultTargetCapacityType](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-defaulttargetcapacitytype): {{String}} [OnDemandTargetCapacity](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-ondemandtargetcapacity): {{Integer}} [SpotTargetCapacity](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-spottargetcapacity): {{Integer}} [TargetCapacityUnitType](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-targetcapacityunittype): {{String}} [TotalTargetCapacity](#cfn-ec2-ec2fleet-targetcapacityspecificationrequest-totaltargetcapacity): {{Integer}} ``` ## Properties `DefaultTargetCapacityType` The default target capacity type. *Required*: No *Type*: String *Allowed values*: `on-demand | spot | capacity-block | reserved-capacity` *Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) `OnDemandTargetCapacity` The number of On-Demand units to request. *Required*: No *Type*: Integer *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) `SpotTargetCapacity` The number of Spot units to request. *Required*: No *Type*: Integer *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) `TargetCapacityUnitType` 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) *Required*: No *Type*: String *Allowed values*: `vcpu | memory-mib | units` *Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) `TotalTargetCapacity` The number of units to request, filled using the default target capacity type. *Required*: Yes *Type*: Integer *Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt) ## See also + [ TargetCapacitySpecificationRequest](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TargetCapacitySpecificationRequest.html) in the *Amazon EC2 API Reference*