# 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)](https://docs.duplocloud.com/docs/automation-platform/overview/use-cases/hosts-vms/auto-scaling/auto-scaling-groups/..#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.&#x20;

<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&#x26;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](https://docs.duplocloud.com/docs/automation-platform/overview/use-cases/hosts-vms/auto-scaling/auto-scaling-groups/..#creating-services-using-autoscaling-groups). In the **Add Service** page, **Basic Options**, Select **Tolerate spot instances**.&#x20;

<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&#x26;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. &#x20;

<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&#x26;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>
