temper-tv/infra/acm.tf

30 lines
817 B
Terraform
Raw Normal View History

# Here we are creating the cert that alpha LB will use
# Keeping the resource in this project repo because
# alpha does not depend on this resource and thus is our problem
resource "aws_acm_certificate" "website" {
2023-10-03 05:05:25 +00:00
domain_name = "*.temper.tv"
subject_alternative_names = [ "temper.tv" ]
validation_method = "DNS"
lifecycle {
create_before_destroy = true
}
}
2023-10-03 05:05:25 +00:00
resource "aws_route53_record" "website_cert_record" {
for_each = {
for dvo in aws_acm_certificate.website.domain_validation_options : dvo.domain_name => {
name = dvo.resource_record_name
record = dvo.resource_record_value
type = dvo.resource_record_type
}
}
name = each.value.name
type = each.value.type
records = [ each.value.record ]
zone_id = aws_route53_zone.main.id
ttl = 60
}