Stashbox/dns.tf

65 lines
1.3 KiB
Terraform
Raw Normal View History

2023-01-01 07:50:03 +00:00
terraform {
required_providers {
namecheap = {
source = "namecheap/namecheap"
version = "~> 2.1.0"
}
}
backend "http" {
2023-01-01 08:00:18 +00:00
address = "https://asciireactor.com/api/v4/projects/133/terraform/state/library-index"
lock_address = "https://asciireactor.com/api/v4/projects/133/terraform/state/library-index/lock"
unlock_address = "https://asciireactor.com/api/v4/projects/133/terraform/state/library-index/lock"
2023-01-01 07:50:03 +00:00
lock_method = "POST"
unlock_method = "DELETE"
retry_wait_min = 5
}
}
provider "namecheap" {}
2023-01-21 03:57:55 +00:00
variable "network" {
2023-01-01 07:50:03 +00:00
type = string
2023-01-21 03:57:55 +00:00
default = "2603:3015:1003:566d"
}
variable "ipv4" {
type = string
default = "96.78.236.124"
2023-01-01 07:50:03 +00:00
}
resource "namecheap_domain_records" "othostash" {
domain = "othostash.com"
record {
hostname = "@"
2023-01-21 03:57:55 +00:00
address = "${var.network}::dad:db"
type = "AAAA"
}
record {
hostname = "feed"
address = "${var.network}::dad:feed"
type = "AAAA"
2023-01-01 07:50:03 +00:00
}
record {
hostname = "www"
2023-01-21 03:57:55 +00:00
address = "othostash.com"
type = "CNAME"
}
record {
hostname = "plex"
address = "feed.othostash.com"
2023-01-01 07:50:03 +00:00
type = "CNAME"
}
2023-01-21 03:57:55 +00:00
record {
hostname = "@"
address = var.ipv4
type = "A"
}
record {
hostname = "feed"
address = var.ipv4
type = "A"
}
2023-01-01 07:50:03 +00:00
}