# Outputs for {{ project_name }} Hetzner Infrastructure
# Generated by Prism

# =============================================================================
# Network
# =============================================================================

output "network_id" {
  description = "Private network ID"
  value       = hcloud_network.main.id
}

# =============================================================================
# Staging Outputs
# =============================================================================

output "staging_server_ip" {
  description = "Staging server public IP address"
  value       = var.deploy_staging ? module.staging[0].server_ip : null
}

output "staging_server_id" {
  description = "Staging server ID"
  value       = var.deploy_staging ? module.staging[0].server_id : null
}

output "staging_private_ip" {
  description = "Staging server private IP address"
  value       = var.deploy_staging ? module.staging[0].private_ip : null
}

output "staging_volume_id" {
  description = "Staging data volume ID"
  value       = var.deploy_staging ? module.staging_volume[0].volume_id : null
}

# =============================================================================
# Production Outputs
# =============================================================================

output "production_server_ip" {
  description = "Production server public IP address"
  value       = var.deploy_production ? module.production[0].server_ip : null
}

output "production_server_id" {
  description = "Production server ID"
  value       = var.deploy_production ? module.production[0].server_id : null
}

output "production_private_ip" {
  description = "Production server private IP address"
  value       = var.deploy_production ? module.production[0].private_ip : null
}

output "production_floating_ip" {
  description = "Production floating IP address (if enabled)"
  value       = var.deploy_production && var.production_floating_ip ? module.production[0].floating_ip : null
}

output "production_volume_id" {
  description = "Production data volume ID"
  value       = var.deploy_production ? module.production_volume[0].volume_id : null
}

# =============================================================================
# SSH Commands
# =============================================================================

output "staging_ssh_command" {
  description = "SSH command for staging server"
  value       = var.deploy_staging ? "ssh deploy@${module.staging[0].server_ip}" : null
}

output "production_ssh_command" {
  description = "SSH command for production server"
  value       = var.deploy_production ? "ssh deploy@${var.production_floating_ip ? module.production[0].floating_ip : module.production[0].server_ip}" : null
}
