I'm trying to set up Terraform for use with GCP and I'm having trouble creating a new project from the gcloud cli: Terraform Lab
The command I'm using is
gcloud projects create testproject
The error I get over and over is:
ERROR: (gcloud.projects.create) Project creation failed. The project ID you specified is already in use by another project. Please try an alternative ID.
Here's what I did so far:
- I created an "organization" and a user in Cloud Identity
- Logged into GCP console in the browser with the user I created
- The user has "Organization Administrator" role
- Using the Cloud Shell or gcloud configured on my home computer, I am not able to create a new project. I am able to do things like "gcloud projects list" and "gcloud organizations list" successfully in both cases (cloud shell & local gcloud install)
- I have tried this with different project ID names that are within the format requirements (eg 6-30 chars, lowercase, etc). I can also confirm that the project IDs do not exist.
- However, I am able to successfully create projects via GCP web console (https://console.cloud.google.com) (using the same IAM account configured in gcloud cli)
- I have tried "gcloud init" several times making sure I am using the right IAM account, just in case.
Here's the error I get when I try to create a new project from the "gcloud init" command:
Enter a Project ID. Note that a Project ID CANNOT be changed later.
Project IDs must be 6-30 characters (lowercase ASCII, digits, or
hyphens) in length and start with a lowercase letter. vincetest
WARNING: Project creation failed: HttpError accessing
<https://cloudresourcemanager.googleapis.com/v1/projects?alt=json>:
response: <{'status': '409', 'content-length': '268', 'x-xss
-protection': '1; mode=block', 'x-content-type-options': 'nosniff',
'transfer-encoding': 'chunked', 'vary': 'Origin, X-Origin, Referer',
'server': 'ESF', '-content-encoding': 'gzip',
'cache-control': 'private', 'date': 'Fri, 28 Sep 2018 18:38:11 GMT',
'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;
charset=UTF-8'}>, content <{
"error": {
"code": 409,
"message": "Requested entity already exists",
"status": "ALREADY_EXISTS",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ResourceInfo",
"resourceName": "projects/vincetest"
}
]
}
}
>
Creating the project from the web page console worked fine.