namecheap: handle narwhal subdomains

main
Ricard Illa 2022-08-23 17:24:21 +02:00
parent 1ee173a844
commit 2d269ab267
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
1 changed files with 19 additions and 0 deletions

View File

@ -19,6 +19,16 @@ variable "caladan-hostnames" {
default = ["@"] default = ["@"]
} }
// These are subdomains for services hosted on the host named `narwhal`.
// They are only accessible from my internal network and my internal DNS server
// takes care of that.
// But I set the public A record to caladan's ipv4 just for renewing their
// letsencrypt certificates. No need to set the AAAA record.
variable "narwhal-hostnames" {
type = set(string)
default = ["authelia"]
}
provider "namecheap" { provider "namecheap" {
user_name = "gthar" user_name = "gthar"
api_user = "gthar" api_user = "gthar"
@ -39,6 +49,15 @@ resource "namecheap_domain_records" "monotremata-xyz" {
} }
} }
dynamic "record" {
for_each = var.narwhal-hostnames
content {
hostname = record.value
type = "A"
address = var.caladan-ips.v4
}
}
dynamic "record" { dynamic "record" {
for_each = var.caladan-hostnames for_each = var.caladan-hostnames
content { content {