» google_project_services

Allows management of enabled API services for an existing Google Cloud Platform project. Services in an existing project that are not defined in the config will be removed.

For a list of services available, visit the API library page or run gcloud services list.

» Example Usage

resource "google_project_services" "project" {
  project = "your-project-id"
  services   = ["iam.googleapis.com", "cloudresourcemanager.googleapis.com"]
}

» Argument Reference

The following arguments are supported:

  • project - (Required) The project ID. Changing this forces Terraform to attempt to disable all previously managed API services in the previous project.

  • services - (Required) The list of services that are enabled. Supports update.

  • disable_on_destroy - (Optional) Whether or not to disable APIs on project when destroyed. Defaults to true. Note: When disable_on_destroy is true and the project is changed, Terraform will force disable API services managed by Terraform for the previous project.

» Import

Project services can be imported using the project_id, e.g.

$ terraform import google_project_services.my_project your-project-id