Terraform module to create Virtual Machines in Azure.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
2.5KB

  1. ###
  2. # Availability set
  3. ###
  4. output "availability_set_id" {
  5. value = concat(azurerm_availability_set.this.*.id, [""])[0]
  6. }
  7. ###
  8. # Network Interface
  9. ###
  10. output "network_interface_ids" {
  11. value = var.linux_vm_enabled != true && var.network_interface_count > 0 && compact(concat(var.network_interface_exists ? data.azurerm_network_interface.this.*.id : azurerm_network_interface.this.*.id, [""])) != [] ? zipmap(azurerm_windows_virtual_machine.this.*.id, chunklist(compact(concat(var.network_interface_exists ? data.azurerm_network_interface.this.*.id : azurerm_network_interface.this.*.id, [""])), var.network_interface_count)) : zipmap(azurerm_linux_virtual_machine.this.*.id, chunklist(compact(concat(var.network_interface_exists ? data.azurerm_network_interface.this.*.id : azurerm_network_interface.this.*.id, [""])), var.network_interface_count))
  12. }
  13. output "network_interface_private_ip_addresses" {
  14. value = var.linux_vm_enabled != true && var.network_interface_count > 0 && compact(concat(var.network_interface_exists ? data.azurerm_network_interface.this.*.private_ip_address : azurerm_network_interface.this.*.private_ip_address, [""])) != [] ? zipmap(azurerm_windows_virtual_machine.this.*.id, chunklist(compact(concat(var.network_interface_exists ? data.azurerm_network_interface.this.*.private_ip_address : azurerm_network_interface.this.*.private_ip_address, [""])), var.network_interface_count)) : zipmap(azurerm_linux_virtual_machine.this.*.id, chunklist(compact(concat(var.network_interface_exists ? data.azurerm_network_interface.this.*.private_ip_address : azurerm_network_interface.this.*.private_ip_address, [""])), var.network_interface_count))
  15. }
  16. ###
  17. # Virtual Machines
  18. ###
  19. output "ids" {
  20. value = var.linux_vm_enabled != true ? azurerm_windows_virtual_machine.this.*.id : azurerm_linux_virtual_machine.this.*.id
  21. }
  22. output "identities" {
  23. value = var.linux_vm_enabled != true ? azurerm_windows_virtual_machine.this.*.identity : azurerm_linux_virtual_machine.this.*.identity
  24. }
  25. ###
  26. # Marketplace Agreement
  27. ###
  28. output "marketplace_agreement_ids" {
  29. value = azurerm_marketplace_agreement.this.*.id
  30. }
  31. ###
  32. # Managed Disks
  33. ###
  34. output "managed_disk_ids" {
  35. value = var.linux_vm_enabled != true && var.managed_disk_count > 0 && compact(concat(azurerm_managed_disk.this.*.id, [""])) != [] ? zipmap(azurerm_windows_virtual_machine.this.*.id, chunklist(compact(concat(azurerm_managed_disk.this.*.id, [""])), var.managed_disk_count)) : zipmap(azurerm_linux_virtual_machine.this.*.id, chunklist(compact(concat(azurerm_managed_disk.this.*.id, [""])), var.managed_disk_count))
  36. }