# Generated by Merlya - basic-vm template v{{ template_version }}
# Outputs for {{ provider }}

{% if provider == "aws" %}
output "instance_id" {
  description = "ID of the EC2 instance"
  value       = aws_instance.{{ vm_name }}.id
}

output "public_ip" {
  description = "Public IP address"
  value       = aws_instance.{{ vm_name }}.public_ip
}

output "private_ip" {
  description = "Private IP address"
  value       = aws_instance.{{ vm_name }}.private_ip
}

{% elif provider == "gcp" %}
output "instance_id" {
  description = "ID of the compute instance"
  value       = google_compute_instance.{{ vm_name }}.id
}

output "public_ip" {
  description = "Public IP address"
  value       = google_compute_instance.{{ vm_name }}.network_interface[0].access_config[0].nat_ip
}

output "private_ip" {
  description = "Private IP address"
  value       = google_compute_instance.{{ vm_name }}.network_interface[0].network_ip
}

{% elif provider == "azure" %}
output "instance_id" {
  description = "ID of the virtual machine"
  value       = azurerm_linux_virtual_machine.{{ vm_name }}.id
}

{% if public_ip %}
output "public_ip" {
  description = "Public IP address"
  value       = azurerm_public_ip.{{ vm_name }}.ip_address
}
{% endif %}

output "private_ip" {
  description = "Private IP address"
  value       = azurerm_network_interface.{{ vm_name }}.private_ip_address
}

{% endif %}
