name = "gcp_provider_fragment"

[[elements]]
border_bottom = true
border_top = true
name = "gcp_header"
title = "☁️  Google Cloud Platform (GCP) Configuration"
type = "section_header"

[[elements]]
help = "Your Google Cloud Project ID (e.g., my-project-123456)"
name = "gcp_project_id"
nickel_path = ["provider", "gcp_project_id"]
prompt = "GCP Project ID"
required = true
type = "text"

[[elements]]
help = "Path to service account JSON key file (e.g., ~/.gcp/credentials.json)"
name = "gcp_credentials_file"
nickel_path = ["provider", "gcp_credentials_file"]
prompt = "Service Account credentials file path"
required = true
type = "text"

[[elements]]
default = "europe-west3"
help = "GCP region where resources will be deployed"
name = "gcp_region"
nickel_path = ["provider", "gcp_region"]
options = [
  { value = "us-central1", label = "US-CENTRAL1 - Iowa, USA" },
  { value = "us-east1", label = "US-EAST1 - South Carolina, USA" },
  { value = "us-east4", label = "US-EAST4 - Northern Virginia, USA" },
  { value = "us-west1", label = "US-WEST1 - Oregon, USA" },
  { value = "us-west2", label = "US-WEST2 - Los Angeles, USA" },
  { value = "us-west3", label = "US-WEST3 - Salt Lake City, USA" },
  { value = "us-west4", label = "US-WEST4 - Las Vegas, USA" },
  { value = "europe-west1", label = "EUROPE-WEST1 - Belgium" },
  { value = "europe-west2", label = "EUROPE-WEST2 - London, UK" },
  { value = "europe-west3", label = "EUROPE-WEST3 - Frankfurt, Germany" },
  { value = "europe-west4", label = "EUROPE-WEST4 - Netherlands" },
  { value = "europe-west6", label = "EUROPE-WEST6 - Zurich, Switzerland" },
  { value = "europe-north1", label = "EUROPE-NORTH1 - Finland" },
  { value = "asia-east1", label = "ASIA-EAST1 - Taiwan" },
  { value = "asia-east2", label = "ASIA-EAST2 - Hong Kong" },
  { value = "asia-northeast1", label = "ASIA-NORTHEAST1 - Tokyo, Japan" },
  { value = "asia-northeast2", label = "ASIA-NORTHEAST2 - Osaka, Japan" },
  { value = "asia-northeast3", label = "ASIA-NORTHEAST3 - Seoul, South Korea" },
  { value = "asia-south1", label = "ASIA-SOUTH1 - Mumbai, India" },
  { value = "asia-southeast1", label = "ASIA-SOUTHEAST1 - Singapore" },
  { value = "asia-southeast2", label = "ASIA-SOUTHEAST2 - Jakarta, Indonesia" },
  { value = "australia-southeast1", label = "AUSTRALIA-SOUTHEAST1 - Sydney, Australia" },
  { value = "southamerica-east1", label = "SOUTHAMERICA-EAST1 - São Paulo, Brazil" },
]
prompt = "GCP Region"
required = true
type = "select"

[[elements]]
default = "a"
help = "Zone within the selected region (e.g., 'a' for europe-west3-a)"
name = "gcp_zone"
nickel_path = ["provider", "gcp_zone"]
options = [
  { value = "a", label = "Zone A (primary)" },
  { value = "b", label = "Zone B" },
  { value = "c", label = "Zone C" },
  { value = "d", label = "Zone D (if available)" },
]
prompt = "Availability Zone"
required = true
type = "select"

[[elements]]
default = "e2-medium"
help = "GCP Compute Engine machine type (determines CPU, RAM, and pricing)"
name = "gcp_machine_type"
nickel_path = ["provider", "gcp_machine_type"]
options = [
  { value = "e2-micro", label = "e2-micro - 2 vCPU (shared), 1 GB RAM (Free tier)" },
  { value = "e2-small", label = "e2-small - 2 vCPU (shared), 2 GB RAM" },
  { value = "e2-medium", label = "e2-medium - 2 vCPU (shared), 4 GB RAM" },
  { value = "e2-standard-2", label = "e2-standard-2 - 2 vCPU, 8 GB RAM" },
  { value = "e2-standard-4", label = "e2-standard-4 - 4 vCPU, 16 GB RAM" },
  { value = "e2-standard-8", label = "e2-standard-8 - 8 vCPU, 32 GB RAM" },
  { value = "n1-standard-1", label = "n1-standard-1 - 1 vCPU, 3.75 GB RAM" },
  { value = "n1-standard-2", label = "n1-standard-2 - 2 vCPU, 7.5 GB RAM" },
  { value = "n1-standard-4", label = "n1-standard-4 - 4 vCPU, 15 GB RAM" },
  { value = "n2-standard-2", label = "n2-standard-2 - 2 vCPU, 8 GB RAM (newer generation)" },
  { value = "n2-standard-4", label = "n2-standard-4 - 4 vCPU, 16 GB RAM (newer generation)" },
  { value = "n2-standard-8", label = "n2-standard-8 - 8 vCPU, 32 GB RAM (newer generation)" },
  { value = "n2-highmem-2", label = "n2-highmem-2 - 2 vCPU, 16 GB RAM (memory optimized)" },
  { value = "n2-highmem-4", label = "n2-highmem-4 - 4 vCPU, 32 GB RAM (memory optimized)" },
  { value = "c2-standard-4", label = "c2-standard-4 - 4 vCPU, 16 GB RAM (compute optimized)" },
  { value = "c2-standard-8", label = "c2-standard-8 - 8 vCPU, 32 GB RAM (compute optimized)" },
]
prompt = "Machine Type"
required = true
type = "select"

