---
title: DigitalOcean Terraform Provider Reference
description: A complete reference for the DigitalOcean Terraform provider.
product: Reference
url: https://docs.digitalocean.com/reference/terraform/reference/
last_updated: "2026-11-05"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# DigitalOcean Terraform Provider Reference

Generated on 5 Nov 2026 from Terraform version [`v2.107.0`](https://github.com/digitalocean/terraform-provider-digitalocean/releases/tag/v2.107.0)

The DigitalOcean Terraform provider is used to interact with the resources supported by DigitalOcean. The provider needs to be configured with the proper credentials before it can be used.

For a step-by-step guide to installing and configuring Terraform, please see [How to Configure Terraform for DigitalOcean](https://docs.digitalocean.com/reference/terraform/getting-started/index.html.md).

## Example Usage

```hcl
terraform {
  required_providers {
    digitalocean = {
      source = "digitalocean/digitalocean"
      version = "~> 2.0"
    }
  }
}

# Set the variable value in *.tfvars file
# or using -var="do_token=..." CLI option
variable "do_token" {}

# Configure the DigitalOcean Provider
provider "digitalocean" {
  token = var.do_token
}

# Create a web server
resource "digitalocean_droplet" "web" {
  # ...
}
```

## Argument Reference

The following arguments are supported:

- `token` - (Required) This is the DO API token. Alternatively, this can also be specified using environment variables ordered by precedence:

  - `DIGITALOCEAN_TOKEN`
  - `DIGITALOCEAN_ACCESS_TOKEN`
- `spaces_access_id` - (Optional) The access key ID used for Spaces API operations (Defaults to the value of the `SPACES_ACCESS_KEY_ID` environment variable).
- `spaces_secret_key` - (Optional) The secret access key used for Spaces API operations (Defaults to the value of the `SPACES_SECRET_ACCESS_KEY` environment variable).
- `api_endpoint` - (Optional) This can be used to override the base URL for DigitalOcean API requests (Defaults to the value of the `DIGITALOCEAN_API_URL` environment variable or `https://api.digitalocean.com` if unset).
- `spaces_endpoint` - (Optional) This can be used to override the endpoint URL used for DigitalOcean Spaces requests. (It defaults to the value of the `SPACES_ENDPOINT_URL` environment variable or `https://{{.Region}}.digitaloceanspaces.com` if unset.) The provider will replace `{{.Region}}` (via Go’s templating engine) with the slug of the applicable Spaces region.
- `requests_per_second` - (Optional) This can be used to enable throttling, overriding the limit of API calls per second to avoid rate limit errors, can be disabled by setting the value to `0.0` (Defaults to the value of the `DIGITALOCEAN_REQUESTS_PER_SECOND` environment variable or `0.0` if unset).
- `http_retry_max` - (Optional) This can be used to override the maximum number of retries on a failed API request (client errors, 429, 500, 502…), the exponential backoff can be configured by the `http_retry_wait_min` and `http_retry_wait_max` arguments (Defaults to the value of the `DIGITALOCEAN_HTTP_RETRY_MAX` environment variable or `4` if unset).
- `http_retry_wait_min` - (Optional) This can be used to configure the minimum waiting time (**in seconds**) between failed requests for the backoff strategy (Defaults to the value of the `DIGITALOCEAN_HTTP_RETRY_WAIT_MIN` environment variable or `1.0` if unset).
- `http_retry_wait_max` - (Optional) This can be used to configure the maximum waiting time (**in seconds**) between failed requests for the backoff strategy (Defaults to the value of the `DIGITALOCEAN_HTTP_RETRY_WAIT_MAX` environment variable or `30.0` if unset).

## Resources and Data Sources

The following resources and data sources are available:

[Resources Reference for the DigitalOcean Terraform Provider](https://docs.digitalocean.com/reference/terraform/reference/resources/index.html.md): A complete reference for every resource available to the DigitalOcean Terraform provider.

[Data Sources Reference for the DigitalOcean Terraform Provider](https://docs.digitalocean.com/reference/terraform/reference/data-sources/index.html.md): A complete reference for every data source available to the DigitalOcean Terraform provider.