Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dns managed zone test #5063

Merged
merged 1 commit into from
Dec 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions google/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/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.