Terraform failed to create ruleset as a similar configuration already exists

I have deployed a Cloudflare ruleset(it has a confusing name “Cloudflare managed ruleset”) using Terraform. When I tried to use Terraform to deploy another ruleset(named “OWASP ruleset”), Terraform complains that

Error: failed to create ruleset xxx" as a similar configuration already exists. If you are migrating from the Dashboard, you will need to first manually remove it using the API (https://api.cloudflare.com/#zone-rulesets-delete-zone-ruleset) before you can configure it in Terraform. Otherwise, you have hit the entitlements quota and should contact your account team.

Does this mean Terraform only allows to create one “cloudflare_ruleset” resource? It is also very confusing to the mapping between “cloudflare_ruleset” resource to Cloudflare dashboard and its API.

1 Like