Skip to content

Commit d2d3e5b

Browse files
committed
Uploading files
0 parents  commit d2d3e5b

File tree

5 files changed

+89
-0
lines changed

5 files changed

+89
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Aplyca
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Terraform AWS Certificate Manager module
2+
========================================
3+
4+
Create and validate a Certificate with AWS Certificate manager. Support multi-domain certificates
5+
6+
Example
7+
-------
8+
9+
```
10+
module "certificate" {
11+
source = "Aplyca/acm/aws"
12+
domain = "example.com"
13+
zone_ids = [
14+
"***********",
15+
"***********"
16+
]
17+
alternative_domains = [
18+
"*.example.com"
19+
]
20+
tags {
21+
Name = "Example"
22+
}
23+
}
24+
```

main.tf

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
resource "aws_acm_certificate" "this" {
2+
provider = "aws"
3+
domain_name = "${var.domain}"
4+
subject_alternative_names = ["${var.alternative_domains}"]
5+
validation_method = "DNS"
6+
tags = "${var.tags}"
7+
}
8+
9+
resource "aws_route53_record" "this" {
10+
count = "${length(var.zone_ids)}"
11+
name = "${lookup(aws_acm_certificate.this.domain_validation_options[count.index], "resource_record_name")}"
12+
type = "${lookup(aws_acm_certificate.this.domain_validation_options[count.index], "resource_record_type")}"
13+
zone_id = "${element(var.zone_ids, count.index)}"
14+
records = ["${lookup(aws_acm_certificate.this.domain_validation_options[count.index], "resource_record_value")}"]
15+
ttl = 60
16+
}
17+
18+
resource "aws_acm_certificate_validation" "this" {
19+
provider = "aws"
20+
count = "${length(var.zone_ids)}"
21+
certificate_arn = "${aws_acm_certificate.this.arn}"
22+
validation_record_fqdns = ["${aws_route53_record.this.*.fqdn}"]
23+
}

outputs.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "certificate_arn" {
2+
value = "${aws_acm_certificate.this.arn}"
3+
}

variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
variable "tags" {
2+
description = "Tags"
3+
default = {}
4+
}
5+
6+
variable "domain" {
7+
description = "Domian name to request ACM certificate"
8+
}
9+
10+
variable "zone_ids" {
11+
description = "Zone Id"
12+
default = []
13+
}
14+
15+
variable "alternative_domains" {
16+
description = "Domians name to request ACM certificates"
17+
default = []
18+
}

0 commit comments

Comments
 (0)