mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat: dyndns
This commit is contained in:
parent
b85e850dd6
commit
3597edceaf
9 changed files with 197 additions and 13 deletions
|
|
@ -29,6 +29,10 @@ resource "cloudflare_record" "dyndns_a" {
|
|||
type = "A"
|
||||
value = "127.0.0.1"
|
||||
zone_id = cloudflare_zone.gensokyo-zone_zone.id
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [value]
|
||||
}
|
||||
}
|
||||
|
||||
resource "cloudflare_record" "dyndns_aaaa" {
|
||||
|
|
@ -38,6 +42,10 @@ resource "cloudflare_record" "dyndns_aaaa" {
|
|||
type = "AAAA"
|
||||
value = "::1"
|
||||
zone_id = cloudflare_zone.gensokyo-zone_zone.id
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [value]
|
||||
}
|
||||
}
|
||||
|
||||
output "cloudflare_dyndns_record_a" {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ module "hakurei_system_records" {
|
|||
local_subdomains = [
|
||||
"prox",
|
||||
"id",
|
||||
"ldap",
|
||||
]
|
||||
global_subdomains = [
|
||||
"plex",
|
||||
"ldap",
|
||||
]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@ variable "local_subdomains" {
|
|||
default = []
|
||||
}
|
||||
|
||||
variable "global_subdomains" {
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
locals {
|
||||
cname_records = concat(
|
||||
[for subdomain in var.local_subdomains : {
|
||||
|
|
@ -13,6 +18,10 @@ locals {
|
|||
name = "${subdomain}.tail",
|
||||
value = "${local.tailscale_name}.${var.zone_zone}",
|
||||
}] : [],
|
||||
[for subdomain in var.global_subdomains : {
|
||||
name = subdomain,
|
||||
value = "${local.global_name}.${var.zone_zone}",
|
||||
}],
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -20,7 +29,7 @@ resource "cloudflare_record" "cname_records" {
|
|||
for_each = { for i, cname in local.cname_records : cname.name => i }
|
||||
name = local.cname_records[each.value].name
|
||||
proxied = false
|
||||
ttl = 360
|
||||
ttl = 600
|
||||
type = "CNAME"
|
||||
value = local.cname_records[each.value].value
|
||||
zone_id = var.zone_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue