Find out how to manage your Enterprise File Storage offer using Terraform
Objective
Enterprise File Storage is a storage solution that allows you to provision NFS volumes that are fully managed by OVHcloud. Terraform is an infrastructure-as-code tool that automates resource provisioning.
In this guide, you will learn how to use OVHcloud Terraform provider to manage your EFS solution volumes, snapshots and more.
Info
In this guide, a volume is also called share as in the OVHcloud API.
Learn how manage your EFS service using Terraform.
An Enterprise File Storage service. A service can be ordered from the product page, from the , or using the ovh_storage_efs resource (see Order a service).
OVHcloud Control Panel Access
Direct link:
Navigation path:Bare Metal Cloud > Enterprise File Storage
Instructions
Configure the OVHcloud Terraform provider
Generate API credentials
The OVHcloud Teraform Provider needs to be configured with an API token to be able to make calls to the OVHcloud API.
The API token information is needed because the OVHcloud Terraform Provider is making requests to the OVHcloud API in the backend.
Your API token will need to have the following rights:
GET /storage/netapp/*
POST /storage/netapp/*
PUT /storage/netapp/*
DELETE /storage/netapp/*
If you plan to order a service using Terraform (see Order a service), you will also need the following rights:
The init command will initialize your working directory which contains .tf configuration files.
It’s the first command to execute for a new configuration, or after doing a checkout of an existing configuration in a given git repository for example.
The init command will download the necessary providers and initialize the backend.
Tip
Once the initialization is successfull you are now able to manage Enterprise File Storage resources and data sources that are availalable inside the OVHcloud Terraform provider.
Service management
Get service information
Use the ovh_storage_efs data source to fetch service details.
Create a main.tf file:
data "ovh_storage_efs" "efs" { service_name = "<service_id>" # Replace this value with EFS service ID.}
terraform apply -var-file=secrets.tfvarsdata.ovh_storage_efs.efs: Reading...data.ovh_storage_efs.efs: Read complete after 0s [id=xxx-xxx-xxx-xxx-xxx]Changes to Outputs: + service_id = "xxx-xxx-xxx-xxx-xxx" + service_product = "enterprise-file-storage-premium-1tb" + service_quota = 1000You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve. Enter a value: yesApply complete! Resources: 0 added, 0 changed, 0 destroyed.Outputs:service_id = "xxx-xxx-xxx-xxx-xxx"service_product = "enterprise-file-storage-premium-1tb"service_quota = 1000
Order a service
Info
The ovh_storage_efs resource is available starting from OVHcloud Terraform provider version 2.12.0.
Use the ovh_storage_efs resource to order and manage an Enterprise File Storage service.
Warning
To order a product through Terraform, your account needs to have a default payment method defined. This can be done in the or via API with the /me/payment/method endpoint.
BANK_ACCOUNT is no longer supported. Update your default payment method to SEPA_DIRECT_DEBIT.
Define the service inside your main.tf file:
data "ovh_me" "my_account" {}resource "ovh_storage_efs" "efs" { name = "MyEFS" ovh_subsidiary = data.ovh_me.my_account.ovh_subsidiary plan = [ { plan_code = "enterprise-file-storage-premium-1tb" duration = "P1M" pricing_mode = "default" configuration = [ { label = "region" value = "eu-west-gra" }, { label = "network" value = "vrack" } ] } ]}
Key properties:
name: Custom display name for your service.
ovh_subsidiary: OVHcloud subsidiary for billing purposes. In this example, the value is retrieved from the ovh_me data source.
plan: Defines the plan to order. Contains the plan code, duration, pricing mode and configuration options.
plan.plan_code: Identifier of the offer (e.g. enterprise-file-storage-premium-1tb).
plan.duration: Duration of the subscription (e.g. P1M for one month).
plan.configuration: Configuration options for the service, including the region (mandatory) and network type (mandatory).
terraform plan -var-file=secrets.tfvars -out main.tfplan
data.ovh_me.my_account: Reading...data.ovh_me.my_account: Read complete after 0s [id=xxx-ovh]Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + createTerraform will perform the following actions: # ovh_storage_efs.efs will be created + resource "ovh_storage_efs" "efs" { + created_at = (known after apply) + iam = (known after apply) + id = (known after apply) + name = "MyEFS" + order = (known after apply) + ovh_subsidiary = "FR" + performance_level = (known after apply) + plan = [ + { + configuration = [ + { + label = "region" + value = "eu-west-gra" }, + { + label = "network" + value = "vrack" }, ] + duration = "P1M" + plan_code = "enterprise-file-storage-premium-1tb" + pricing_mode = "default" }, ] + product = (known after apply) + quota = (known after apply) + region = (known after apply) + service_name = (known after apply) + status = (known after apply) }Plan: 1 to add, 0 to change, 0 to destroy.Saved the plan to: main.tfplanTo perform exactly these actions, run the following command to apply: terraform apply "main.tfplan"
Once you reviewed the execution plan, run terraform apply to create the service:
terraform apply main.tfplan
ovh_storage_efs.efs: Creating...ovh_storage_efs.efs: Still creating... [10s elapsed]ovh_storage_efs.efs: Still creating... [20s elapsed]ovh_storage_efs.efs: Still creating... [30s elapsed][...]ovh_storage_efs.efs: Still creating... [3m30s elapsed]ovh_storage_efs.efs: Still creating... [3m40s elapsed]ovh_storage_efs.efs: Creation complete after 35s [id=xxx-xxx-xxx-xxx-xxx]Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
Your Enterprise File Storage service is now ordered and provisioned.
Using the created service
Once the service is created, you can reference its id attribute (or service_name which contains the same value) to manage volumes, snapshots and ACLs:
resource "ovh_storage_efs" "efs" { name = "MyEFS" # ... plan configuration ...}resource "ovh_storage_efs_share" "volume" { service_name = ovh_storage_efs.efs.id name = "share" description = "My share" protocol = "NFS" size = 100}
Timeouts
Custom timeouts can be configured for the service creation:
An existing Enterprise File Storage service can be imported into your Terraform state using the following configuration:
import { to = ovh_storage_efs.efs id = "xxx-xxx-xxx-xxx-xxx"}
Then run:
terraform plan -generate-config-out=efs.tfterraform apply
ovh_storage_efs.efs: Preparing import... [id=xxx-xxx-xxx-xxx-xxx]ovh_storage_efs.efs: Refreshing state... [id=xxx-xxx-xxx-xxx-xxx]Terraform will perform the following actions: # ovh_storage_efs.efs will be imported resource "ovh_storage_efs" "efs" { created_at = "2025-08-01T11:27:49+02:00" iam = { id = "xxx-xxx-xxx-xxx-xxx" urn = "urn:v1:eu:resource:storageNetApp:xxx-xxx-xxx-xxx-xxx" } id = "xxx-xxx-xxx-xxx-xxx" name = "xxx-xxx-xxx-xxx-xxx" performance_level = "premium" product = "enterprise-file-storage-premium-2tb" quota = 2000 region = "eu-west-gra" service_name = "xxx-xxx-xxx-xxx-xxx" status = "running" }Plan: 1 to import, 0 to add, 0 to change, 0 to destroy.Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve. Enter a value: yesovh_storage_efs.efs: Importing... [id=xxx-xxx-xxx-xxx-xxx]ovh_storage_efs.efs: Import complete [id=xxx-xxx-xxx-xxx-xxx]Apply complete! Resources: 1 imported, 0 added, 0 changed, 0 destroyed
The file efs.tf will then contain the imported resource's configuration, that can be copied into your main configuration file.
Delete a service
A created or imported service can be deleted using the terraform destroy command.
terraform destroy -var-file=secrets.tfvars
data.ovh_me.my_account: Reading...data.ovh_me.my_account: Read complete after 0s [id=xxx-ovh]ovh_storage_efs.efs: Refreshing state... [id=xxx-xxx-xxx-xxx-xxx]Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: - destroyTerraform will perform the following actions: # ovh_storage_efs.efs will be destroyed - resource "ovh_storage_efs" "efs" { - created_at = "2026-03-02T18:29:25+01:00" -> null - iam = { - id = "xxx-xxx-xxx-xxx-xxx" -> null - urn = "urn:v1:eu:resource:storageNetApp:xxx-xxx-xxx-xxx-xxx" -> null } -> null - id = "xxx-xxx-xxx-xxx-xxx" -> null - name = "MyEFS" -> null - ovh_subsidiary = "FR" -> null - performance_level = "premium" -> null - plan = [ - { - configuration = [ - { - label = "region" -> null - value = "eu-west-gra" -> null }, - { - label = "network" -> null - value = "vrack" -> null }, ] -> null - duration = "P1M" -> null - plan_code = "enterprise-file-storage-premium-1tb" -> null - pricing_mode = "default" -> null }, ] -> null - product = "enterprise-file-storage-premium-1tb" -> null - quota = 1000 -> null - region = "eu-west-gra" -> null - service_name = "xxx-xxx-xxx-xxx-xxx" -> null - status = "running" -> null }Plan: 0 to add, 0 to change, 1 to destroy.Do you really want to destroy all resources? Terraform will destroy all your managed infrastructure, as shown above. There is no undo. Only 'yes' will be accepted to confirm. Enter a value: yesovh_storage_efs.efs: Destroying... [id=xxx-xxx-xxx-xxx-xxx]ovh_storage_efs.efs: Destruction complete after 3s
Volumes Management
OVHcloud Terraform Provider allows the following volume management operations: creation, modification and deletion.
terraform plan -var-file=secrets.tfvars -out main.tfplanTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + createTerraform will perform the following actions: # ovh_storage_efs_share.volume will be created + resource "ovh_storage_efs_share" "volume" { + created_at = (known after apply) + description = "My share" + id = (known after apply) + mount_point_name = (known after apply) + name = "share" + protocol = "NFS" + service_name = "xxx-xxx-xxx-xxx-xxx" + size = 100 + snapshot_id = (known after apply) + status = (known after apply) }Plan: 1 to add, 0 to change, 0 to destroy.Saved the plan to: main.tfplanTo perform exactly these actions, run the following command to apply: terraform apply "main.tfplan"
Key points:
The terraform plan command will create an execution plan but won't execute it. Instead, it will determine what actions are necessary to create the configuration specified inside your configuration files. This will allow you to verifiy whether your execution plan matches exectations before making any changes to actual resources.
The optional -out parameter allows your to specifiy an output file for the plan. It will ensure that the plan you reviewed will be the same as what is applied.
Once you reviewed the execution plan, run terraform apply to make changes:
If your volume has manual snapshots that are not referenced by Terraform, they must be deleted before the volume is deleted.
terraform destroy -var-file=secrets.tfvarsovh_storage_efs_share.volume: Refreshing state... [id=29d1facf-db03-4951-a4e4-c6c8ac7b1104]Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: - destroyTerraform will perform the following actions: # ovh_storage_efs_share.volume will be destroyed - resource "ovh_storage_efs_share" "volume" { - created_at = "2025-07-01T09:53:17Z" -> null - description = "My share" -> null - id = "29d1facf-db03-4951-a4e4-c6c8ac7b1104" -> null - name = "share" -> null - protocol = "NFS" -> null - service_name = "xxx-xxx-xxx-xxx-xxx" -> null - size = 100 -> null - status = "available" -> null # (1 unchanged attribute hidden) }Plan: 0 to add, 0 to change, 1 to destroy.Do you really want to destroy all resources? Terraform will destroy all your managed infrastructure, as shown above. There is no undo. Only 'yes' will be accepted to confirm. Enter a value: yesovh_storage_efs_share.volume: Destroying... [id=29d1facf-db03-4951-a4e4-c6c8ac7b1104]ovh_storage_efs_share.volume: Destruction complete after 1sDestroy complete! Resources: 1 destroyed.
output "share_acccess_path" { value = data.ovh_storage_efs_share_access_path.access_path}output "share_access_paths" { value = data.ovh_storage_efs_share_access_paths.access_paths}
Run terraform apply to add your data source and create outputs:
terraform apply data_source.tfplanTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + create <= read (data resources)Terraform will perform the following actions: # data.ovh_storage_efs_share_access_path.access_path will be read during apply # (config refers to values not yet known) <= data "ovh_storage_efs_share_access_path" "access_path" { + id = (known after apply) + path = (known after apply) + preferred = (known after apply) + service_name = "xxx-xxx-xxx-xxx-xxx" + share_id = (known after apply) } # data.ovh_storage_efs_share_access_paths.access_paths will be read during apply # (config refers to values not yet known) <= data "ovh_storage_efs_share_access_paths" "access_paths" { + access_paths = (known after apply) + service_name = "xxx-xxx-xxx-xxx-xxx" + share_id = (known after apply) } # ovh_storage_efs_share.volume will be created + resource "ovh_storage_efs_share" "volume" { + created_at = (known after apply) + description = "My share" + id = (known after apply) + mount_point_name = (known after apply) + name = "share" + protocol = "NFS" + service_name = "xxx-xxx-xxx-xxx-xxx" + size = 100 + snapshot_id = (known after apply) + status = (known after apply) }Plan: 1 to add, 0 to change, 0 to destroy.Changes to Outputs: + share_acccess_path = { + id = (known after apply) + path = (known after apply) + preferred = (known after apply) + service_name = "xxx-xxx-xxx-xxx-xxx" + share_id = (known after apply) } + share_access_paths = { + access_paths = (known after apply) + service_name = "xxx-xxx-xxx-xxx-xxx" + share_id = (known after apply) }Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve. Enter a value: yesovh_storage_efs_share.volume: Creating...ovh_storage_efs_share.volume: Still creating... [10s elapsed]ovh_storage_efs_share.volume: Creation complete after 10s [id=1d6669a7-8b86-472a-bb04-cf8be7b9af16]data.ovh_storage_efs_share_access_paths.access_paths: Reading...data.ovh_storage_efs_share_access_paths.access_paths: Read complete after 1sdata.ovh_storage_efs_share_access_path.access_path: Reading...data.ovh_storage_efs_share_access_path.access_path: Read complete after 0s [id=7cbcf0ca-50f4-4e3c-9222-406e71a10649]Apply complete! Resources: 1 added, 0 changed, 0 destroyed.Outputs:share_acccess_path = { "id" = "7cbcf0ca-50f4-4e3c-9222-406e71a10649" "path" = "10.6.0.1:/share_b038413e_c446_4788_871f_a762fb1b7697" "preferred" = true "service_name" = "xxx-xxx-xxx-xxx-xxx" "share_id" = "1d6669a7-8b86-472a-bb04-cf8be7b9af16"}share_access_paths = { "access_paths" = toset([ { "id" = "7cbcf0ca-50f4-4e3c-9222-406e71a10649" "path" = "10.6.0.1:/share_b038413e_c446_4788_871f_a762fb1b7697" "preferred" = true }, ]) "service_name" = "xxx-xxx-xxx-xxx-xxx" "share_id" = "1d6669a7-8b86-472a-bb04-cf8be7b9af16"}
Snapshots Management
OVHcloud Terraform Provider allows the following snapshot management operations: creation, modification and deletion.
terraform plan -var-file=secrets.tfvars -out main.tfplanTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + createTerraform will perform the following actions: # ovh_storage_efs_share.volume will be created + resource "ovh_storage_efs_share" "volume" { + created_at = (known after apply) + description = "My share" + id = (known after apply) + mount_point_name = (known after apply) + name = "share" + protocol = "NFS" + service_name = "xxx-xxx-xxx-xxx-xxx" + size = 100 + snapshot_id = (known after apply) + status = (known after apply) } # ovh_storage_efs_share_snapshot.snapshot will be created + resource "ovh_storage_efs_share_snapshot" "snapshot" { + created_at = (known after apply) + description = "My snapshot" + id = (known after apply) + name = "snapshot" + path = (known after apply) + service_name = "xxx-xxx-xxx-xxx-xxx" + share_id = (known after apply) + status = (known after apply) + type = (known after apply) } # time_sleep.wait_10_seconds will be created + resource "time_sleep" "wait_10_seconds" { + destroy_duration = "10s" + id = (known after apply) }Plan: 3 to add, 0 to change, 0 to destroy.Saved the plan to: main.tfplanTo perform exactly these actions, run the following command to apply: terraform apply "main.tfplan"
Key points:
The terraform plan command will create an execution plan but won't execute it. Instead, it will determine what actions are necessary to create the configuration specified inside your configuration files. This will allow you to verifiy whether your execution plan matches exectations before making any changes to actual resources.
The optional -out parameter allows your to specifiy an output file for the plan. It will ensure that the plan you reviewed will be the same as what is applied.
Once you reviewed the execution plan, run terraform apply to make changes:
terraform apply main.tfplanovh_storage_efs_share.volume: Creating...ovh_storage_efs_share.volume: Still creating... [10s elapsed]ovh_storage_efs_share.volume: Still creating... [20s elapsed]ovh_storage_efs_share.volume: Still creating... [30s elapsed]ovh_storage_efs_share.volume: Still creating... [40s elapsed]ovh_storage_efs_share.volume: Creation complete after 41s [id=1f551984-6529-48f8-830d-f6a70d062174]time_sleep.wait_10_seconds: Creating...time_sleep.wait_10_seconds: Creation complete after 0s [id=2025-07-01T13:39:01Z]ovh_storage_efs_share_snapshot.snapshot: Creating...ovh_storage_efs_share_snapshot.snapshot: Still creating... [10s elapsed]ovh_storage_efs_share_snapshot.snapshot: Creation complete after 10s [id=f92bc04a-301f-4a9a-80ba-7c7bf18b2275]Apply complete! Resources: 3 added, 0 changed, 0 destroyed.
Your snapshot is now available.
Modify a snapshot
Snapshot name and description properties can be updated.
Once the value(s) are updated inside your main.tf file, apply the changes using terraform apply.
You can (re-)use a volume that already exists (within your Terraform configuration or not) to create your ACL.
resource "ovh_storage_efs_share" "volume" { service_name = "<service_id>" # Replace this value with service ID. name = "share" description = "My share" protocol = "NFS" size = 100}resource "ovh_storage_efs_share_acl" "acl" { service_name = "<service_id>" # Replace this value with service ID. share_id = ovh_storage_efs_share.volume.id access_level = "rw" access_to = "10.0.0.1/32"}
terraform plan -var-file=secrets.tfvars -out main.tfplanTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: + createTerraform will perform the following actions: # ovh_storage_efs_share.volume will be created + resource "ovh_storage_efs_share" "volume" { + created_at = (known after apply) + description = "My share" + id = (known after apply) + mount_point_name = (known after apply) + name = "share" + protocol = "NFS" + service_name = "xxx-xxx-xxx-xxx-xxx" + size = 100 + snapshot_id = (known after apply) + status = (known after apply) } # ovh_storage_efs_share_acl.acl will be created + resource "ovh_storage_efs_share_acl" "acl" { + access_level = "rw" + access_to = "10.0.0.1/32" + access_type = (known after apply) + created_at = (known after apply) + id = (known after apply) + service_name = "xxx-xxx-xxx-xxx-xxx" + share_id = (known after apply) + status = (known after apply) }Plan: 2 to add, 0 to change, 0 to destroy.Saved the plan to: main.tfplanTo perform exactly these actions, run the following command to apply: terraform apply "main.tfplan"
Key points:
The terraform plan command will create an execution plan but won't execute it. Instead, it will determine what actions are necessary to create the configuration specified inside your configuration files. This will allow you to verifiy whether your execution plan matches exectations before making any changes to actual resources.
The optional -out parameter allows your to specifiy an output file for the plan. It will ensure that the plan you reviewed will be the same as what is applied.
Once you reviewed the execution plan, run terraform apply to make changes:
terraform apply main.tfplanovh_storage_efs_share.volume: Creating...ovh_storage_efs_share.volume: Still creating... [10s elapsed]ovh_storage_efs_share.volume: Creation complete after 10s [id=001ccf4b-3537-41c0-b446-a42663971d58]ovh_storage_efs_share_acl.acl: Creating...ovh_storage_efs_share_acl.acl: Still creating... [10s elapsed]ovh_storage_efs_share_acl.acl: Creation complete after 11s [id=9274f4d4-de96-46eb-935f-ffbc747a19bc]Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
terraform destroy -var-file=secrets.tfvarsovh_storage_efs_share.volume: Refreshing state... [id=001ccf4b-3537-41c0-b446-a42663971d58]ovh_storage_efs_share_acl.acl: Refreshing state... [id=9274f4d4-de96-46eb-935f-ffbc747a19bc]Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: - destroyTerraform will perform the following actions: # ovh_storage_efs_share.volume will be destroyed - resource "ovh_storage_efs_share" "volume" { - created_at = "2025-07-01T14:36:37Z" -> null - description = "My share" -> null - id = "001ccf4b-3537-41c0-b446-a42663971d58" -> null - name = "share" -> null - protocol = "NFS" -> null - service_name = "xxx-xxx-xxx-xxx-xxx" -> null - size = 100 -> null - status = "available" -> null # (1 unchanged attribute hidden) } # ovh_storage_efs_share_acl.acl will be destroyed - resource "ovh_storage_efs_share_acl" "acl" { - access_level = "rw" -> null - access_to = "10.0.0.1/32" -> null - access_type = "ip" -> null - created_at = "2025-07-01T14:36:48Z" -> null - id = "9274f4d4-de96-46eb-935f-ffbc747a19bc" -> null - service_name = "xxx-xxx-xxx-xxx-xxx" -> null - share_id = "001ccf4b-3537-41c0-b446-a42663971d58" -> null - status = "active" -> null }Plan: 0 to add, 0 to change, 2 to destroy.Do you really want to destroy all resources? Terraform will destroy all your managed infrastructure, as shown above. There is no undo. Only 'yes' will be accepted to confirm. Enter a value: yesovh_storage_efs_share_acl.acl: Destroying... [id=9274f4d4-de96-46eb-935f-ffbc747a19bc]ovh_storage_efs_share_acl.acl: Destruction complete after 0sovh_storage_efs_share.volume: Destroying... [id=001ccf4b-3537-41c0-b446-a42663971d58]ovh_storage_efs_share.volume: Destruction complete after 0sDestroy complete! Resources: 2 destroyed.
Troubleshooting
Authentication Issues: Verify API credentials and permissions.
Resource Limits: Check volume/snapshot quota usage in the OVHcloud Control Panel.
Volume Deletion Issues: Ensure all manual snapshots are deleted before removing the volume.
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.