> For the complete documentation index, see [llms.txt](https://docs.duplocloud.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplocloud.com/docs/automation-platform/overview/use-cases/hosts-vms/auto-scaling/auto-scaling-groups/spot-instances.md).

# Spot Instances for AWS

[Spot Instances](https://aws.amazon.com/tutorials/ec2-auto-scaling-spot-instances/) are spare capacity priced at a significant discount compared to On-Demand Instances. Users specify the maximum price (bid) they will pay per hour for a Spot Instance. The instance is launched if the current Spot price is below the user's bid. Since Spot Instances can be interrupted when spare capacity is unavailable, applications using Spot Instances must be fault-tolerant and able to handle interruptions.

{% hint style="info" %}
Spot Instances are only supported for Auto-scaling Groups (ASG) with EKS
{% endhint %}

## Enabling Spot Instances when Creating Autoscaling Groups

Follow the steps in the section [Creating Autoscaling Groups (ASG)](/docs/automation-platform/overview/use-cases/hosts-vms/auto-scaling/auto-scaling-groups.md#creating-autoscaling-groups-asg). Before clicking **Add**, Click the box to access **Advanced Options**. Enable **Use Spot Instances** and enter your bid, in dollars, in the **Maximum Spot Price** field.

<div align="left"><figure><img src="/files/P8i4oXvHWS5NFtNr0bg8" alt=""><figcaption><p>The <strong>Add ASG</strong> page with <strong>Use Spot Instances</strong> enabled and a <strong>Maximum Spot Price</strong> entered.</p></figcaption></figure></div>

## Creating Services using Spot Instances

Follow the steps in [Creating Services using Autoscaling Groups](/docs/automation-platform/overview/use-cases/hosts-vms/auto-scaling/auto-scaling-groups.md#creating-services-using-autoscaling-groups). In the **Add Service** page, **Basic Options**, Select **Tolerate spot instances**.

<div align="left"><figure><img src="/files/fNXWbNQ1Mr3w8KEaVjRt" alt=""><figcaption><p>The <strong>Add Service</strong> page with <strong>Tolerate spot instances</strong> enabled.</p></figcaption></figure></div>

Tolerations will be entered by default in the **Add Service** page, **Advanced Options, Other Container Config** field.

<div align="left"><figure><img src="/files/sxle3x3WqiqbSUfScQvO" alt=""><figcaption><p>The <strong>Add Service</strong> page, <strong>Advanced Options</strong>, with tolerations shown in the <strong>Other Container Config</strong> field.</p></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.duplocloud.com/docs/automation-platform/overview/use-cases/hosts-vms/auto-scaling/auto-scaling-groups/spot-instances.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
