feat: parametrize namecheap config

main
Ricard Illa 2023-05-25 14:43:17 +02:00
parent 53ff79a63a
commit 54838d400c
3 changed files with 22 additions and 11 deletions

14
main.tf
View File

@ -13,6 +13,10 @@ terraform {
source = "vultr/vultr"
version = "2.11.4"
}
hetznerdns = {
source = "timohirt/hetznerdns"
version = ">=2.2.0"
}
}
}
@ -28,13 +32,21 @@ provider "vultr" {
module "dns" {
source = "./modules/dns"
nameservers = [
"ns1.linode.com",
"ns2.linode.com",
"ns3.linode.com",
"ns4.linode.com",
"ns5.linode.com"
]
domain = "monotremata.xyz"
caladan = {
ipv4 = "139.162.137.29"
ipv6 = "2a01:7e01::f03c:92ff:fea2:5d7c"
domains = toset([
"monotremata.xyz",
"git",
"gts",
"kb",

View File

@ -1,18 +1,12 @@
provider "namecheap" {
user_name = "gthar"
api_user = "gthar"
client_ip = "139.162.137.29" // caladan's public IP
client_ip = var.caladan.ipv4 // caladan's public IP
use_sandbox = false
}
resource "namecheap_domain_records" "namecheap-monotremata-xyz" {
domain = "monotremata.xyz"
domain = var.domain
mode = "OVERWRITE"
nameservers = [
"ns1.linode.com",
"ns2.linode.com",
"ns3.linode.com",
"ns4.linode.com",
"ns5.linode.com"
]
nameservers = var.nameservers
}

View File

@ -24,3 +24,8 @@ variable "dkim_pub_key" {
type = string
description = "dkim public key"
}
variable "nameservers" {
type = list(string)
description = "dns nameservers to use"
}