Skip to content

Commit f6f10a5

Browse files
Laurent Dormoyosterman
authored andcommitted
Add the input variable zone_name (#13)
Add the input variable `zone_name`
1 parent 240a748 commit f6f10a5

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ Available targets:
8282
lint Lint terraform code
8383
8484
```
85-
8685
## Inputs
8786

8887
| Name | Description | Type | Default | Required |
@@ -93,6 +92,7 @@ Available targets:
9392
| tags | Additional tags (e.g. map('BusinessUnit`,`XYZ`) | map | `<map>` | no |
9493
| ttl | The TTL of the record to add to the DNS zone to complete certificate validation | string | `300` | no |
9594
| validation_method | Which method to use for validation, DNS or EMAIL | string | `DNS` | no |
95+
| zone_name | The name of the desired Route53 Hosted Zone | string | `` | no |
9696

9797
## Outputs
9898

@@ -183,7 +183,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
183183

184184
## Copyright
185185

186-
Copyright © 2017-2018 [Cloud Posse, LLC](https://cpco.io/copyright)
186+
Copyright © 2017-2019 [Cloud Posse, LLC](https://cpco.io/copyright)
187187

188188

189189

docs/terraform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
## Inputs
32

43
| Name | Description | Type | Default | Required |
@@ -9,6 +8,7 @@
98
| tags | Additional tags (e.g. map('BusinessUnit`,`XYZ`) | map | `<map>` | no |
109
| ttl | The TTL of the record to add to the DNS zone to complete certificate validation | string | `300` | no |
1110
| validation_method | Which method to use for validation, DNS or EMAIL | string | `DNS` | no |
11+
| zone_name | The name of the desired Route53 Hosted Zone | string | `` | no |
1212

1313
## Outputs
1414

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ resource "aws_acm_certificate" "default" {
1111

1212
data "aws_route53_zone" "default" {
1313
count = "${var.process_domain_validation_options == "true" && var.validation_method == "DNS" ? 1 : 0}"
14-
name = "${var.domain_name}."
14+
name = "${local.zone_name}."
1515
private_zone = false
1616
}
1717

1818
locals {
1919
domain_validation_options = "${aws_acm_certificate.default.domain_validation_options[0]}"
20+
zone_name = "${var.zone_name == "" ? var.domain_name : var.zone_name}"
2021
}
2122

2223
resource "null_resource" "default" {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ variable "subject_alternative_names" {
3232
default = []
3333
description = "A list of domains that should be SANs in the issued certificate"
3434
}
35+
36+
variable "zone_name" {
37+
type = "string"
38+
default = ""
39+
description = "The name of the desired Route53 Hosted Zone"
40+
}

0 commit comments

Comments
 (0)