Skip to content

Commit

Permalink
Update dns managed zone test
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
slevenick authored and modular-magician committed Dec 3, 2019
1 parent d127be5 commit 9bfb3fd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
10 changes: 8 additions & 2 deletions google-beta/data_source_dns_managed_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
9 changes: 8 additions & 1 deletion google-beta/data_source_dns_managed_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.#": {},
},
),
},
},
})
Expand Down
3 changes: 3 additions & 0 deletions website/docs/d/dns_managed_zone.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 9bfb3fd

Please sign in to comment.