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 <[email protected]>
  • Loading branch information
slevenick authored and modular-magician committed Dec 3, 2019
1 parent d0d6a89 commit 949f32f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
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
1 change: 0 additions & 1 deletion google/resource_sql_database_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/terraform"

sqladmin "google.golang.org/api/sqladmin/v1beta4"
)

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 949f32f

Please sign in to comment.