From 3c1176690d1b125e7f93912f110846ef8b90ced8 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Mon, 18 Nov 2019 10:09:52 -0800 Subject: [PATCH] Use name, not id to fetch dns managed zone datasource --- .../terraform/data_sources/data_source_dns_managed_zone.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/third_party/terraform/data_sources/data_source_dns_managed_zone.go b/third_party/terraform/data_sources/data_source_dns_managed_zone.go index e5a281b8598e..23ff76c8237e 100644 --- a/third_party/terraform/data_sources/data_source_dns_managed_zone.go +++ b/third_party/terraform/data_sources/data_source_dns_managed_zone.go @@ -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 }