terraform-provider-google/website/docs/r/google_project_service.html.markdown
The Magician 05d558d33f Add disable_dependent_services to google_project_service resource. (#2938)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-01-28 13:50:41 -08:00

1.7 KiB

layout page_title sidebar_current description
google Google: google_project_service docs-google-project-service-x Allows management of a single API service for a Google Cloud Platform project.

google_project_service

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

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

~> Note: This resource must not be used in conjunction with google_project_services or they will fight over which services should be enabled.

Example Usage

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

  disable_dependent_services = true
}

Argument Reference

The following arguments are supported:

  • service - (Required) The service to enable.

  • project - (Optional) The project ID. If not provided, the provider project is used.

  • disable_dependent_services - (Optional) If true, services that are enabled and which depend on this service should also be disabled when this service is destroyed. If false or unset, an error will be generated if any enabled services depend on this service when destroying it.

  • disable_on_destroy - (Optional) If true, disable the service when the terraform resource is destroyed. Defaults to true. May be useful in the event that a project is long-lived but the infrastructure running in that project changes frequently.

Import

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

$ terraform import google_project_service.my_project your-project-id/iam.googleapis.com