Adding shockrah.xyz public dns records

This commit is contained in:
shockrah 2022-12-27 20:45:32 -08:00
parent 4e46f34440
commit f58fa4ae69

View File

@ -0,0 +1,52 @@
#############################
# shockrah.xyz DNS ZONE
#############################
resource "aws_route53_zone" "shockrah-xyz" {
name = "shockrah.xyz"
comment = "Main shockrah.xyz zone - for personal stuff"
}
locals {
records = [
{
name = "shockrah.xyz"
type = "NS"
ttl = 172800
records = [
"ns-612.awsdns-12.net.",
"ns-285.awsdns-35.com.",
"ns-1702.awsdns-20.co.uk.",
"ns-1360.awsdns-42.org.",
]
},
{
name = "shockrah.xyz"
type = "SOA"
records = [
"ns-612.awsdns-12.net. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400"
]
},
{
name = "shockrah.xyz"
type = "TXT"
ttl = 300
records = [ "v=spf1 include:_mailcust.gandi.net ?all" ]
}
]
}
resource "aws_route53_record" "shockrah-xyz-record" {
for_each = {
for index, record in local.records:
index => record
}
#for_each = toset(local.records)
zone_id = aws_route53_zone.shockrah-xyz.id
name = each.value.name
type = lookup(each.value, "type", "A")
ttl = lookup(each.value, "ttl", 900)
records = each.value.records
}