Terraform is an open-source infrastructure as code (IaC) tool created by Hashicorp in 2014, and written in Go. It aims at building, changing, and version-controlling your infrastructure. You can define and provision your infrastructure by writing the definition of your resources in Hashicorp Configuration Language (HCL).
It is widely used and you can also use it with OVHcloud.
At the heart of the Terraform product is the concept of a provider, a plugin enabling interaction with an API.
Providers
Based on your automation needs at OVHcloud, you have to pick one or more of the following Terraform providers:
- OVH provider that interacts with OVHcloud API portal. You can refer to this guide to learn more about how to use the API portal. Furthermore, the OVH provider evolves as fast as the OVHcloud offering, so follow the releases.
- OpenStack provider: the open standard cloud computing platform that OVHcloud uses to power its Public Cloud service.
- Hashicorp AWS provider to automate the operations of the S3 Object Storage.
- Hashicorp Kubernetes provider: once you have provisioned a Kubernetes cluster with the OVH provider, you can manage your Kubernetes configuration with this provider.
- Hashicorp vSphere provider to automate the operations of VMware on OVHcloud solutions.
- Nutanix provider to automate the operations of OVHcloud Nutanix on OVHcloud.
Mapping OVHcloud GUI to Terraform providers & resources
OVHcloud console GUI (also called "Control Panel" or "Manager") hides some background API complexity to the user. From a GUI concept, it may be not easy to find the correct provider and the associated resource. The tables below are here to help.
- The following categories are based on the Control Panel 'New version (Beta)' from December 2022.
- If no resource is available but a Terraform data source is, this is mentioned in the table with "[data source]".
- When multiple resources are available for one GUI concept, only the main resource is provided in this list.
Bare Metal Cloud
Control Panel concept | Terraform provider | Resource or Data Source |
---|---|---|
Dedicated Server | ovh | [data source] ovh_dedicated_server |
Virtual Private Server | ovh | ovh_vps |
Logs Data Platform | ovh | partially available: - ovh_dbaas_logs_output_graylog_stream - ovh_dbaas_logs_input - [data source] ovh_dbaas_logs_input_engine |
Hosted Private Cloud
Control Panel concept | Terraform provider | Resource or Data Source |
---|---|---|
VMware | - not available for ordering - vSphere for management |
see provider |
Nutanix | - not available for ordering - nutanix for management |
see provider |
Public Cloud
Compute
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Instances (VM) | openstack | openstack_compute_instance_v2 |
Storage and Backup
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Block Storage | openstack | blockstorage_volume_v3 |
Object Storage (Swift) | openstack | objectstorage_object_v1 |
Object Storage (S3) | Hashicorp aws | aws_s3_bucket |
S3 users | ovh | ovh_cloud_project_user with objectstore_operator role |
Cloud Archive | openstack | objectstorage_object_v1 with storage_policy set to “PCA” to create an “archive” swift container |
Databases | ovh | cloud_project_database and cloud_project_database_database |
Volume Snapshot | openstack | openstack_blockstorage_snapshot_v3 |
Volume Backup | openstack | [data source] openstack_blockstorage_volume_v3 |
Instance Backup | openstack | openstack_images_image_v2 |
Network
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Private network (vRack) | ovh & openstack | - ovh_vrack_cloudproject - openstack_networking_network_v2 - openstack_networking_subnet_v2 |
Load Balancer | openstack | openstack_lb_loadbalancer_v2 |
Public IPs - Floating IPs | openstack | openstack_networking_floatingip_v2 |
Public IPs - Additional IPs | ovh | ovh_ip_service |
Gateway | openstack | openstack_networking_router_v2 |
Containers & Orchestration
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Managed Kubernetes Service - Cluster operations | ovh | ovh_cloud_project_kube |
Managed Kubernetes Service - Application deployment operations | Hashicorp Kubernetes |
kubernetes_namespace kubernetes_deployment |
Kubernetes Load Balancer | Hashicorp Kubernetes | kubernetes_service as described in this tutorial |
Managed Private Registry | ovh |
ovh_cloud_project_containerregistry ovh_cloud_project_containerregistry_user |
Workflow Management | ovh | cloud_project_workflow_backup |
Data & Analytics
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Logs Data Platform | ovh | partially available: - ovh_dbaas_logs_output_graylog_stream - ovh_dbaas_logs_input - ovh_dbaas_logs_cluster - [data source] ovh_dbaas_logs_input_engine |
Settings
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Users & Roles | ovh | ovh_cloud_project_user |
SSH keys | ovh & openstack | If you use the openstack provider for compute, you will need to use openstack_compute_keypair_v2 to manage the SSH keys |
Project Settings | ovh | ovh_cloud_project |
Network
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
vRack private network | ovh | ovh_vrack |
Public IP Addresses - Additional IPs | ovh | ovh_ip_service |
Load Balancer | ovh | ovh_iploadbalancing |
My account
My profile
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Profile | ovh | [data source] ovh_me |
Payment method | ovh | - [data source] ovh_me_paymentmean_bankaccount - [data source] ovh_me_paymentmean_creditcard |
Identity and Access Management (IAM)
Control Panel concept | Terraform provider(s) | Resource or Data Source |
---|---|---|
Policies | ovh | ovh_iam_policy |
Identities | ovh | - ovh_me_identity_user - ovh_me_identity_group |
Resource groups | ovh | ovh_iam_resource_group |
Resources
Terraform with OVHcloud examples
OVH Provider
- Registry entry
- Documentation
- Source code on GitHub (contributions are welcome)