Terraform v0.11.3
resource "aws_route53_zone" "s" {
name = "s.k8s-${var.region}.${data.terraform_remote_state.route53.domain}"
# external-dns deployment places things here beyond terraform's control
# if we are destroying the cluster, then these records should go to
# external-dns will re-populate anyway
force_destroy = true
tags = {
Environment = "${var.env}"
Terraform = true
}
}
I have debug output, but I'm hesitant to post it on the internet because of the contents.
However, it looks like it's writing state for the object in question with force_destroy = false.
Terraform should delete all records in the Route53 zone, then delete the zone itself.
* aws_route53_zone.s: HostedZoneNotEmpty: The specified hosted zone contains non-required resource record sets and so cannot be deleted.
status code: 400, request id: 128b665e-1271-11e8-9d2f-f99c6c224f10
Please list the steps required to reproduce the issue, for example:
terraform destroyThis Route53 zone has RRs created by another tool (kubernetes' external-dns).
force_destroy on this resource was originally false when it was created. I only changed it to true prior to destroy, so I'm not sure if this is expected or not.
I thought this would have been fixed via https://github.com/hashicorp/terraform/issues/12407
Does it work if you terraform apply the force_destroy = true change and then run terraform destroy?
Yes! I wonder if this behavior is documented anywhere? My expectation was that setting force_destroy would take effect without an apply, since it only concerns destroy operations. I guess what's really happening is destroy is only looking at state, not what's configured, correct?
Thank you for using Terraform and for opening up this question, @acobaugh! Issues on GitHub are intended to be related to bugs or feature requests with the provider codebase.
It looks like you have some solid feedback, so this issue will be closed. Please use our new community forum https://discuss.hashicorp.com/c/terraform-providers for additional feedback, community discussions, and questions around Terraform.
If you believe that your issue was miscategorized as a question or closed in error, please create a new issue using one of the following provided templates: bug report or feature request. Please make sure to provide us with the appropriate information so we can best determine how to assist with the given issue.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
Does it work if you
terraform applytheforce_destroy = truechange and then runterraform destroy?