https://pulumi.com logo
#google-cloud
Title
# google-cloud
c

cool-jordan-85318

08/21/2020, 2:55 PM
I want to create a Folder and within the newly created Folder add new Project. Therefore I do
Copy code
const prodFolder = new Folder(name,
        {
          displayName: name,
          parent: "organizations/<org_id>",
        }
)}

const googleCloudProject = new gcp.organizations.Project(name,
        {
          name: "some-name",
          projectId: "some-id",
          folderId: folder.id,
        });
I receive this error
Copy code
error: error creating project unicorn (Funke Infrastructure): googleapi: Error 409: Requested entity already exists, alreadyExists. If you received a 403 error, make sure you have the `roles/resourcemanager.projectCreator` permission
If I leave out the
folderId
in the Project creation above, the stuff works. What do I miss? I use an account having the requested permission, just in case, even if it does not look like this kind of error.
g

green-school-95910

08/21/2020, 3:06 PM
If you leave out the
folderId
the project will be created as a personal project, which you can always do (almost). Do you have the Project Creator role across the whole organization?
c

cool-jordan-85318

08/21/2020, 3:09 PM
Yes. The project is created underneath the organization without the folderId. But I want it to be underneath the folder. From docs side it looks like setting the arg and be fine with it 🤷‍♂️
g

green-school-95910

08/21/2020, 3:11 PM
c

cool-jordan-85318

08/21/2020, 3:24 PM
makes no difference - error still the same
g

green-school-95910

08/21/2020, 3:27 PM
Here we just give the
folder_id
as in the api on the config file. The
id
output might not be it exactly, since the provider can change to add some prefix, and the
name
output is
folder/{folder_id}
, which is what is used to create a nested folder, but not a project.
There is the "simple" way, which is to get the folder_id from
name
, but that seems like a hack
c

cool-jordan-85318

08/21/2020, 4:21 PM
Nested Folder works. The folder -> project nesting results in „already exists“. But there is no such project. That’s why I assume no permission failure
e

enough-baker-16813

09/01/2020, 1:57 PM
You might be reusing a project id. Have you created a "some-id" project in the past and deleted it? In that case, you will need a new id.
c

cool-jordan-85318

09/02/2020, 4:54 AM
My issue was changing from an organization level project to a project underneath a folder. This did not work due to an error „cannot set both org_id and folder_id“. By creating a new folder and a new project from scratch I was able to build the structure.
2 Views