2016-08-23 22:34:54 +02:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_project"
|
|
|
|
sidebar_current: "docs-google-project"
|
|
|
|
description: |-
|
|
|
|
Allows management of a Google Cloud Platform project.
|
|
|
|
---
|
|
|
|
|
|
|
|
# google\_project
|
|
|
|
|
|
|
|
Allows management of an existing Google Cloud Platform project, and is
|
|
|
|
currently limited to adding or modifying the IAM Policy for the project.
|
|
|
|
|
|
|
|
When adding a policy to a project, the policy will be merged with the
|
|
|
|
project's existing policy. The policy is always specified in a
|
2016-12-07 00:41:20 +01:00
|
|
|
`google_iam_policy` data source and referenced from the project's
|
2016-08-23 22:34:54 +02:00
|
|
|
`policy_data` attribute.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```js
|
2016-11-08 08:27:32 +01:00
|
|
|
resource "google_project" "my_project" {
|
2016-08-23 22:34:54 +02:00
|
|
|
id = "your-project-id"
|
2016-11-08 08:27:32 +01:00
|
|
|
policy_data = "${data.google_iam_policy.admin.policy_data}"
|
2016-08-23 22:34:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
data "google_iam_policy" "admin" {
|
|
|
|
binding {
|
|
|
|
role = "roles/storage.objectViewer"
|
|
|
|
members = [
|
|
|
|
"user:evandbrown@gmail.com",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `id` - (Required) The project ID.
|
|
|
|
Changing this forces a new project to be referenced.
|
|
|
|
|
|
|
|
* `policy` - (Optional) The `google_iam_policy` data source that represents
|
|
|
|
the IAM policy that will be applied to the project. The policy will be
|
|
|
|
merged with any existing policy applied to the project.
|
|
|
|
|
|
|
|
Changing this updates the policy.
|
|
|
|
|
|
|
|
Deleting this removes the policy, but leaves the original project policy
|
|
|
|
intact. If there are overlapping `binding` entries between the original
|
|
|
|
project policy and the data source policy, they will be removed.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
In addition to the arguments listed above, the following computed attributes are
|
|
|
|
exported:
|
|
|
|
|
|
|
|
* `name` - The name of the project.
|
|
|
|
|
|
|
|
* `number` - The numeric identifier of the project.
|