Closed hoexter closed 4 years ago
Thanks for the report @hoexter! I think a better validation of the schema should resolve this. I am also not sure why this crashed and didn't throw up the error message included 🤔
Ah, because you're using a dynamic, the error message isn't getting propagated up. Using a regular block here shows the exception as expected.
--- FAIL: TestAccCloudflareZoneLockdownIPRangeWithInvalidCIDR (0.94s)
testing.go:640: Step 0 error: errors during apply:
Error: error creating zone lockdown for zone ID "REDACTED": error from makeRequest: HTTP status 400: content "{\n \"result\": null,\n \"success\": false,\n \"errors\": [\n {\n \"message\": \"zonelockdown.api.validation=invalid CIDR address: 198.51.100.4\"\n }\n ],\n \"messages\": []\n}\n"
on /var/folders/d4/5sgps61s2jg8f0_71663vw800000gn/T/tf-test394260898/main.tf line 2:
(source code not available)
Terraform Version
Terraform v0.12.20
Affected Resource(s)
cloudflare_zone_lockdown
Terraform Configuration Files
The error is the missing subnet mask on the second IP in the whitelist entry "Office".
Panic Output
Expected Behavior
terraform does not crash, suitable error message pointing at the error a plus
Actual Behavior
What actually happened?
Steps to Reproduce
Try to deploy a whitelist entry for cloudflare_zone_lockdown without a defined subnet mask. Crashes during
terraform apply
.References
Looks similar to https://github.com/terraform-providers/terraform-provider-cloudflare/issues/588