aws_route53_record not updated when it depends on a aws_acm_certificate as shown in the aws_acm_certificate_validation docs #8599
Labels
bug
Addresses a defect in current functionality.
service/route53
Issues and PRs that pertain to the route53 service.
Milestone
Community Note
Terraform Version
Terraform v0.11.13
provider.aws v2.10.0
Affected Resource(s)
Terraform Configuration Files
See https://github.com/rahulk94/terraform-route53-potential-bug for a working repo that can be used to reproduce the issue.
or
Summary
When using AWS Route53 + an ACM Certificate as per the ACM Certificate Validation docs (https://www.terraform.io/docs/providers/aws/r/acm_certificate_validation.html), the Route53 record is not updated to a new value if changes are made which result in a new url being required after initial deployment. A new ACM Certificate will be generated as expected however a new Route53 record will not. This results in a couple things when deploying changes:
Steps to reproduce issue
** Alternatively running $ terraform apply -var-file=terraform.tfvars can be used to achieve the same thing and follow through with deployment.
Expected Behavior
All 3 resources should be made/modified. A new Route53 record should be created as there is now a new url it needs to be made for.
Actual Behavior
Only a new ACM Certificate and validation record will be made/modified (2 resources).
Speculation
It appears that the Route53 record is looking at the existing certificate ACM Certificate it corresponds to for what values it should have, rather than the ACM Certificate that is about to be generated. This is fine for an initial deployment as there's no ACM Certificate so the Route53 record is created with values corresponding to the certificate that is going to be created. But when modifying an existing environment this doesn't work.
Manual workaround
One workaround for this issue is to re-run
Terraform apply tfplan
after itfails. Sometimes two re-runs are needed... This isn't very elegant but you will see the Route53 entry will now be changed to the expected value on subsequent run.
The text was updated successfully, but these errors were encountered: