Skip to content

Instantly share code, notes, and snippets.

@carlosescura
Created June 3, 2019 14:06
Show Gist options
  • Save carlosescura/2a24ae0e45502c77d9929a89e405ca1b to your computer and use it in GitHub Desktop.
Save carlosescura/2a24ae0e45502c77d9929a89e405ca1b to your computer and use it in GitHub Desktop.
resource "aws_acm_certificate" "ssl_cert" {
domain_name = "redash.${var.main_domain}"
validation_method = "DNS"
}
resource "aws_route53_record" "cert_validation_dns_record" {
name = "${aws_acm_certificate.ssl_cert.domain_validation_options.0.resource_record_name}"
type = "CNAME"
zone_id = "${var.main_domain_zone_id}"
records = ["${aws_acm_certificate.ssl_cert.domain_validation_options.0.resource_record_value}"]
ttl = 60
}
resource "aws_acm_certificate_validation" "cert_validation" {
certificate_arn = "${aws_acm_certificate.ssl_cert.arn}"
validation_record_fqdns = ["${aws_acm_certificate.ssl_cert.domain_validation_options.0.resource_record_name}"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment