# À vous d'exposer :
# 1. Les IPs internes de toutes les instances
# 2. L'IP publique du frontend
# 3. Les noms des instances

output "ip_interne" {
  value = {
    frontend = google_compute_subnetwork.frontend_subnet_id.network_interface[0].network_ip
    backend = google_compute_subnetwork.backend_subnet_id.network_interface[0].network_ip
    database = google_compute_subnetwork.database_subnet_id.network_interface[0].network_ip
  }
}

output "ip_public_frontend" {
  value = google_compute_instance.frontend_subnet_id.network_interface[0].access_config[0].nat_ip
}

output "nom_instance" {
  value = {
    frontend = google_compute_instance.frontend_subnet_id.name
    backend = google_compute_instance.backend_subnet_id.name
    database = google_compute_instance.database_subnet_id.name
  }
}
