-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Pages Project and Domains #476
base: master
Are you sure you want to change the base?
Conversation
@@ -688,6 +688,57 @@ func generateResources() func(cmd *cobra.Command, args []string) { | |||
} | |||
} | |||
} | |||
|
|||
case "cloudflare_pages_domain": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i a bit confused here. why do we fetch all the pages projects and then iterate all of them to get pages domains?
ideally, these methods should fetch all the results from a single endpoint and use that to dump the output. we shouldn't need to make additional calls or build other structs in order to generate a single resource output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed because there is no endpoint to list all Pages Domains. The endpoint to list pages domains (https://api.cloudflare.com/#pages-domains-get-domains) requires a parameter of the project name, so I need to list all projects to then go through and get all domains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I just started using this tool and this is a missing feature I'd like to have. Is it possible to set the domain as a variable, instead of looking for every domain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of generating is to get all the possible resources for output.
As an FYI, I haven't worked on in this in a while as I've run into issues with the pages project part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking it could be alike to the DNS resources: I have to call it for each zone separately.
So if it worked like the DNS resources, I would just call it per domain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API doesn't work that way. DNS records are zone level which are seperated. Pages are account level resources, so they include all domains for all zones in the account.
Adds support for generating and importing
cloudflare_pages_project
resource. Adds support for generatingcloudflare_pages_domain
(importing would be a nightmare to implement).