namecheap: make records a dynamic block
parent
41c01c003e
commit
682bdb708a
16
namecheap.tf
16
namecheap.tf
|
@ -5,6 +5,11 @@ variable "caladan-ip" {
|
||||||
default = "139.162.137.29"
|
default = "139.162.137.29"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "caladan-hostnames" {
|
||||||
|
type = set(string)
|
||||||
|
default = ["@"]
|
||||||
|
}
|
||||||
|
|
||||||
provider "namecheap" {
|
provider "namecheap" {
|
||||||
user_name = "gthar"
|
user_name = "gthar"
|
||||||
api_user = "gthar"
|
api_user = "gthar"
|
||||||
|
@ -16,9 +21,12 @@ resource "namecheap_domain_records" "monotremata-xyz" {
|
||||||
domain = "monotremata.xyz"
|
domain = "monotremata.xyz"
|
||||||
mode = "MERGE" // maybe eventually move to OVERWRITE
|
mode = "MERGE" // maybe eventually move to OVERWRITE
|
||||||
|
|
||||||
record {
|
dynamic "record" {
|
||||||
hostname = "@"
|
for_each = var.caladan-hostnames
|
||||||
type = "A"
|
content {
|
||||||
address = var.caladan-ip
|
hostname = record.value
|
||||||
|
type = "A"
|
||||||
|
address = var.caladan-ip
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue