forked from hashicorp/terraform-provider-google
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_source_dns_managed_zone.go
47 lines (37 loc) · 995 Bytes
/
data_source_dns_managed_zone.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package google
import "github.com/hashicorp/terraform/helper/schema"
func dataSourceDnsManagedZone() *schema.Resource {
return &schema.Resource{
Read: dataSourceDnsManagedZoneRead,
Schema: map[string]*schema.Schema{
"dns_name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
"name": &schema.Schema{
Type: schema.TypeString,
Required: true,
},
"description": &schema.Schema{
Type: schema.TypeString,
Computed: true,
},
"name_servers": &schema.Schema{
Type: schema.TypeSet,
Computed: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
// Google Cloud DNS ManagedZone resources do not have a SelfLink attribute.
"project": &schema.Schema{
Type: schema.TypeString,
Optional: true,
},
},
}
}
func dataSourceDnsManagedZoneRead(d *schema.ResourceData, meta interface{}) error {
d.SetId(d.Get("name").(string))
return resourceDnsManagedZoneRead(d, meta)
}