Trouble with terraform plan for cloudflare_pages_project

Account ID: 4209f7e836df3329fbf9160344873f1d Link: dev-consumer-portal.pages.dev Support Case: https://www.support.cloudflare.com/support/s/case/500Nv00000HBFV0IAP/terraform-plan-failing-for-cloudflarepagesproject
Planning failed. Terraform encountered an error while generating this plan.


│ Error: error reading cloudflare pages project "dev-consumer-portal": Could not route to /client/v4/accounts/pages/projects/dev-consumer-portal, perhaps your object identifier is invalid? (7003)

│ with module.pay.cloudflare_pages_project.pages_project,
│ on ../../../modules/pages/main.tf line 2, in resource "cloudflare_pages_project" "pages_project":
│ 2: resource "cloudflare_pages_project" "pages_project" {

Planning failed. Terraform encountered an error while generating this plan.


│ Error: error reading cloudflare pages project "dev-consumer-portal": Could not route to /client/v4/accounts/pages/projects/dev-consumer-portal, perhaps your object identifier is invalid? (7003)

│ with module.pay.cloudflare_pages_project.pages_project,
│ on ../../../modules/pages/main.tf line 2, in resource "cloudflare_pages_project" "pages_project":
│ 2: resource "cloudflare_pages_project" "pages_project" {

9 Replies
Walshy
Walshy7d ago
You don't have account_id set API route should be accounts/{accountId}/pages it's missing the account ID indicating it isn't set
Daniel
DanielOP7d ago
so I've hardcoded the "accountId" in the terraform:
resource "cloudflare_pages_project" "pages_project" {
account_id = "XXXXXXXXXX"
name = var.name
production_branch = var.cloudflare_branch
}
resource "cloudflare_pages_project" "pages_project" {
account_id = "XXXXXXXXXX"
name = var.name
production_branch = var.cloudflare_branch
}
I don't think there is another way to set the account ID Is there a way in which I should be passing the account_id in that I don't know about? The ticket has more information of what has been tried
Cyb3r-Jak3
Cyb3r-Jak37d ago
Can you apply with TF_LOG=debug and share the log file?
Daniel
DanielOP7d ago
Cyb3r-Jak3
Cyb3r-Jak37d ago
Yeah something is causing the account ID to not be past to the request. However, you are using a very old version of the provider 3.35.0 was released on Feb 19, 2023. You should upgrade to the latest release which is 4.48 or something close to that
Daniel
DanielOP6d ago
I went ahead and upgraded to 4.48, using the latest Terraform version. This is still not working. The error looks like this:
Planning failed. Terraform encountered an error while generating this plan.


│ Error: error reading cloudflare pages project "dev-consumer-portal": required missing account ID

│ with module.pay.cloudflare_pages_project.pages_project,
│ on ../../../modules/pages/main.tf line 2, in resource "cloudflare_pages_project" "pages_project":
│ 2: resource "cloudflare_pages_project" "pages_project" {


Planning failed. Terraform encountered an error while generating this plan.


│ Error: error reading cloudflare pages project "dev-consumer-portal": required missing account ID

│ with module.pay.cloudflare_pages_project.pages_project,
│ on ../../../modules/pages/main.tf line 2, in resource "cloudflare_pages_project" "pages_project":
│ 2: resource "cloudflare_pages_project" "pages_project" {


Daniel
DanielOP6d ago
Daniel
DanielOP6d ago
would it be possible to find some time for a quick meeting? ?
Cyb3r-Jak3
Cyb3r-Jak36d ago
I am not a Cloudflare employee just a volunteer. I see you made an issue on GitHub as well. Only thing I can think of is some bug within terraform itself
Want results from more Discord servers?
Add your server