Recreating an old zone adds all existing records. How do I delete CF's zone cache?

I’m in the process of automating our DNS creation using Terraform and in the process of writing the scripts, I’ve had to delete state and start again - deleting my zones from the Cloudflare UI. When I run the Terraform script again, I’m met with a “zone already exists error” for each record it tries to make. On further investigation it appears as if when TF makes the Zone object in Cloudflare, Cloudflare automatically adds all of the existing records. This same behaviour occurs if I re-add the Zone in the UI.

There’s a deprecated API function called JumpStart which I’ve disabled in TF however it’s still creating all records.

How do I delete all zone history from CF to prevent this from happening?

I’ve not heard that Jumpstart is deprecated:

https://api.cloudflare.com/#zone-create-zone

https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/zone

However, if the zone was recently deleted, it’s understandable that the DNS records are revived as well.

How do I delete all zone history from CF to prevent this from happening?

You’d have to wait thirty days, or do this on a different account.

If those aren’t options for you, you’ll have to figure out a way to get Terraform to delete all existing records right after you add the zone.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.