Merge pull request #13671 from JDiPierro/google_address_name_fix
provider/google: Set name field when reading addresses
This commit is contained in:
commit
600a117301
|
@ -15,10 +15,7 @@ func resourceComputeAddress() *schema.Resource {
|
||||||
Read: resourceComputeAddressRead,
|
Read: resourceComputeAddressRead,
|
||||||
Delete: resourceComputeAddressDelete,
|
Delete: resourceComputeAddressDelete,
|
||||||
Importer: &schema.ResourceImporter{
|
Importer: &schema.ResourceImporter{
|
||||||
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
|
State: schema.ImportStatePassthrough,
|
||||||
d.Set("name", d.Id())
|
|
||||||
return []*schema.ResourceData{d}, nil
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": &schema.Schema{
|
||||||
|
@ -113,6 +110,7 @@ func resourceComputeAddressRead(d *schema.ResourceData, meta interface{}) error
|
||||||
|
|
||||||
d.Set("address", addr.Address)
|
d.Set("address", addr.Address)
|
||||||
d.Set("self_link", addr.SelfLink)
|
d.Set("self_link", addr.SelfLink)
|
||||||
|
d.Set("name", addr.Name)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,7 @@ func resourceComputeGlobalAddress() *schema.Resource {
|
||||||
Read: resourceComputeGlobalAddressRead,
|
Read: resourceComputeGlobalAddressRead,
|
||||||
Delete: resourceComputeGlobalAddressDelete,
|
Delete: resourceComputeGlobalAddressDelete,
|
||||||
Importer: &schema.ResourceImporter{
|
Importer: &schema.ResourceImporter{
|
||||||
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
|
State: schema.ImportStatePassthrough,
|
||||||
d.Set("name", d.Id())
|
|
||||||
return []*schema.ResourceData{d}, nil
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": &schema.Schema{
|
||||||
|
@ -97,6 +94,7 @@ func resourceComputeGlobalAddressRead(d *schema.ResourceData, meta interface{})
|
||||||
|
|
||||||
d.Set("address", addr.Address)
|
d.Set("address", addr.Address)
|
||||||
d.Set("self_link", addr.SelfLink)
|
d.Set("self_link", addr.SelfLink)
|
||||||
|
d.Set("name", addr.Name)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue