google_project

Allows creation and management of a Google Cloud Platform project.

Projects created with this resource must be associated with an Organization. See the Organization documentation for more details.

The user or service account that is running Terraform when creating a google_project resource must have roles/resourcemanager.projectCreator on the specified organization. See the Access Control for Organizations Using IAM doc for more information.

To get more information about projects, see:

Example Usage

resource "google_project" "my_project" {
  name       = "My Project"
  project_id = "your-project-id"
  org_id     = "1234567"
}

To create a project under a specific folder

resource "google_project" "my_project-in-a-folder" {
  name       = "My Project"
  project_id = "your-project-id"
  folder_id  = google_folder.department1.name
}

resource "google_folder" "department1" {
  display_name = "Department 1"
  parent       = "organizations/1234567"
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

Import

Projects can be imported using the project_id, e.g.

In Terraform v1.5.0 and later, use an import block to import Projects using one of the formats above. For example:

import {
  id = "{{project_id}}"
  to = google_project.default
}

When using the terraform import command, Projects can be imported using one of the formats above. For example:

$ terraform import google_project.default {{project_id}}