I want to create a GCP project with terraform using vault to get the token. I have the GCP secrets engine already configured and I ask vault within terraform to get the token; but when I run terraform to create the project, I get an error that says:
Error 403: Service accounts cannot create projects without a parent., forbidden. If you received a 403 error, make sure you have the `roles/resourcemanager.projectCreator` permission
│
│ with module.gcp-project.google_project.project,
│ on .terraform/modules/gcp-project/main.tf line 6, in resource "google_project" "project":
│ 6: resource "google_project" "project" {
I suppouse the problem is in roleset bindings of vault's token but I don't know which resource I have to put in roleset.
I tried with the resourcemanager.projectCreator
role; but it always ask me for project name.
Should I give permission to all the organization? Because if I want to create new projects, if I put as resource a project that exists, I won't be able to create another project.
Thanks!!