2016-11-23 06:55:40 +00:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_project_services"
|
|
|
|
sidebar_current: "docs-google-project-services"
|
|
|
|
description: |-
|
2017-02-18 22:48:50 +00:00
|
|
|
Allows management of API services for a Google Cloud Platform project.
|
2016-11-23 06:55:40 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2017-05-17 17:41:45 +00:00
|
|
|
For a list of services available, visit the
|
2018-04-12 20:26:34 +00:00
|
|
|
[API library page](https://console.cloud.google.com/apis/library) or run `gcloud services list`.
|
2017-05-17 17:41:45 +00:00
|
|
|
|
2018-07-28 00:01:38 +00:00
|
|
|
~> **Note:** This resource attempts to be the authoritative source on *all* enabled APIs, which often
|
|
|
|
leads to conflicts when certain actions enable other APIs. If you do not need to ensure that
|
|
|
|
*exclusively* a particular set of APIs are enabled, you should most likely use the
|
|
|
|
[google_project_service](google_project_service.html) resource, one resource per API.
|
2017-11-07 23:19:57 +00:00
|
|
|
|
2016-11-23 06:55:40 +00:00
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 10:17:54 +00:00
|
|
|
```hcl
|
2016-11-23 06:55:40 +00:00
|
|
|
resource "google_project_services" "project" {
|
2017-03-22 14:37:11 +00:00
|
|
|
project = "your-project-id"
|
2017-02-18 22:48:50 +00:00
|
|
|
services = ["iam.googleapis.com", "cloudresourcemanager.googleapis.com"]
|
2016-11-23 06:55:40 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2017-03-22 14:37:11 +00:00
|
|
|
* `project` - (Required) The project ID.
|
2017-08-03 18:02:24 +00:00
|
|
|
Changing this forces Terraform to attempt to disable all previously managed
|
|
|
|
API services in the previous project.
|
2016-11-23 06:55:40 +00:00
|
|
|
|
|
|
|
* `services` - (Required) The list of services that are enabled. Supports
|
|
|
|
update.
|
2017-10-23 21:23:51 +00:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
|
|
|
Project services can be imported using the `project_id`, e.g.
|
|
|
|
|
|
|
|
```
|
|
|
|
$ terraform import google_project_services.my_project your-project-id
|
|
|
|
```
|