Skip to content

Commit 3a6e714

Browse files
committed
feed a zone_id instead of a zone_name
1 parent f2babab commit 3a6e714

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

main.tf

Lines changed: 2 additions & 6 deletions
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

Lines changed: 2 additions & 2 deletions
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)