# OVHcloud Terraform provider

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

The OVH provider is the entry point to interact with the resources provided by OVHcloud.

Latest release v2.22.0 Oct 2, 2026 [GitHub](https://github.com/ovh/terraform-provider-ovh/releases)

```
1# OAuth22terraform {3  required_providers {4    ovh = {5      source = "ovh/ovh"6    }7  }8}9 10provider "ovh" {11  endpoint      = "ovh-eu"12  client_id     = "xxxxxxxxx"13  client_secret = "yyyyyyyyy"14}
```

Quoted from [the provider's documentation](https://registry.terraform.io/providers/ovh/ovh/latest/docs)

[registry.terraform.io/providers/ovh/ovh](https://registry.terraform.io/providers/ovh/ovh/latest) [github.com/ovh/terraform-provider-ovh](https://github.com/ovh/terraform-provider-ovh)

## Configure

The provider needs to be configured with the proper credentials before it can be used. Three forms of authentication are supported:

OAuth2

OAuth2, using scoped service accounts, and compatible with OVHcloud IAM. First, generate a pair of valid client_id and client_secret. [Create a service account](https://help.ovhcloud.com/csm/en-manage-service-account?id=kb_article_view&sysparm_article=KB0059343).

```terraform
terraform {
  required_providers {
    ovh = {
      source = "ovh/ovh"
    }
  }
}

provider "ovh" {
  endpoint      = "ovh-eu"
  client_id     = "xxxxxxxxx"
  client_secret = "yyyyyyyyy"
}
```

Access token

A short-lived access token received from the OVHcloud API. The provider looks for it in the OVH_ACCESS_TOKEN environment variable, or in the access_token argument; the endpoint is set the same way.

```terraform
provider "ovh" {
  endpoint     = "ovh-eu"
  access_token = "xxxxxxxxx"
}
```

Application key

An application key, an application secret and a consumer key, generated on the OVHcloud token generation page. [Create the keys](https://api.ovh.com/createToken/?GET=/*&POST=/*&PUT=/*&DELETE=/*).

```terraform
terraform {
  required_providers {
    ovh = {
      source = "ovh/ovh"
    }
  }
}

provider "ovh" {
  endpoint           = "ovh-eu"
  application_key    = "xxxxxxxxx"
  application_secret = "yyyyyyyyy"
  consumer_key       = "zzzzzzzzzzzzzz"
}
```

The endpoint: `ovh-eu` for the OVHcloud Europe API, `ovh-ca` for Canada, `ovh-us` for the US.

## Credentials

Rather than in the code, the same code may run in several environments: the provider first looks for direct parameters, then for environment variables, then for a configuration file.

- OAuth2: `OVH_ENDPOINT, OVH_CLIENT_ID and OVH_CLIENT_SECRET`
- Access token: `OVH_ENDPOINT and OVH_ACCESS_TOKEN`
- Application key: `OVH_ENDPOINT, OVH_APPLICATION_KEY, OVH_APPLICATION_SECRET and OVH_CONSUMER_KEY`

The configuration file, for OAuth2:

```
[default]; general configuration: default endpoint
endpoint=ovh-eu

[ovh-eu]
; configuration specific to 'ovh-eu' endpoint
client_id=my_client_id
client_secret=my_client_secret
```

Looked for in `./ovh.conf`, `~/.ovh.conf`, then `/etc/ovh.conf`.

## Example

A Managed Kubernetes cluster and its node pool:

```terraform
variable "service_name" {
  default = "wwwwwww"
}

# Create an OVHcloud Managed Kubernetes cluster
resource "ovh_cloud_project_kube" "my_kube_cluster" {
  service_name = var.service_name
  name         = "my-super-kube-cluster"
  region       = "GRA5"
  version      = "1.22"
}

# Create a Node Pool for our Kubernetes cluster
resource "ovh_cloud_project_kube_nodepool" "node_pool" {
  service_name  = var.service_name
  kube_id       = ovh_cloud_project_kube.my_kube_cluster.id
  name          = "my-pool" //Warning: "_" char is not allowed!
  flavor_name   = "b3-8"
  desired_nodes = 3
  max_nodes     = 3
  min_nodes     = 3
}
```

Every resource and data source: [the provider's documentation](https://registry.terraform.io/providers/ovh/ovh/latest/docs); which provider and resource stand for what in the Control Panel: [Terraform at OVHcloud](https://help.ovhcloud.com/csm/en-gb-terraform-at-ovhcloud?id=kb_article_view&sysparm_article=KB0054612).

## Configuration reference

Every argument is optional; each has its environment variable.

| Argument | What it sets |
| --- | --- |
| `endpoint` | Which API endpoint to use, e.g. ovh-eu or ovh-ca. OVH_ENDPOINT. |
| `client_id` | The OAuth2 client ID. OVH_CLIENT_ID. |
| `client_secret` | The OAuth2 client secret. OVH_CLIENT_SECRET. |
| `access_token` | The OVH API access token. OVH_ACCESS_TOKEN. |
| `application_key` | The API application key. OVH_APPLICATION_KEY. |
| `application_secret` | The API application secret. OVH_APPLICATION_SECRET. |
| `consumer_key` | The API consumer key. OVH_CONSUMER_KEY. |
| `user_agent_extra` | Extra information to append at the end of the user-agent used when making API calls. |
| `http_headers` | A map of extra HTTP headers to add to every request made to the OVH API. |
| `api_rate_limit` | The API request rate limit, X operations by second. If omitted, unlimited. |

## State storage

To keep your Terraform states on a High Performance (S3) OVHcloud Object Storage, follow [the guide](https://help.ovhcloud.com/csm/en-public-cloud-compute-terraform-high-perf-object-storage-backend-state?id=kb_article_view&sysparm_article=KB0051345).

## Guides

Step-by-step guides from the OVHcloud documentation, by product, then the provider's own.

### Get started

- [Using Terraform with OVHcloud Manage & Operate](https://docs.ovhcloud.com/en/guides/manage-and-operate/terraform/at-ovhcloud)
- [How to use Terraform Public Cloud](https://docs.ovhcloud.com/en/guides/public-cloud/cross-functional/how-to-use-terraform)

### Public Cloud

- [Using OVHcloud Object Storage as Terraform Backend to store your Terraform state Compute](https://docs.ovhcloud.com/en/guides/public-cloud/compute/use-object-storage-terraform-backend-state)
- [Public Cloud Databases - Getting started with Terraform Databases](https://docs.ovhcloud.com/en/guides/public-cloud/databases/public-cloud-databases-order-terraform)
- [Deploy with Terraform for Public Cloud for MongoDB Databases · MongoDB](https://docs.ovhcloud.com/en/guides/public-cloud/databases/mongodb-deploy-with-terraform)
- [Analytics - Getting started with Terraform Analytics](https://docs.ovhcloud.com/en/guides/public-cloud/data-analytics/analytics/analytics-order-terraform)

### Storage and Backup

- [Object Storage - Manage an Object Storage bucket with Terraform Object Storage](https://docs.ovhcloud.com/en/guides/storage-and-backup/object-storage/s3-terraform)
- [Managing Enterprise File Storage with OVHcloud Terraform provider Enterprise File Storage](https://docs.ovhcloud.com/en/guides/storage-and-backup/file-storage/enterprise-file-storage/netapp-terraform)
- [How to deploy an EFS stack for Trident CSI with Terraform Enterprise File Storage](https://docs.ovhcloud.com/en/guides/storage-and-backup/file-storage/enterprise-file-storage/netapp-trident-terraform)

### Private Cloud

- [Using Terraform with SNC Cloud Platform SNC Cloud Platform](https://docs.ovhcloud.com/en/guides/hosted-private-cloud/cloud-platform/terraform)
- [How to use Terraform On-Prem Cloud Platform](https://docs.ovhcloud.com/en/guides/hosted-private-cloud/opcp/use-terraform)
- [Deploy an SAP system infrastructure on VMware on OVHcloud solution with Terraform SAP on OVHcloud](https://docs.ovhcloud.com/en/guides/hosted-private-cloud/sap-on-ovhcloud/cookbook-terraform-sap-system)
- [Deploy virtual machines of SAP Application Server on VMware on OVHcloud solution with Terraform SAP on OVHcloud](https://docs.ovhcloud.com/en/guides/hosted-private-cloud/sap-on-ovhcloud/cookbook-terraform-sap-application-server)
- [Deploy virtual machines of SAP HANA database on VMware on OVHcloud solution with Terraform SAP on OVHcloud](https://docs.ovhcloud.com/en/guides/hosted-private-cloud/sap-on-ovhcloud/cookbook-terraform-sap-hana-database)

### From the provider

- [Migrating dedicated servers from previous versions to v2.2.0 Terraform Registry](https://registry.terraform.io/providers/ovh/ovh/latest/docs/guides/dedicated_server_migration)
- [Consumer key access rules for resources that place orders Terraform Registry](https://registry.terraform.io/providers/ovh/ovh/latest/docs/guides/order_consumer_key_access_rules)
