Data Source: azurerm_subnet

Use this data source to access the properties of an Azure Subnet located within a Virtual Network.

Example Usage

data "azurerm_subnet" "test" {
  name                 = "backend"
  virtual_network_name = "production"
  resource_group_name  = "networking"

output "subnet_id" {
  value = "${data.azurerm_subnet.test.id}"

Argument Reference

  • name - (Required) Specifies the name of the Subnet.
  • virtual_network_name - (Required) Specifies the name of the Virtual Network this Subnet is located within.
  • resource_group_name - (Required) Specifies the name of the resource group the Virtual Network is located in.

Attributes Reference

© 2018 HashiCorpLicensed under the MPL 2.0 License.