terraform { required_providers { namecheap = { source = "namecheap/namecheap" version = "~> 2.1.0" } } backend "http" {} } provider "namecheap" {} variable "stash_domain" { type = string default = "web.stash" } variable "web_addr" { type = string default = "::db" } variable "feed_addr" { type = string default = "::feed" } variable "app_addr" { type = string default = "::beef" } variable "ip4_ext" { type = string default = "0.0.0.0" } resource "namecheap_domain_records" "stash" { domain = var.stash_domain record { hostname = "www" address = var.web_addr type = "AAAA" } record { hostname = "www" address = var.ip4_ext type = "A" } record { hostname = "feed" address = var.feed_addr type = "AAAA" } record { hostname = "feed" address = var.ip4_ext type = "A" } record { hostname = "app" address = var.app_addr type = "AAAA" } record { hostname = "app" address = var.ip4_ext type = "A" } record { hostname = "@" address = "www.${var.stash_domain}" type = "CNAME" } record { hostname = "plex" address = "feed.${var.stash_domain}" type = "CNAME" } }