diff --git a/infra/acm.tf b/infra/acm.tf index 0d5cd26..f0e1242 100644 --- a/infra/acm.tf +++ b/infra/acm.tf @@ -3,7 +3,7 @@ # alpha does not depend on this resource and thus is our problem resource "aws_acm_certificate" "website" { - domain_name = "temper.tv" + domain_name = "*.temper.tv" subject_alternative_names = [ "temper.tv" ] validation_method = "DNS" @@ -12,3 +12,18 @@ resource "aws_acm_certificate" "website" { } } +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 +} + diff --git a/infra/backend.tf b/infra/backend.tf index 99bffbc..8940e10 100644 --- a/infra/backend.tf +++ b/infra/backend.tf @@ -9,7 +9,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.0" + version = "4.13.0" } } -} \ No newline at end of file +}