google_project_service

Allows management of a single API service for a Google Cloud Platform project.

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

This resource requires the Service Usage API to use.

To get more information about google_project_service, see:

Example Usage

resource "google_project_service" "project" {
  project = "your-project-id"
  service = "iam.googleapis.com"

  timeouts {
    create = "30m"
    update = "40m"
  }

  disable_dependent_services = true
}

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

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

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

import {
  id = "{{project_id}}/{{service}}"
  to = google_project_service.default
}

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

$ terraform import google_project_service.default {{project_id}}/{{service}}

Note that unlike other resources that fail if they already exist, terraform apply can be successfully used to verify already enabled services. This means that when importing existing resources into Terraform, you can either import the google_project_service resources or treat them as new infrastructure and run terraform apply to add them to state.

User Project Overrides

This resource supports User Project Overrides.