namecheap: handle narwhal subdomains
parent
1ee173a844
commit
2d269ab267
19
namecheap.tf
19
namecheap.tf
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue