hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

Add IAM resources for Pub/Sub schema #16334

Closed EricStG closed 11 months ago

EricStG commented 11 months ago

Community Note

Description

Pub/Sub supports IAM at the schema level, but there are no existing resources that allow us to assign them

New or Affected Resource(s)

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.

resource "google_pubsub_topic_iam_policy" "policy" {
  project = google_pubsub_schema.example.project
  schema = google_pubsub_schema.example.name
  policy_data = data.google_iam_policy.admin.policy_data
}

resource "google_pubsub_topic_iam_binding" "binding" {
  project = google_pubsub_schema.example.project
  schema = google_pubsub_schema.example.name
  role = "roles/viewer"
  members = [
    "user:jane@example.com",
  ]
}

resource "google_pubsub_topic_iam_member" "member" {
  project = google_pubsub_schema.example.project
  schema = google_pubsub_schema.example.name
  role = "roles/viewer"
  member = "user:jane@example.com"
}

References

melinath commented 11 months ago

Duplicate of https://github.com/hashicorp/terraform-provider-google/issues/14934

github-actions[bot] commented 10 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.