- Newest
- Most votes
- Most comments
Please note that Spot Fleet is a legacy API with no planned investment. Please consult the following documentation to learn about the recommended APIs to use: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/which-fleet-method-to-use.html
While you can create a Spot Fleet request that includes only On-Demand Instances, this approach doesn't align with the primary purpose of Spot Fleet, which is designed to help you leverage Spot Instances alongside On-Demand Instances.
Spot Fleet allows you to specify a mix of On-Demand and Spot Instances. You can configure your Spot Fleet request to include a specific amount of On-Demand capacity by setting the "OnDemandTargetCapacity" parameter. For example, you could set your total target capacity to 10 and your On-Demand target capacity to 10, which would effectively create a fleet of only On-Demand Instances.
However, if you're specifically looking to launch only On-Demand Instances, there are more appropriate AWS services to use:
-
For simple one-time launches, the EC2 RunInstances API is more straightforward.
-
For managed instance lifecycle, Amazon EC2 Auto Scaling would be more appropriate.
-
If you still prefer the Fleet approach, EC2 Fleet with type "instant" can be used to launch On-Demand Instances and provides more capabilities than the RunInstances API.
Remember that the main benefit of Spot Fleet is the ability to combine On-Demand and Spot Instances to optimize for cost and availability. Using it solely for On-Demand Instances doesn't leverage its key advantages.
Sources
Example CLI configurations Spot Fleet - Amazon Elastic Compute Cloud
Configure an EC2 Fleet of type instant - Amazon Elastic Compute Cloud
Best practices for Amazon EC2 Spot - Amazon Elastic Compute Cloud
Relevant content
- asked 3 years ago
- asked 3 years ago
- asked 4 years ago
