Stashapp/dns.tf

83 lines
1.4 KiB
Terraform
Raw Permalink Normal View History

2022-12-31 05:24:28 +00:00
terraform {
required_providers {
namecheap = {
source = "namecheap/namecheap"
version = "~> 2.1.0"
}
}
2024-02-24 22:02:31 +00:00
backend "http" {}
2022-12-31 05:24:28 +00:00
}
provider "namecheap" {}
2024-02-24 22:02:31 +00:00
variable "stashbox_ip4_ext" {
2022-12-31 07:48:10 +00:00
type = string
2024-02-24 22:02:31 +00:00
default = "0.0.0.0"
2022-12-31 07:48:10 +00:00
}
2024-02-24 22:02:31 +00:00
variable "stashbox_domain" {
type = string
default = "web.stash"
}
variable "stashapp_addr" {
type = string
default = "::2"
}
variable "stashapp_domain" {
type = string
default = "app.stash"
}
variable "stashapp_notes_domain" {
type = string
default = "notes.stash"
}
resource "namecheap_domain_records" "stash" {
domain = var.stashbox_domain
record {
2024-02-24 22:02:31 +00:00
hostname = "app"
address = var.stashapp_addr
type = "AAAA"
ttl = 1799
}
record {
2024-02-24 22:02:31 +00:00
hostname = "app"
address = var.stashbox_ip4_ext
type = "A"
ttl = 1799
}
record {
2024-02-24 22:02:31 +00:00
hostname = "clippings"
address = var.stashapp_domain
type = "CNAME"
}
record {
2023-01-18 05:24:35 +00:00
hostname = "browse"
2024-02-24 22:02:31 +00:00
address = var.stashapp_domain
type = "CNAME"
}
2022-12-31 05:24:28 +00:00
}
2024-02-24 22:02:31 +00:00
2024-02-25 18:30:43 +00:00
resource "namecheap_domain_records" "notes" {
domain = var.stashapp_notes_domain
record {
hostname = "www"
address = var.stashapp_addr
type = "AAAA"
}
record {
hostname = "www"
address = var.stashbox_ip4_ext
type = "A"
}
record {
hostname = "@"
type = "CNAME"
address = "www.${var.stashapp_notes_domain}"
}
}