File tree 3 files changed +5
-10
lines changed
3 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ No modules.
46
46
| [ aws_lb_listener_certificate.main] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener_certificate ) | resource |
47
47
| [ aws_route53_record.caa] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record ) | resource |
48
48
| [ 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 |
50
49
51
50
## Inputs
52
51
@@ -57,7 +56,7 @@ No modules.
57
56
| domain\_ name | Domain name to associate with the ACM certificate. | ` string ` | n/a | yes |
58
57
| environment | Environment tag. e.g. prod | ` string ` | n/a | yes |
59
58
| 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 |
61
60
62
61
## Outputs
63
62
Original file line number Diff line number Diff line change 1
- data "aws_route53_zone" "main" {
2
- name = var. zone_name
3
- }
4
-
5
1
resource "aws_acm_certificate" "main" {
6
2
domain_name = var. domain_name
7
3
validation_method = " DNS"
@@ -21,7 +17,7 @@ resource "aws_route53_record" "main" {
21
17
type = dvo.resource_record_type
22
18
}
23
19
}
24
- zone_id = data . aws_route53_zone . main . id
20
+ zone_id = var . zone_id
25
21
ttl = " 60"
26
22
name = each. value . name
27
23
type = each. value . type
@@ -45,7 +41,7 @@ resource "aws_lb_listener_certificate" "main" {
45
41
# https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting-caa.html
46
42
resource "aws_route53_record" "caa" {
47
43
count = length (var. caa_records ) > 0 ? 1 : 0
48
- zone_id = data . aws_route53_zone . main . id
44
+ zone_id = var . zone_id
49
45
name = var. domain_name
50
46
type = " CAA"
51
47
records = var. caa_records
Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ variable "environment" {
14
14
description = " Environment tag. e.g. prod"
15
15
}
16
16
17
- variable "zone_name " {
17
+ variable "zone_id " {
18
18
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."
20
20
}
21
21
22
22
variable "caa_records" {
You can’t perform that action at this time.
0 commit comments