Automate OVHcloud Connect with API, CLI, and Terraform

Ver como Markdown

Discover how to manage OVHcloud Connect programmatically using the API, CLI, and Terraform

Objective

OVHcloud Connect can be managed programmatically using the OVHcloud API, command-line tools, and Terraform. Automation reduces manual errors, speeds up provisioning, and makes your infrastructure repeatable and version-controlled.

OVHcloud API

The OVHcloud API provides RESTful endpoints for all OVHcloud Connect operations: ordering, configuring, monitoring, and cancelling connections.

API Console: https://eu.api.ovh.com/console/?section=%2FovhCloudConnect&branch=v1

Key API endpoints

EndpointDescription
GET /ovhCloudConnectList all your OVHcloud Connect services
GET /ovhCloudConnect/{serviceName}Get details of a specific service
GET /ovhCloudConnect/{serviceName}/config/popList PoP configurations
POST /ovhCloudConnect/{serviceName}/config/popCreate a new PoP configuration
GET /ovhCloudConnect/{serviceName}/serviceInfosGet service metadata and billing info

Getting started with the API

  1. Create API credentials — Go to https://eu.api.ovh.com/createToken/ and generate an Application Key, Application Secret, and Consumer Key.
  2. Choose an SDK — OVHcloud provides official API wrappers in multiple languages:
  3. Make your first call — Example in Python:
import ovh

client = ovh.Client(
    endpoint='ovh-eu',
    # Configure via environment variables or ovh.conf file:
    # OVH_APPLICATION_KEY, OVH_APPLICATION_SECRET, OVH_CONSUMER_KEY
)

# List all OVHcloud Connect services
services = client.get('/ovhCloudConnect')
print(services)
Tip

Security tip: Never hard-code your API credentials. Use environment variables, a configuration file (ovh.conf), or a secrets manager (e.g. HashiCorp Vault, CI/CD secrets).

Command-Line Interface (CLI)

While there is no dedicated OVHcloud CLI binary for OVHcloud Connect, you can use the API wrappers in a scripting context or build lightweight CLI scripts using the SDKs above.

Example: a quick bash script using curl and the OVHcloud API signing mechanism:

# Simplified example — use an SDK for proper signature handling
curl -X GET \
  -H "X-Ovh-Application: YOUR_APP_KEY" \
  -H "X-Ovh-Consumer: YOUR_CONSUMER_KEY" \
  -H "X-Ovh-Timestamp: $(date +%s)" \
  -H "X-Ovh-Signature: \$1\$..." \
  "https://eu.api.ovh.com/1.0/ovhCloudConnect"

In practice, using the Python or Node.js SDK is much simpler than manual signing.

Terraform

Terraform allows you to define your OVHcloud Connect infrastructure as code. This is ideal for repeatable deployments, version control, and collaboration.

OVHcloud Terraform Provider

Example Terraform configuration

terraform {
  required_providers {
    ovh = {
      source  = "ovh/ovh"
      version = ">= 2.7.0"
    }
  }
}

provider "ovh" {
  endpoint = "ovh-eu"
  # Credentials from environment variables:
  # OVH_APPLICATION_KEY, OVH_APPLICATION_SECRET, OVH_CONSUMER_KEY
}

# Example: Associate an OVHcloud Connect service with a vRack
# Check the Terraform Registry for exact resource names and attributes
resource "ovh_vrack_ovhcloudconnect" "my_connect" {
  service_name      = "vrack-abc123"
  ovh_cloud_connect = "ovhcloudconnect-xyz789"
}
Info

Note: Resource names and attributes may change between provider versions. Always refer to the Terraform Registry documentation for the latest resource definitions.

Go further

For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analyzed by our experts.

Join our community of users.

Esta página foi útil?