-
Notifications
You must be signed in to change notification settings - Fork 2
/
dns.tf
58 lines (51 loc) · 1.36 KB
/
dns.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
locals {
hub_records = [
"nvr",
"hass",
"grafana",
"metrics",
"logs",
]
wg_records = {
"10.255.255.1" : "dmz",
"10.255.255.2" : "hub",
"10.255.255.4" : "metrics",
"10.255.255.5" : "codepad",
"10.255.255.6" : "goat",
"10.255.255.7" : "charts",
"10.255.255.8" : "influxdb",
"10.255.255.9" : "proxy",
}
}
resource "aws_route53_record" "gateway_infra_home_a-rwx_org" {
for_each = data.terraform_remote_state.unifi.outputs.site_addresses
zone_id = module.zones["a-rwx.org"].zone_id
name = "${each.value}.home.a-rwx.org"
type = "A"
ttl = "60"
records = [each.key]
}
resource "aws_route53_record" "linode" {
for_each = data.terraform_remote_state.linode.outputs.instance_addresses
zone_id = module.zones["a-rwx.org"].zone_id
name = "${each.key}.linode.a-rwx.org"
type = "A"
ttl = "60"
records = [each.value]
}
resource "aws_route53_record" "dmz_hub_linode_a-rwx_org" {
for_each = toset(local.hub_records)
zone_id = module.zones["a-rwx.org"].zone_id
name = "${each.key}.a-rwx.org"
type = "A"
ttl = "60"
records = ["10.0.1.112"]
}
resource "aws_route53_record" "dmz_int_a-rwx_org" {
for_each = local.wg_records
zone_id = module.zones["a-rwx.org"].zone_id
name = "${each.value}.wg0.a-rwx.org"
type = "A"
ttl = "60"
records = [each.key]
}