From e97b9fcc767617456e9134e5fd2ed3e0658653f0 Mon Sep 17 00:00:00 2001 From: Andreas Kyrris Date: Mon, 12 Sep 2016 14:17:04 +0100 Subject: [PATCH] Fix for GH-8227. Read the route table association for the subnet. --- builtin/providers/azurerm/resource_arm_subnet.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builtin/providers/azurerm/resource_arm_subnet.go b/builtin/providers/azurerm/resource_arm_subnet.go index 796202c3e186..dbdb11f112de 100644 --- a/builtin/providers/azurerm/resource_arm_subnet.go +++ b/builtin/providers/azurerm/resource_arm_subnet.go @@ -151,6 +151,12 @@ func resourceArmSubnetRead(d *schema.ResourceData, meta interface{}) error { } } + if resp.Properties.RouteTable == nil { + d.Set("route_table_id", nil) + } else { + d.Set("route_table_id", *resp.Properties.RouteTable.ID) + } + return nil }