Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: google_dns_managed_zone force_destroy option #1572

Closed
Evesy opened this issue May 31, 2018 · 9 comments · Fixed by GoogleCloudPlatform/magic-modules#3917, #7289 or hashicorp/terraform-provider-google-beta#2494

Comments

@Evesy
Copy link

Evesy commented May 31, 2018

Hi,

Feature
Similar to the AWS provider for Route53 it'd be great if the google_dns_managed_zone provided a force_destroy option, to first delete all record sets from the zone, before proceeding with the zone deletion.

Existing behaviour
Currently if there are records present in the managed zone Terraform is unable to delete the zone:

google_dns_managed_zone.dns-zone: Error deleting DNS ManagedZone: googleapi: Error 400: The resource named 'delivery-platform' cannot be deleted because it is not empty, containerNotEmpty

Use case
In a situation where Terraform is used to provision managed zones within Google Cloud DNS, however the records within that zone are managed by another service, it cannot be guaranteed that all records have been cleaned up from the zone (it may not be a graceful teardown of the environment).

In these scenarios it would be useful to have an optional argument, force_destroy, that will clean out the zone before destroying it.

Terraform Version

Terraform v0.11.7

Affected Resource(s)

  • google_dns_managed_zone

References

As suggested by @kim0 here: #1215

@0verc1ocker
Copy link

This would be a nice feature to have. 👍

@atmatthewat
Copy link

atmatthewat commented May 22, 2019

In the case where all the records are managed by Terraform, it would be nice if the records were automatically deleted when the zone is deleted. This is an issue if you change the zone such that a new resource is required (e.g., change visibility from public to private).

I believe this is the same problem that #1215 was getting at, only it got closed early despite the reporter needing to manually delete the records.

@xer0x
Copy link

xer0x commented Jul 16, 2019

+1 for a force_delete that will modify/move/delete a zone even if it isn't empty.

I appreciate the safety of not clobbing dns zones automatically. However, I would love for Terraform to be able to delete my zone, or move it to another google cloud project.

@toschneck
Copy link

+1 - we want to manage playground environments with our terraform setup. The clean up would be so much easier with this feature

@romankor
Copy link

+1 much needed feature

@emmekappa
Copy link
Contributor

I have a scenario in which all my zones are fully managed by external-dns so it makes perfect sense to allow the destruction of the managed zone even if it contains something.

@paddycarver paddycarver added this to the Goals milestone Dec 13, 2019
@DnR-iData
Copy link

Hi,

Some news for this feature really appreciated ?

Same error today ...

  Enter a value: yes

google_dns_managed_zone.default: Destroying... [id=projects/xxxxxxxxx/managedZones/xxxxxxxxx]

Error: Error reading ManagedZone: googleapi: Error 400: The resource named 'xxxxxxxx' cannot be deleted because it is not empty, containerNotEmpty

My zones are fully managed by external-dns too.

Terraform v0.12.8

Thank you


DR

@megan07 megan07 modified the milestones: Goals, Near-Term Goals Mar 20, 2020
@MeNsaaH
Copy link

MeNsaaH commented Jul 10, 2020

A much needed feature, my records are managed by external-dns too
+1

@ghost
Copy link

ghost commented Oct 17, 2020

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. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.