From f58fa4ae697b64a0fbc5ed9c7950b72ab9e3944e Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 27 Dec 2022 20:45:32 -0800 Subject: [PATCH] Adding shockrah.xyz public dns records --- infra/route53-shockrah-xyz.tf | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 infra/route53-shockrah-xyz.tf diff --git a/infra/route53-shockrah-xyz.tf b/infra/route53-shockrah-xyz.tf new file mode 100644 index 0000000..d407d21 --- /dev/null +++ b/infra/route53-shockrah-xyz.tf @@ -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 +} +