Importing shockrah.xyz A records into terraform

This commit is contained in:
shockrah 2022-12-27 21:01:46 -08:00
parent f58fa4ae69
commit 52a9a94b32

View File

@ -23,6 +23,7 @@ locals {
{
name = "shockrah.xyz"
type = "SOA"
ttl = 900
records = [
"ns-612.awsdns-12.net. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400"
]
@ -32,7 +33,11 @@ locals {
type = "TXT"
ttl = 300
records = [ "v=spf1 include:_mailcust.gandi.net ?all" ]
}
},
{ name = "shockrah.xyz", records = [ aws_eip.beta_eip.public_ip ] },
{ name = "freechat.shockrah.xyz", records = [ aws_eip.beta_eip.public_ip ] },
{ name = "resume.shockrah.xyz", records = [ aws_eip.beta_eip.public_ip ] },
{ name = "www.shockrah.xyz", records = [ aws_eip.beta_eip.public_ip ] },
]
}
@ -41,12 +46,11 @@ resource "aws_route53_record" "shockrah-xyz-record" {
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)
ttl = lookup(each.value, "ttl", 300)
records = each.value.records
}