From a67d487aa559f400988794ff3d6572da6bbecad3 Mon Sep 17 00:00:00 2001 From: "S. Brent Faulkner" Date: Sun, 7 May 2017 11:43:52 -0400 Subject: [PATCH] unless id is set, txt record set is not available --- builtin/providers/dns/data_dns_txt_record_set.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/providers/dns/data_dns_txt_record_set.go b/builtin/providers/dns/data_dns_txt_record_set.go index 67cb47e82..ad03ccb24 100644 --- a/builtin/providers/dns/data_dns_txt_record_set.go +++ b/builtin/providers/dns/data_dns_txt_record_set.go @@ -34,6 +34,7 @@ func dataSourceDnsTxtRecordSet() *schema.Resource { func dataSourceDnsTxtRecordSetRead(d *schema.ResourceData, meta interface{}) error { host := d.Get("host").(string) + records, err := net.LookupTXT(host) if err != nil { return fmt.Errorf("error looking up TXT records for %q: %s", host, err) @@ -45,5 +46,7 @@ func dataSourceDnsTxtRecordSetRead(d *schema.ResourceData, meta interface{}) err d.Set("record", "") } d.Set("records", records) + d.SetId(host) + return nil }