Creating DNS entries for temper.tv

New ACM certs are still required for the LB to handle requests here properly
This commit is contained in:
shockrah 2023-10-01 03:11:45 -07:00
parent bd31f00149
commit 71cf655767
6 changed files with 76 additions and 0 deletions

15
infra/backend.tf Normal file
View File

@ -0,0 +1,15 @@
terraform {
required_version = ">= 1.5"
backend "s3" {
bucket = "project-temper-infra"
key = "infra/state/build.tfstate"
region = "us-west-1"
encrypt = true
}
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0"
}
}
}

28
infra/dns.tf Normal file
View File

@ -0,0 +1,28 @@
resource "aws_route53_zone" "main" {
name = "temper.tv"
comment = "Main zone for temper.tv"
}
# Points to the Alpha LB in Project Athens
resource "aws_route53_record" "main" {
zone_id = aws_route53_zone.main.id
name = "temper.tv"
type = "A"
alias {
name = data.aws_lb.alpha.dns_name
zone_id = data.aws_lb.alpha.zone_id
evaluate_target_health = true
}
}
resource "aws_route53_record" "txt" {
zone_id = aws_route53_zone.main.id
name = "temper.tv"
type = "TXT"
ttl = 300
records = [
"v=spf1 include:_mailcust.gandi.net ?all"
]
}

0
infra/imports.tf Normal file
View File

6
infra/lb.tf Normal file
View File

@ -0,0 +1,6 @@
# Fetch the Alpha LB from Project Athens
data "aws_lb" "alpha" {
arn = var.alpha.arn
name = var.alpha.name
}

20
infra/local.tf Normal file
View File

@ -0,0 +1,20 @@
locals {
temper-tv-records = [
# These came with the zone for some reason so there's no need to
# insert them ourselves IG /shrug
# {
# name = "temper.tv"
# type = "NS"
# ttl = 172800
# records = [
# "ns-657.awsdns-18.net,
# "ns-1756.awsdns-27.co.uk",
# "ns-1366.awsdns-42.org",
# "ns-288.awsdns-36.com",
# ]
# }
# NOTE SOA record is also taken care of for us :)
# Required for mails to work here
]
}

7
infra/variables.tf Normal file
View File

@ -0,0 +1,7 @@
variable "alpha" {
description = "Project Athens Alpha LB"
type = object({
name = string
arn = string
})
}