Skip to content

Commit 1fb638a

Browse files
authored
Merge pull request #137 from trussworks/allow-overwrite-specification
feed a zone_id instead of a zone_name
2 parents f2babab + bd6fedf commit 1fb638a

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ No modules.
4646
| [aws_lb_listener_certificate.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_certificate) | resource |
4747
| [aws_route53_record.caa](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
4848
| [aws_route53_record.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record) | resource |
49-
| [aws_route53_zone.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route53_zone) | data source |
5049

5150
## Inputs
5251

@@ -57,7 +56,7 @@ No modules.
5756
| domain\_name | Domain name to associate with the ACM certificate. | `string` | n/a | yes |
5857
| environment | Environment tag. e.g. prod | `string` | n/a | yes |
5958
| tags | Tags to be attached to the ACM certificate. | `map(string)` | `{}` | no |
60-
| zone\_name | The Route53 zone name for which the certificate should be verified and issued. | `string` | n/a | yes |
59+
| zone\_id | The Route53 zone id for which the certificate should be verified and issued. | `string` | n/a | yes |
6160

6261
## Outputs
6362

main.tf

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
data "aws_route53_zone" "main" {
2-
name = var.zone_name
3-
}
4-
51
resource "aws_acm_certificate" "main" {
62
domain_name = var.domain_name
73
validation_method = "DNS"
@@ -21,7 +17,7 @@ resource "aws_route53_record" "main" {
2117
type = dvo.resource_record_type
2218
}
2319
}
24-
zone_id = data.aws_route53_zone.main.id
20+
zone_id = var.zone_id
2521
ttl = "60"
2622
name = each.value.name
2723
type = each.value.type
@@ -45,7 +41,7 @@ resource "aws_lb_listener_certificate" "main" {
4541
# https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-caa.html
4642
resource "aws_route53_record" "caa" {
4743
count = length(var.caa_records) > 0 ? 1 : 0
48-
zone_id = data.aws_route53_zone.main.id
44+
zone_id = var.zone_id
4945
name = var.domain_name
5046
type = "CAA"
5147
records = var.caa_records

variables.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ variable "environment" {
1414
description = "Environment tag. e.g. prod"
1515
}
1616

17-
variable "zone_name" {
17+
variable "zone_id" {
1818
type = string
19-
description = "The Route53 zone name for which the certificate should be verified and issued."
19+
description = "The Route53 zone id for which the certificate should be verified and issued."
2020
}
2121

2222
variable "caa_records" {

0 commit comments

Comments
 (0)