This repository has been archived by the owner on Jul 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
acm.jp.example._.tf
34 lines (30 loc) · 1.64 KB
/
acm.jp.example._.tf
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
26
27
28
29
30
31
32
33
34
# --------------------------------
# ACM Certificate for *.example.jp
resource "aws_acm_certificate" "certificate_jp_example_" {
domain_name = "${aws_route53_record.record_jp_example.fqdn}"
subject_alternative_names = ["*.${aws_route53_record.record_jp_example.fqdn}"]
validation_method = "DNS"
}
# for example.jp
resource "aws_route53_record" "certificate-validation-records_jp_example" {
name = "${aws_acm_certificate.certificate_jp_example_.domain_validation_options.0.resource_record_name}"
type = "${aws_acm_certificate.certificate_jp_example_.domain_validation_options.0.resource_record_type}"
zone_id = "${aws_route53_zone.zone_jp_example.zone_id}"
records = ["${aws_acm_certificate.certificate_jp_example_.domain_validation_options.0.resource_record_value}"]
ttl = 60
}
# for *.example.jp
resource "aws_route53_record" "certificate-validation-records_jp_example_" {
name = "${aws_acm_certificate.certificate_jp_example_.domain_validation_options.1.resource_record_name}"
type = "${aws_acm_certificate.certificate_jp_example_.domain_validation_options.1.resource_record_type}"
zone_id = "${aws_route53_zone.zone_jp_example.zone_id}"
records = ["${aws_acm_certificate.certificate_jp_example_.domain_validation_options.1.resource_record_value}"]
ttl = 60
}
resource "aws_acm_certificate_validation" "certificate-validation_jp_example_" {
certificate_arn = "${aws_acm_certificate.certificate_jp_example_.arn}"
validation_record_fqdns = [
"${aws_route53_record.certificate-validation-records_jp_example.fqdn}",
"${aws_route53_record.certificate-validation-records_jp_example_.fqdn}",
]
}