-
Notifications
You must be signed in to change notification settings - Fork 19
/
org-np-app1.tf
63 lines (50 loc) · 1.96 KB
/
org-np-app1.tf
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
59
60
61
62
63
/*
# Find GCE Instances
data "google_compute_instance" "server1" {
name = "org-app1-vm-dev-nginx-vm"
project = "${var.service_project_id}"
zone = "${var.region}-a"
}
# DNS Records Configuration
resource "google_dns_record_set" "server1" {
name = "server1.${google_dns_managed_zone.private.dns_name}"
project = "${var.host_project_id}"
type = "A"
ttl = 300
managed_zone = "${google_dns_managed_zone.private.name}"
rrdatas = ["${data.google_compute_instance.server1.network_interface.0.network_ip}"]
}
resource "google_dns_record_set" "server1_reverse" {
name = "${element(split(".", google_dns_record_set.server1.rrdatas.0), 3)}.${element(split(".", "${google_dns_record_set.server1.rrdatas.0}"), 2)}.${google_dns_managed_zone.private_reverse.dns_name}"
project = "${var.host_project_id}"
type = "PTR"
ttl = 300
managed_zone = "${google_dns_managed_zone.private_reverse.name}"
rrdatas = ["${google_dns_record_set.server1.name}"]
}
*/
/*
# Find Internal Load Balancer (Forwarding Rule)
data "google_compute_forwarding_rule" "gke1" {
name = "org-app1-gke-dev-gke-forward"
project = "${var.service_project_gke_id}"
region = "${var.region}"
}
# DNS Records Configuration
resource "google_dns_record_set" "gke1" {
name = "gke1.${google_dns_managed_zone.private.dns_name}"
project = "${var.host_project_id}"
type = "A"
ttl = 300
managed_zone = "${google_dns_managed_zone.private.name}"
rrdatas = ["${data.google_compute_forwarding_rule.gke.ip_address}"]
}
resource "google_dns_record_set" "gke1_reverse" {
name = "${element(split(".", google_dns_record_set.gke1.rrdatas.0), 3)}.${element(split(".", "${google_dns_record_set.gke1.rrdatas.0}"), 2)}.${google_dns_managed_zone.private_reverse.dns_name}"
project = "${var.host_project_id}"
type = "PTR"
ttl = 300
managed_zone = "${google_dns_managed_zone.private_reverse.name}"
rrdatas = ["${google_dns_record_set.gke1.name}"]
}
*/