name = "upcloud_provider_fragment"

[[elements]]
border_bottom = true
border_top = true
name = "upcloud_header"
title = "☁️  UpCloud Configuration"
type = "section_header"

[[elements]]
help = "Your UpCloud account username for API authentication"
name = "upcloud_username"
nickel_path = ["provider", "upcloud_username"]
prompt = "UpCloud username"
required = true
type = "text"

[[elements]]
help = "Your UpCloud account password (will be masked)"
name = "upcloud_password"
nickel_path = ["provider", "upcloud_password"]
prompt = "UpCloud password"
required = true
type = "password"

[[elements]]
default = "de-fra1"
help = "UpCloud zone where resources will be deployed"
name = "upcloud_zone"
nickel_path = ["provider", "upcloud_zone"]
options = [
  { value = "fi-hel1", label = "FI-HEL1 - Helsinki, Finland" },
  { value = "fi-hel2", label = "FI-HEL2 - Helsinki, Finland (Secondary)" },
  { value = "de-fra1", label = "DE-FRA1 - Frankfurt, Germany" },
  { value = "uk-lon1", label = "UK-LON1 - London, United Kingdom" },
  { value = "nl-ams1", label = "NL-AMS1 - Amsterdam, Netherlands" },
  { value = "us-chi1", label = "US-CHI1 - Chicago, USA" },
  { value = "us-nyc1", label = "US-NYC1 - New York, USA" },
  { value = "us-sjo1", label = "US-SJO1 - San Jose, USA" },
  { value = "sg-sin1", label = "SG-SIN1 - Singapore" },
  { value = "au-syd1", label = "AU-SYD1 - Sydney, Australia" },
  { value = "es-mad1", label = "ES-MAD1 - Madrid, Spain" },
  { value = "pl-waw1", label = "PL-WAW1 - Warsaw, Poland" },
]
prompt = "Availability zone"
required = true
type = "select"

[[elements]]
default = "2xCPU-4GB"
help = "UpCloud server plan (determines CPU, RAM, and storage)"
name = "upcloud_plan"
nickel_path = ["provider", "upcloud_plan"]
options = [
  { value = "1xCPU-1GB", label = "1xCPU-1GB - 1 vCPU, 1 GB RAM, 25 GB SSD" },
  { value = "1xCPU-2GB", label = "1xCPU-2GB - 1 vCPU, 2 GB RAM, 50 GB SSD" },
  { value = "2xCPU-4GB", label = "2xCPU-4GB - 2 vCPU, 4 GB RAM, 80 GB SSD" },
  { value = "4xCPU-8GB", label = "4xCPU-8GB - 4 vCPU, 8 GB RAM, 160 GB SSD" },
  { value = "6xCPU-16GB", label = "6xCPU-16GB - 6 vCPU, 16 GB RAM, 320 GB SSD" },
  { value = "8xCPU-32GB", label = "8xCPU-32GB - 8 vCPU, 32 GB RAM, 640 GB SSD" },
  { value = "12xCPU-48GB", label = "12xCPU-48GB - 12 vCPU, 48 GB RAM, 960 GB SSD" },
  { value = "16xCPU-64GB", label = "16xCPU-64GB - 16 vCPU, 64 GB RAM, 1280 GB SSD" },
  { value = "20xCPU-96GB", label = "20xCPU-96GB - 20 vCPU, 96 GB RAM, 1920 GB SSD" },
  { value = "20xCPU-128GB", label = "20xCPU-128GB - 20 vCPU, 128 GB RAM, 2048 GB SSD" },
]
prompt = "Server plan"
required = true
type = "select"

[[elements]]
default = "Ubuntu Server 24.04 LTS (Noble Numbat)"
help = "Operating system template for the server"
name = "upcloud_template"
nickel_path = ["provider", "upcloud_template"]
options = [
  { value = "Ubuntu Server 24.04 LTS (Noble Numbat)", label = "Ubuntu 24.04 LTS (Latest)" },
  { value = "Ubuntu Server 22.04 LTS (Jammy Jellyfish)", label = "Ubuntu 22.04 LTS" },
  { value = "Ubuntu Server 20.04 LTS (Focal Fossa)", label = "Ubuntu 20.04 LTS" },
  { value = "Debian 12 (Bookworm)", label = "Debian 12 (Bookworm)" },
  { value = "Debian 11 (Bullseye)", label = "Debian 11 (Bullseye)" },
  { value = "Debian 10 (Buster)", label = "Debian 10 (Buster)" },
  { value = "Rocky Linux 9", label = "Rocky Linux 9" },
  { value = "Rocky Linux 8", label = "Rocky Linux 8" },
  { value = "AlmaLinux 9", label = "AlmaLinux 9" },
  { value = "AlmaLinux 8", label = "AlmaLinux 8" },
]
prompt = "Operating system template"
required = true
type = "select"

[[elements]]
help = "Hostname for the UpCloud server"
name = "upcloud_hostname"
nickel_path = ["provider", "upcloud_hostname"]
prompt = "Server hostname"
required = true
type = "text"

[[elements]]
default = "25"
help = "Additional storage size in GB (beyond plan default)"
name = "upcloud_storage_size"
nickel_path = ["provider", "upcloud_storage_size"]
prompt = "Storage size (GB)"
required = true
type = "text"

[[elements]]
default = true
help = "Enable UpCloud private networking (SDN) for this server"
name = "upcloud_private_networking"
nickel_path = ["provider", "upcloud_private_networking"]
prompt = "Enable private networking?"
type = "confirm"

[[elements]]
default = false
help = "Enable automated daily backups (additional cost)"
name = "upcloud_backups"
nickel_path = ["provider", "upcloud_backups"]
prompt = "Enable automated backups?"
type = "confirm"
