Created
February 4, 2021 18:08
-
-
Save HunterLarco/85d3c459aef5388b8d9b2709b1b9c52f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_acm_certificate" "this" { | |
domain_name = "painted.nyc" | |
subject_alternative_names = ["www.painted.nyc"] | |
validation_method = "DNS" | |
} | |
resource "aws_route53_record" "certificate_validation" { | |
for_each = { | |
for dvo in aws_acm_certificate.this.domain_validation_options : dvo.domain_name => { | |
name = dvo.resource_record_name | |
record = dvo.resource_record_value | |
type = dvo.resource_record_type | |
} | |
} | |
allow_overwrite = true | |
name = each.value.name | |
records = [each.value.record] | |
ttl = 60 | |
type = each.value.type | |
zone_id = var.zones.painted_nyc.zone_id | |
} | |
resource "aws_acm_certificate_validation" "this" { | |
certificate_arn = aws_acm_certificate.this.arn | |
validation_record_fqdns = [ | |
for record in aws_route53_record.certificate_validation : record.fqdn | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment