mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-02 00:31:04 +00:00
provider/google: provide assigned_nat_ip as well as nat_ip
This commit is contained in:
parent
9fbfce3add
commit
30f67eae3b
@ -136,9 +136,13 @@ func resourceComputeInstance() *schema.Resource {
|
|||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"nat_ip": &schema.Schema{
|
"nat_ip": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"assigned_nat_ip": &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -629,9 +633,10 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error
|
|||||||
var natIP string
|
var natIP string
|
||||||
accessConfigs := make(
|
accessConfigs := make(
|
||||||
[]map[string]interface{}, 0, len(iface.AccessConfigs))
|
[]map[string]interface{}, 0, len(iface.AccessConfigs))
|
||||||
for _, config := range iface.AccessConfigs {
|
for j, config := range iface.AccessConfigs {
|
||||||
accessConfigs = append(accessConfigs, map[string]interface{}{
|
accessConfigs = append(accessConfigs, map[string]interface{}{
|
||||||
"nat_ip": config.NatIP,
|
"nat_ip": d.Get(fmt.Sprintf("network_interface.%d.access_config.%d.nat_ip", i, j)),
|
||||||
|
"assigned_nat_ip": config.NatIP,
|
||||||
})
|
})
|
||||||
|
|
||||||
if natIP == "" {
|
if natIP == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user