Add project field to iam pubsub topic resources (#1154)

* Add project field to iam pubsub topic resources

* Update documentation
This commit is contained in:
Vincent Roseberry 2018-03-05 15:31:24 -08:00 committed by GitHub
parent 5f0808a13f
commit 35c2cb2abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -15,6 +15,12 @@ var IamPubsubTopicSchema = map[string]*schema.Schema{
ForceNew: true,
DiffSuppressFunc: compareSelfLinkOrResourceName,
},
"project": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
ForceNew: true,
},
}
type PubsubTopicIamUpdater struct {

View File

@ -139,13 +139,14 @@ resource "google_service_account" "test-account-1" {
}
resource "google_pubsub_topic_iam_binding" "foo" {
project = "%s"
topic = "${google_pubsub_topic.topic.name}"
role = "roles/pubsub.publisher"
members = [
"serviceAccount:${google_service_account.test-account-1.email}",
]
}
`, topic, account)
`, topic, account, getTestProjectFromEnv())
}
func testAccPubsubTopicIamBinding_update(topic, account string) string {

View File

@ -64,6 +64,9 @@ The following arguments are supported:
* `topic` - (Required) The topic name or id to bind to attach IAM policy to.
* `project` - (Optional) The project in which the resource belongs. If it
is not provided, the provider project is used.
* `member/members` - (Required) Identities that will be granted the privilege in `role`.
Each entry can have one of the following values:
* **allUsers**: A special identifier that represents anyone who is on the internet; with or without a Google account.