mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-05 17:52:38 +00:00
Avoid 'source' being undefined in legacy network Read
This commit is contained in:
parent
74b4f960cb
commit
f1e26ba5de
|
@ -522,7 +522,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error
|
||||||
networks := make([]map[string]interface{}, 0, 1)
|
networks := make([]map[string]interface{}, 0, 1)
|
||||||
if networksCount > 0 {
|
if networksCount > 0 {
|
||||||
// TODO: Remove this when realizing deprecation of .network
|
// TODO: Remove this when realizing deprecation of .network
|
||||||
for _, iface := range instance.NetworkInterfaces {
|
for i, iface := range instance.NetworkInterfaces {
|
||||||
var natIP string
|
var natIP string
|
||||||
for _, config := range iface.AccessConfigs {
|
for _, config := range iface.AccessConfigs {
|
||||||
if config.Type == "ONE_TO_ONE_NAT" {
|
if config.Type == "ONE_TO_ONE_NAT" {
|
||||||
|
@ -539,6 +539,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error
|
||||||
network["name"] = iface.Name
|
network["name"] = iface.Name
|
||||||
network["external_address"] = natIP
|
network["external_address"] = natIP
|
||||||
network["internal_address"] = iface.NetworkIP
|
network["internal_address"] = iface.NetworkIP
|
||||||
|
network["source"] = d.Get(fmt.Sprintf("network.%d.source", i))
|
||||||
networks = append(networks, network)
|
networks = append(networks, network)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user