mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-28 09:26:26 -06:00
Google Addresses: Set name field on read
This commit is contained in:
parent
7b32ad2b99
commit
046cc9b9aa
builtin/providers/google
@ -15,10 +15,7 @@ func resourceComputeAddress() *schema.Resource {
|
||||
Read: resourceComputeAddressRead,
|
||||
Delete: resourceComputeAddressDelete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
|
||||
d.Set("name", d.Id())
|
||||
return []*schema.ResourceData{d}, nil
|
||||
},
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
@ -113,6 +110,7 @@ func resourceComputeAddressRead(d *schema.ResourceData, meta interface{}) error
|
||||
|
||||
d.Set("address", addr.Address)
|
||||
d.Set("self_link", addr.SelfLink)
|
||||
d.Set("name", addr.Name)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -15,10 +15,7 @@ func resourceComputeGlobalAddress() *schema.Resource {
|
||||
Read: resourceComputeGlobalAddressRead,
|
||||
Delete: resourceComputeGlobalAddressDelete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
|
||||
d.Set("name", d.Id())
|
||||
return []*schema.ResourceData{d}, nil
|
||||
},
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
@ -97,6 +94,7 @@ func resourceComputeGlobalAddressRead(d *schema.ResourceData, meta interface{})
|
||||
|
||||
d.Set("address", addr.Address)
|
||||
d.Set("self_link", addr.SelfLink)
|
||||
d.Set("name", addr.Name)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user