-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdns.tf
More file actions
59 lines (51 loc) · 1.51 KB
/
dns.tf
File metadata and controls
59 lines (51 loc) · 1.51 KB
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
48
49
50
51
52
53
54
55
56
57
58
provider "google" {
region = "[REGION ID]"
project = "[PROJECT ID]"
}
resource "google_dns_managed_zone" "[COMPANY]" {
name = "[COMPANY]"
dns_name = "[COMPANY].com."
description = "Root Public DNS zone"
project = "[PROJECT ID]"
}
resource "google_dns_managed_zone" "demo" {
name = "demo-zone"
dns_name = "demo.[COMPANY].com."
description = "DEMO Public DNS zone"
project = "[PROJECT ID]"
}
resource "google_dns_managed_zone" "test" {
name = "test-zone"
dns_name = "test.[COMPANY].com."
description = "TEST Public DNS zone"
project = "[PROJECT ID]"
}
#Terraform doesn't like '@'
resource "google_dns_record_set" "at" {
name = "@.${google_dns_managed_zone.[COMPANY].dns_name}"
managed_zone = "${google_dns_managed_zone.[COMPANY].name}"
type = "A"
ttl = "60"
rrdatas = ["IP"]
}
resource "google_dns_record_set" "demo" {
name = "demo.${google_dns_managed_zone.kp.dns_name}"
managed_zone = "${google_dns_managed_zone.kp.name}"
type = "A"
ttl = "60"
rrdatas = ["IP"]
}
resource "google_dns_record_set" "wiki" {
name = "wiki.${google_dns_managed_zone.[COMPANY].dns_name}"
managed_zone = "${google_dns_managed_zone.[COMPANY].name}"
type = "A"
ttl = "60"
rrdatas = ["IP"]
}
resource "google_dns_record_set" "www" {
name = "www.${google_dns_managed_zone.[COMPANY].dns_name}"
managed_zone = "${google_dns_managed_zone.[COMPANY].name}"
type = "CNAME"
ttl = "60"
rrdatas = ["[COMPANY].com."]
}