From bbc14f2a193b18da96b7674172a94b8b43583a11 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Wed, 4 Dec 2019 18:38:16 +0000 Subject: [PATCH] Update dns managed zone test Signed-off-by: Modular Magician --- google/data_source_dns_managed_zone.go | 10 ++++++++-- google/data_source_dns_managed_zone_test.go | 9 ++++++++- website/docs/d/dns_managed_zone.html.markdown | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/google/data_source_dns_managed_zone.go b/google/data_source_dns_managed_zone.go index 23ff76c8237..f38f2dad141 100644 --- a/google/data_source_dns_managed_zone.go +++ b/google/data_source_dns_managed_zone.go @@ -27,15 +27,19 @@ func dataSourceDnsManagedZone() *schema.Resource { }, "name_servers": { - Type: schema.TypeSet, + Type: schema.TypeList, Computed: true, Elem: &schema.Schema{ Type: schema.TypeString, }, }, - // Google Cloud DNS ManagedZone resources do not have a SelfLink attribute. + "visibility": { + Type: schema.TypeString, + Computed: true, + }, + // Google Cloud DNS ManagedZone resources do not have a SelfLink attribute. "project": { Type: schema.TypeString, Optional: true, @@ -65,6 +69,8 @@ func dataSourceDnsManagedZoneRead(d *schema.ResourceData, meta interface{}) erro d.Set("name", zone.Name) d.Set("dns_name", zone.DnsName) d.Set("description", zone.Description) + d.Set("visibility", zone.Visibility) + d.Set("project", project) return nil } diff --git a/google/data_source_dns_managed_zone_test.go b/google/data_source_dns_managed_zone_test.go index 34d014f504d..504df14f24e 100644 --- a/google/data_source_dns_managed_zone_test.go +++ b/google/data_source_dns_managed_zone_test.go @@ -18,7 +18,14 @@ func TestAccDataSourceDnsManagedZone_basic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccDataSourceDnsManagedZone_basic(), - Check: checkDataSourceStateMatchesResourceState("data.google_dns_managed_zone.qa", "google_dns_managed_zone.foo"), + Check: checkDataSourceStateMatchesResourceStateWithIgnores( + "data.google_dns_managed_zone.qa", + "google_dns_managed_zone.foo", + map[string]struct{}{ + "dnssec_config.#": {}, + "private_visibility_config.#": {}, + }, + ), }, }, }) diff --git a/website/docs/d/dns_managed_zone.html.markdown b/website/docs/d/dns_managed_zone.html.markdown index 3d2403963b8..3c55800f266 100644 --- a/website/docs/d/dns_managed_zone.html.markdown +++ b/website/docs/d/dns_managed_zone.html.markdown @@ -48,3 +48,6 @@ The following attributes are exported: * `name_servers` - The list of nameservers that will be authoritative for this domain. Use NS records to redirect from your DNS provider to these names, thus making Google Cloud DNS authoritative for this zone. + +* `visibility` - The zone's visibility: public zones are exposed to the Internet, + while private zones are visible only to Virtual Private Cloud resources.