cf-terraforming icon indicating copy to clipboard operation
cf-terraforming copied to clipboard

cloudflare_custom_hostname limited to 50 results

Open jmosborn opened this issue 2 years ago • 5 comments

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

jmosborn avatar Mar 02 '22 19:03 jmosborn

similar to #258. there is some context in there about addressing this in the underlying library.

jacobbednarz avatar Mar 02 '22 22:03 jacobbednarz

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.

kism3t1 avatar Dec 07 '22 13:12 kism3t1

Two years have passed and the problems with pagination are still not solved... #686

vitich avatar Mar 19 '24 21:03 vitich

Same issue here, any news?

techieforfun avatar Apr 03 '24 13:04 techieforfun

Some issue, pls change priority of fix.

leonidstakhovsky avatar Apr 25 '24 15:04 leonidstakhovsky