2023-01-01 03:56:36 +00:00
|
|
|
terraform {
|
|
|
|
required_providers {
|
|
|
|
namecheap = {
|
|
|
|
source = "namecheap/namecheap"
|
|
|
|
version = "~> 2.1.0"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
backend "http" {
|
|
|
|
address = "https://asciireactor.com/api/v4/projects/101/terraform/state/industry-domain"
|
|
|
|
lock_address = "https://asciireactor.com/api/v4/projects/101/terraform/state/industry-domain/lock"
|
|
|
|
unlock_address = "https://asciireactor.com/api/v4/projects/101/terraform/state/industry-domain/lock"
|
|
|
|
lock_method = "POST"
|
|
|
|
unlock_method = "DELETE"
|
|
|
|
retry_wait_min = 5
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
provider "namecheap" {}
|
|
|
|
|
2023-01-01 05:26:38 +00:00
|
|
|
variable "apex-domain" {
|
|
|
|
type = string
|
|
|
|
default = "othoulrich.com."
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "host-rproxy" {
|
|
|
|
type = string
|
|
|
|
default = "rprxy-0.saline.o4data.net."
|
|
|
|
}
|
|
|
|
|
2023-01-01 03:56:36 +00:00
|
|
|
variable "protonmail-domainkey-id" {
|
|
|
|
type = string
|
|
|
|
default = "dr2jx5mioyzdmwndxrlrsgzx3nne5vtshiheypfxy7llz4e2hwrcq"
|
|
|
|
}
|
|
|
|
|
2023-01-01 05:26:38 +00:00
|
|
|
variable "protonmail-verification-key" {
|
|
|
|
type = string
|
|
|
|
default = "6568aab64dccc1e888741cf9874730f7fc884a00"
|
2023-01-01 03:56:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "namecheap_domain_records" "top" {
|
2023-01-01 05:26:38 +00:00
|
|
|
domain = trim(var.apex-domain,".")
|
2023-01-01 03:56:36 +00:00
|
|
|
mode = "OVERWRITE"
|
|
|
|
email_type = "MX"
|
|
|
|
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "@"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = var.host-rproxy
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "ALIAS"
|
|
|
|
ttl = 300
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "www"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = var.apex-domain
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "CNAME"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "code"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = var.apex-domain
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "CNAME"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "@"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = "mail.protonmail.ch."
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "MX"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "@"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = "mailsec.protonmail.ch."
|
2023-01-01 03:56:36 +00:00
|
|
|
mx_pref = 20
|
|
|
|
type = "MX"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "@"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = join("=",[
|
|
|
|
"protonmail-verification",
|
|
|
|
var.protonmail-verification-key
|
|
|
|
])
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "TXT"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "@"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = "v=spf1 include:_spf.protonmail.ch mx ~all"
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "TXT"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "protonmail._domainkey"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = join(".",[
|
|
|
|
"protonmail.domainkey",
|
|
|
|
var.protonmail-domainkey-id,
|
|
|
|
"domains.proton.ch."
|
|
|
|
])
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "CNAME"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "protonmail2._domainkey"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = join(".",[
|
|
|
|
"protonmail2.domainkey",
|
|
|
|
var.protonmail-domainkey-id,
|
|
|
|
"domains.proton.ch."
|
|
|
|
])
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "CNAME"
|
|
|
|
}
|
|
|
|
|
|
|
|
record {
|
|
|
|
hostname = "protonmail3._domainkey"
|
2023-01-01 05:26:38 +00:00
|
|
|
address = join(".",[
|
|
|
|
"protonmail3.domainkey",
|
|
|
|
var.protonmail-domainkey-id,
|
|
|
|
"domains.proton.ch."
|
|
|
|
])
|
2023-01-01 03:56:36 +00:00
|
|
|
type = "CNAME"
|
|
|
|
}
|
|
|
|
}
|