# Outputs for On-Prem HCI Module

output "cluster_name" {
  value = local.hci_platform == "azure-stack-hci" ? (
    try(azapi_resource.azure_stack_hci_cluster[0].name, "${local.name_prefix}-hci")
  ) : (
    "${local.name_prefix}-hci"
  )
  description = "HCI cluster name"
}

output "region" {
  value       = try(var.environment_config.region, "onprem")
  description = "Region/location identifier"
}

output "kubeconfig" {
  value       = null  # Will be generated by external script or Arc agent
  description = "Kubeconfig for the cluster"
  sensitive   = true
}

output "vm_ips" {
  value = local.hci_platform == "vsphere" ? {
    system    = [for vm in vsphere_virtual_machine.system : vm.default_ip_address]
    validators = [for vm in vsphere_virtual_machine.validators : vm.default_ip_address]
    rpc       = [for vm in vsphere_virtual_machine.rpc : vm.default_ip_address]
  } : {}
  description = "VM IP addresses (vSphere only)"
}

