liveBook · Manning

Spot fleet request

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

A Spot Fleet request is an EC2 request for a specified target capacity of Spot Instances selected from one or more instance types.

A Spot Fleet request asks EC2 for a target capacity of Spot Instances, choosing from one or more instance types. Spot capacity can reduce costs, but AWS may interrupt an instance with two minutes’ notice. section 3.8.2

Create a small Spot Fleet request through the EC2 console:

  • Select the ec2-ssm-core IAM instance profile and keep the default additional request settings. section 3.8.2
  • Set target capacity to one instance, manually select instance types, remove the defaults, and add t2.micro. section 3.8.2
  • Choose the Capacity Optimized allocation strategy, launch the request, and wait until the fleet request and instance are Fulfilled. section 3.8.2

Check for an interruption

From the instance through Session Manager, query the EC2 metadata endpoint at 169.254.169.254/latest/meta-data/spot/instance-action. A 404 response indicates no planned termination; a response containing an action and time indicates termination within two minutes. section 3.8.2

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Explains console configuration, fulfillment checks, interruption timing, and metadata inspection without detailing fleet APIs.
Examples
Demonstrates a one-instance t2.micro fleet using Capacity Optimized allocation and metadata-based interruption checking.
What it assumes
Assumes access to the EC2 console and an IAM instance profile that permits Session Manager connections.
What you can do after
Operate/configure a one-instance Spot Fleet request and detect whether AWS has scheduled its interruption.
How it connects
Connects EC2, Spot Instances, IAM instance profiles, Session Manager, and the EC2 metadata service.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.