Compare commits
2
Commits
main
...
ovh-classic
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14241d4e18 | ||
|
|
dd0351ad49 |
@@ -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"
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user