From ab71de865098e08e1274c42a086f8a9add70bb09 Mon Sep 17 00:00:00 2001 From: Dainis Tillers Date: Wed, 8 Apr 2015 15:38:07 +0300 Subject: [PATCH] Just removing network refresh wont cut it, value from config must be used --- builtin/providers/google/resource_compute_instance.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/providers/google/resource_compute_instance.go b/builtin/providers/google/resource_compute_instance.go index c9ce3d74d..c030e3546 100644 --- a/builtin/providers/google/resource_compute_instance.go +++ b/builtin/providers/google/resource_compute_instance.go @@ -546,7 +546,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error networkInterfaces := make([]map[string]interface{}, 0, 1) if networkInterfacesCount > 0 { - for _, iface := range instance.NetworkInterfaces { + for i, iface := range instance.NetworkInterfaces { // The first non-empty ip is left in natIP var natIP string accessConfigs := make( @@ -572,6 +572,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error networkInterfaces = append(networkInterfaces, map[string]interface{}{ "name": iface.Name, "address": iface.NetworkIP, + "network": d.Get(fmt.Sprintf("network_interface.%d.network", i)), "access_config": accessConfigs, }) }