You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is my understanding that setting force_destroy = true should tell Terraform to delete all records in the zone when it destroys the resource even if it contains records that are not managed by Terraform.
Actual Behavior
Destroying fails with this error:
* aws_route53_zone.public: HostedZoneNotEmpty: The specified hosted zone contains non-required resource record sets and so cannot be deleted.
status code: 400, request id: e466d633-0014-11e7-a009-8d1bd2e9a272
Steps to Reproduce
Run terraform apply. This should complete successfully.
Create a record in the zone that is outside of Terraform control. For example:
$ terraform destroy -force
aws_route53_zone.public: Refreshing state... (ID: Z273D4PE6ATWJH)
aws_route53_zone.public: Destroying...
Error applying plan:
1 error(s) occurred:
* aws_route53_zone.public: HostedZoneNotEmpty: The specified hosted zone contains non-required resource record sets and so cannot be deleted.
status code: 400, request id: e466d633-0014-11e7-a009-8d1bd2e9a272
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
The text was updated successfully, but these errors were encountered:
ryane
added a commit
to ryane/terraform
that referenced
this issue
Mar 3, 2017
The conditional to ignore the deletion of NS and SOA records can fail to
match if the hostedZoneName already ends with a ".". When that happens,
terraform tries to delete those records which is not supported by AWS
and results in a 400 bad request. This fixes the conditional so that it
will work whether or not hostedZoneName ends with a ".".
fixeshashicorp#12407
The conditional to ignore the deletion of NS and SOA records can fail to
match if the hostedZoneName already ends with a ".". When that happens,
terraform tries to delete those records which is not supported by AWS
and results in a 400 bad request. This fixes the conditional so that it
will work whether or not hostedZoneName ends with a ".".
fixes#12407
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 13, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/ryane/ba584cdb3023b4f02dfe9cb4dfb2225a
Expected Behavior
It is my understanding that setting
force_destroy = true
should tell Terraform to delete all records in the zone when it destroys the resource even if it contains records that are not managed by Terraform.Actual Behavior
Destroying fails with this error:
Steps to Reproduce
terraform apply
. This should complete successfully.create.json:
terraform destroy
The text was updated successfully, but these errors were encountered: