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
