» Data Source: azurerm_virtual_machine

Use this data source to access information about an existing Virtual Machine.

» Example Usage

data "azurerm_virtual_machine" "test" {
  name                = "production"
  resource_group_name = "networking"
}

output "virtual_machine_id" {
  value = "${data.azurerm_virtual_machine.test.id}"
}

» Argument Reference

  • name - (Required) Specifies the name of the Virtual Machine.
  • resource_group_name - (Required) Specifies the name of the resource group the Virtual Machine is located in.

» Attributes Reference

  • id - The ID of the Virtual Machine.