Last active
November 19, 2021 03:27
-
-
Save david7482/8fb0322fe7b6ed6039059cc927369dd1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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" "cert" { | |
provider = aws.us-east-1 | |
domain_name = var.fqdn | |
validation_method = "DNS" | |
} | |
resource "aws_route53_record" "cert_validation" { | |
provider = aws.us-east-1 | |
name = tolist(aws_acm_certificate.cert.domain_validation_options)[0].resource_record_name | |
records = [tolist(aws_acm_certificate.cert.domain_validation_options)[0].resource_record_value] | |
type = tolist(aws_acm_certificate.cert.domain_validation_options)[0].resource_record_type | |
zone_id = data.aws_route53_zone.main.id | |
ttl = 60 | |
} | |
resource "aws_acm_certificate_validation" "cert" { | |
provider = aws.us-east-1 | |
certificate_arn = aws_acm_certificate.cert.arn | |
validation_record_fqdns = [aws_route53_record.cert_validation.fqdn] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment