forked from cloudposse/terraform-aws-acm-request-certificate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
25 lines (22 loc) · 1.01 KB
/
main.tf
File metadata and controls
25 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
resource "aws_acm_certificate" "default" {
domain_name = "${var.domain_name}"
validation_method = "${var.validation_method}"
subject_alternative_names = ["${var.subject_alternative_names}"]
tags = "${var.tags}"
}
data "aws_route53_zone" "default" {
count = "${var.proces_domain_validation_options == "true" && var.validation_method == "DNS" ? 1 : 0}"
name = "${var.domain_name}."
private_zone = false
}
locals {
domain_validation_options = "${aws_acm_certificate.default.domain_validation_options[0]}"
}
resource "aws_route53_record" "default" {
count = "${var.proces_domain_validation_options == "true" && var.validation_method == "DNS" ? 1 : 0}"
zone_id = "${data.aws_route53_zone.default.zone_id}"
name = "${local.domain_validation_options["resource_record_name"]}"
type = "${local.domain_validation_options["resource_record_type"]}"
ttl = "${var.ttl}"
records = ["${local.domain_validation_options["resource_record_value"]}"]
}