Skip to content

Commit 982ff3b

Browse files
Eduardo Lopezczimergebot
Eduardo Lopez
authored andcommitted
ACM certificate route53 overwrite (#99)
[fix] ACM certificate route53 validation overwrite### Summary The new tf provider refuses to overwrite existing route53 records breaking previous functionality. This is a problem for acm since we need the same record for each region. Therefore, we allow route53 records to be overwritten by default. ### Test Plan unittests ### References hashicorp/terraform-provider-aws#7918
1 parent bdf80b2 commit 982ff3b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

aws-acm-cert/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module "cert" {
3333

3434
| Name | Description | Type | Default | Required |
3535
|------|-------------|:----:|:-----:|:-----:|
36+
| allow\_validation\_record\_overwrite | Allow the overwrite of validation records. This is needed if you are creating certificates in multiple regions. | string | `"true"` | no |
3637
| aws\_route53\_zone\_id | | string | n/a | yes |
3738
| cert\_domain\_name | Like www.foo.bar.com or *.foo.bar.com | string | n/a | yes |
3839
| cert\_subject\_alternative\_names | A map of <alternative_domain:route53_zone_id> | map | `<map>` | no |

aws-acm-cert/main.tf

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ resource "aws_route53_record" "cert_validation" {
3030
zone_id = "${lookup(var.cert_subject_alternative_names, lookup(aws_acm_certificate.cert.domain_validation_options[count.index], "domain_name"), var.aws_route53_zone_id)}"
3131
records = ["${lookup(aws_acm_certificate.cert.domain_validation_options[count.index], "resource_record_value")}"]
3232
ttl = "${var.validation_record_ttl}"
33+
34+
allow_overwrite = "${var.allow_validation_record_overwrite}"
3335
}
3436

3537
resource "aws_acm_certificate_validation" "cert" {

aws-acm-cert/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,9 @@ variable "owner" {
3737
type = "string"
3838
description = "Owner for tagging and naming. See [doc](../README.md#consistent-tagging)."
3939
}
40+
41+
variable "allow_validation_record_overwrite" {
42+
type = "string"
43+
description = "Allow the overwrite of validation records. This is needed if you are creating certificates in multiple regions."
44+
default = true
45+
}

0 commit comments

Comments
 (0)