[[elements]]
default = "ubuntu-2404-lts"
help = "Operating system image family for the instance"
name = "gcp_image_family"
nickel_path = ["provider", "gcp_image_family"]
options = [
  { value = "ubuntu-2404-lts", label = "Ubuntu 24.04 LTS (Latest)" },
  { value = "ubuntu-2204-lts", label = "Ubuntu 22.04 LTS" },
  { value = "ubuntu-2004-lts", label = "Ubuntu 20.04 LTS" },
  { value = "debian-12", label = "Debian 12 (Bookworm)" },
  { value = "debian-11", label = "Debian 11 (Bullseye)" },
  { value = "rocky-linux-9", label = "Rocky Linux 9" },
  { value = "rocky-linux-8", label = "Rocky Linux 8" },
  { value = "rhel-9", label = "Red Hat Enterprise Linux 9" },
  { value = "rhel-8", label = "Red Hat Enterprise Linux 8" },
  { value = "centos-stream-9", label = "CentOS Stream 9" },
]
prompt = "Image Family"
required = true
type = "select"

[[elements]]
default = "ubuntu-os-cloud"
help = "GCP project that provides the image"
name = "gcp_image_project"
nickel_path = ["provider", "gcp_image_project"]
options = [
  { value = "ubuntu-os-cloud", label = "ubuntu-os-cloud (Ubuntu images)" },
  { value = "debian-cloud", label = "debian-cloud (Debian images)" },
  { value = "rocky-linux-cloud", label = "rocky-linux-cloud (Rocky Linux)" },
  { value = "rhel-cloud", label = "rhel-cloud (Red Hat)" },
  { value = "centos-cloud", label = "centos-cloud (CentOS)" },
]
prompt = "Image Project"
required = true
type = "select"

[[elements]]
default = "20"
help = "Boot disk size in GB (minimum 10 GB)"
name = "gcp_disk_size_gb"
nickel_path = ["provider", "gcp_disk_size_gb"]
prompt = "Boot disk size (GB)"
required = true
type = "text"

[[elements]]
default = "pd-balanced"
help = "Type of persistent disk for boot volume"
name = "gcp_disk_type"
nickel_path = ["provider", "gcp_disk_type"]
options = [
  { value = "pd-standard", label = "pd-standard - Standard persistent disk (HDD)" },
  { value = "pd-balanced", label = "pd-balanced - Balanced persistent disk (SSD, recommended)" },
  { value = "pd-ssd", label = "pd-ssd - SSD persistent disk (high performance)" },
  { value = "pd-extreme", label = "pd-extreme - Extreme persistent disk (highest IOPS)" },
]
prompt = "Disk type"
required = true
type = "select"

[[elements]]
default = "default"
help = "Name of the VPC network (use 'default' for default network)"
name = "gcp_network_name"
nickel_path = ["provider", "gcp_network_name"]
prompt = "VPC Network name"
required = true
type = "text"

[[elements]]
default = "default"
help = "Name of the subnetwork within the VPC"
name = "gcp_subnetwork_name"
nickel_path = ["provider", "gcp_subnetwork_name"]
prompt = "Subnetwork name"
required = true
type = "text"

[[elements]]
default = true
help = "Assign a public IP address to the instance"
name = "gcp_enable_external_ip"
nickel_path = ["provider", "gcp_enable_external_ip"]
prompt = "Enable external IP address?"
type = "confirm"

[[elements]]
default = false
help = "Preemptible instances are cheaper but can be stopped by GCP (not for production)"
name = "gcp_preemptible"
nickel_path = ["provider", "gcp_preemptible"]
prompt = "Use preemptible instance?"
type = "confirm"

[[elements]]
default = false
help = "Prevent accidental deletion of the instance"
name = "gcp_enable_deletion_protection"
nickel_path = ["provider", "gcp_enable_deletion_protection"]
prompt = "Enable deletion protection?"
type = "confirm"

[[elements]]
help = "SSH public key for instance access (leave empty to skip)"
name = "gcp_ssh_keys"
nickel_path = ["provider", "gcp_ssh_keys"]
prompt = "SSH public key (optional)"
required = false
type = "text"
