2017-07-31 16:27:18 +00:00
|
|
|
package google
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2018-06-22 07:00:30 +00:00
|
|
|
"testing"
|
|
|
|
|
2017-07-31 16:27:18 +00:00
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccDataSourceDnsManagedZone_basic(t *testing.T) {
|
2017-10-12 22:07:29 +00:00
|
|
|
t.Parallel()
|
|
|
|
|
2017-07-31 16:27:18 +00:00
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckDnsManagedZoneDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
2018-12-14 20:51:11 +00:00
|
|
|
{
|
2017-11-28 00:32:00 +00:00
|
|
|
Config: testAccDataSourceDnsManagedZone_basic(),
|
2019-05-20 23:11:01 +00:00
|
|
|
Check: checkDataSourceStateMatchesResourceState("data.google_dns_managed_zone.qa", "google_dns_managed_zone.foo"),
|
2017-07-31 16:27:18 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2017-11-28 00:32:00 +00:00
|
|
|
func testAccDataSourceDnsManagedZone_basic() string {
|
|
|
|
return fmt.Sprintf(`
|
2017-07-31 16:27:18 +00:00
|
|
|
resource "google_dns_managed_zone" "foo" {
|
|
|
|
name = "qa-zone-%s"
|
2018-06-22 07:00:30 +00:00
|
|
|
dns_name = "qa.tf-test.club."
|
2017-07-31 16:27:18 +00:00
|
|
|
description = "QA DNS zone"
|
|
|
|
}
|
|
|
|
|
|
|
|
data "google_dns_managed_zone" "qa" {
|
|
|
|
name = "${google_dns_managed_zone.foo.name}"
|
|
|
|
}
|
|
|
|
`, acctest.RandString(10))
|
2017-11-28 00:32:00 +00:00
|
|
|
}
|