module "cluster-app-365zon" {
  source = "../../modules/cluster"

  wait_on = module.argocd.installed

  prefix = "app"
  name   = "365zon"

  k8s_config_yaml = data.minio_s3_object.k8s_yaml.content

  hcloud_network_id = data.vault_kv_secret_v2.hcloud.data["network_id"]
  hcloud_token      = data.vault_kv_secret_v2.hcloud.data["token"]

  minio_server = var.minio_server
  vault_server = var.vault_addr
  vault_token  = data.vault_kv_secret_v2.clusters.data["app-365zon"]

  rancher_admin_token = data.vault_kv_secret_v2.rancher.data["token"]
  rancher_server_uri  = var.rancher_server

  hosts = [
    "365zon.fourlights.dev",
    "*.365zon.fourlights.dev",
  ]
  node_instance_type = "cx32"
}

output "cluster-app-365zon-vault-token" {
  value     = data.vault_kv_secret_v2.clusters.data["app-365zon"]
  sensitive = true
}
