cf-terraforming
cf-terraforming copied to clipboard
cloudflare_custom_hostname limited to 50 results
Confirmation
- [X] My issue isn't already found on the issue tracker.
- [X] I have replicated my issue using the latest version of the library and it is still present.
cf-terraforming version
cf-terraforming v0.6.3
Expected outcome
I have a zone with over 500 custom hostnames. I'm wanting to generate the resources and import these into Terraform, but cf-terraforming is limiting the results to 50. There should be a way to customize the limit, or, if the limit is a hard per_page limit for the Cloudflare API (although I believe the hard limit is higher than 50), there should be a way to get multiple pages with cf-terraforming.
Actual outcome
The command I'm using:
cf-terraforming generate --account account_id --zone zone_id -v --resource-type cloudflare_custom_hostname >> custom-hostnames.tf
Only 50 results are returned, even though I have over 500 in the Cloudflare zone.
Steps to reproduce
Run cf-terraforming generate --account account_id --zone zone_id -v --resource-type cloudflare_custom_hostname
on any zone with more than 50 custom hostnames.
References
It looks like 50 per_page is hard-coded here: https://github.com/cloudflare/cloudflare-go/blob/master/custom_hostname.go#L221
And it looks like cf-terraforming is limiting itself to 1 page of results here: https://github.com/cloudflare/cf-terraforming/blob/master/internal/app/cf-terraforming/cmd/generate.go#L359
similar to #258. there is some context in there about addressing this in the underlying library.
I have also just hit this issue with my zone that I have been trying to fault find for a while as I also have over 50 custom hostnames.
Two years have passed and the problems with pagination are still not solved... #686
Same issue here, any news?
Some issue, pls change priority of fix.