> 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

Create Autoscaling Groups (ASG) with Spot Instances in the DuploCloud platform

[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="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2F79BDIK5c0FTrb0c1GyD9%2Fspot%20instances%20screen%20shot.png?alt=media&amp;token=9c5c48bf-6fe6-4893-b191-7c7750e4e1fa" 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="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FuRClMMplfyqtdf4wulhj%2Fadd%20service%20basic.png?alt=media&amp;token=beebcea3-c6c8-4746-a336-1897dcea078e" 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="https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2FiFXqTl7jcRBJg8IPTO2D%2Freplacement%20shot.png?alt=media&amp;token=ad4fa53d-4c3b-469b-948f-247ac5092837" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
