2 Commits
Author SHA1 Message Date
alessandrovitali 14241d4e18 fix(tf): add required_version 2026-08-13 13:44:50 +02:00
alessandrovitali dd0351ad49 feat: terraform configuration for classic VPS 2026-08-13 13:23:05 +02:00
3 changed files with 86 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
# Fetch billing subsidiary details from your OVH account profile
data "ovh_me" "myaccount" {}
# Provision the Classic VPS
resource "ovh_vps" "vps_1" {
display_name = "coolify"
ovh_subsidiary = data.ovh_me.myaccount.ovh_subsidiary # Country of billing entity (e.g. "CH", "DE")
plan = [
{
duration = "P1M" # Monthly subscription ("P1M")
plan_code = "vps-le-2-2-40" # Starter plan model (Adjust depending on current catalog)
pricing_mode = "default"
# Datacenter configuration
configuration = [
{
label = "vps_datacenter"
value = "LIM" # Limburg (DE)
},
{
label = "vps_os"
value = "ubuntu-22.04"
}
]
}
]
public_ssh_key = var.ssh_public_key
}
# The public IP of a classic VPS must be retrieved via a data source after delivery
data "ovh_vps" "vps_1" {
service_name = ovh_vps.vps_1.service_name
}
output "vps_public_ip" {
value = tolist(data.ovh_vps.vps_1.ips)[0]
description = "The public IP address of VPS-1"
}
+16
View File
@@ -0,0 +1,16 @@
terraform {
required_version = ">= 1.0.0"
required_providers {
ovh = {
source = "ovh/ovh"
version = ">= 2.0.0"
}
}
}
provider "ovh" {
endpoint = var.ovh_endpoint
application_key = var.ovh_application_key
application_secret = var.ovh_application_secret
consumer_key = var.ovh_consumer_key
}
+30
View File
@@ -0,0 +1,30 @@
variable "ovh_endpoint" {
type = string
description = "The OVH API endpoint"
default = "ovh-eu"
}
variable "ovh_application_key" {
type = string
sensitive = true
}
variable "ovh_application_secret" {
type = string
sensitive = true
}
variable "ovh_consumer_key" {
type = string
sensitive = true
}
variable "ovh_project_id" {
type = string
description = "The OVH Public Cloud Project ID (Service Name)"
}
variable "ssh_public_key" {
type = string
description = "The public SSH key to install on the VM"
}