Skip to content

Commit

Permalink
Use name, not id to fetch dns managed zone datasource (#2712)
Browse files Browse the repository at this point in the history
Merged PR #2712.
  • Loading branch information
slevenick authored and modular-magician committed Nov 18, 2019
1 parent 841354e commit 2401e06
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ func dataSourceDnsManagedZoneRead(d *schema.ResourceData, meta interface{}) erro
return err
}

d.SetId(fmt.Sprintf("projects/%s/managedZones/%s", project, d.Get("name").(string)))
name := d.Get("name").(string)
d.SetId(fmt.Sprintf("projects/%s/managedZones/%s", project, name))

zone, err := config.clientDns.ManagedZones.Get(
project, d.Id()).Do()
project, name).Do()
if err != nil {
return err
}
Expand Down

0 comments on commit 2401e06

Please sign in to comment.