Skip to content

Commit

Permalink
fixing id for a data source (#6476) (#12405)
Browse files Browse the repository at this point in the history
Co-authored-by: Edward Sun <[email protected]>
Signed-off-by: Modular Magician <[email protected]>

Signed-off-by: Modular Magician <[email protected]>
Co-authored-by: Edward Sun <[email protected]>
  • Loading branch information
modular-magician and Edward Sun authored Aug 26, 2022
1 parent 48dbb51 commit 7d8357c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/6476.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
compute: fixed the `id` format of the data source `google_compute_instance`
```
2 changes: 1 addition & 1 deletion google/data_source_google_compute_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,6 @@ func dataSourceGoogleComputeInstanceRead(d *schema.ResourceData, meta interface{
if err := d.Set("name", instance.Name); err != nil {
return fmt.Errorf("Error setting name: %s", err)
}
d.SetId(fmt.Sprintf("projects/%s/zones/%s/instances/%s", project, instance.Zone, instance.Name))
d.SetId(fmt.Sprintf("projects/%s/zones/%s/instances/%s", project, GetResourceNameFromSelfLink(instance.Zone), instance.Name))
return nil
}

0 comments on commit 7d8357c

Please sign in to comment.