GCP read org folders error

I am learning/playing with TF and so far so good. I would like to read my GCP Organizations folders that exist which is failing. The TF code can be found in my repository here:

I use Terraform Cloud to plan/run terraform and get the following error:

Error: Error when reading or editing Folder Not Found : folders/development: googleapi: Error 400: Request contains an invalid argument., badRequest
with data.google_folder.development
on main.tf line 22, in data "google_folder" "development":
data "google_folder" "development" {

So far I confirmed the following or double checked:

  • The folders do exist in my GCP org
  • The service account that is used for terraform cloud has Owner, Organization Admin, Compute Admin at both the project level it sits in +
  • At the Org level IAM I added the service account principles also (now) with Folder Admin and Org Admin and Owner and project Creator permissions (not sure if the service account principles needs to be invited).
  • In GCP the “Resource Manager API” is also enabled… and I can see multiple requests to it and all failed

Help :kissing_heart:

Well ok, this was obviously. You have to use the folder IDs not folder names (kinda obvious when a GCP admin pointed it out at work). However, as all the variable names and comments say ‘folder name’ in the example code I use/haved of course the folder name is the input I gave.