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.36k stars 1.75k forks source link

Add support for Dataproc Metastore Service gRPC scoped roles #13620

Open gmspinheiro opened 1 year ago

gmspinheiro commented 1 year ago

Community Note

Description

The goal should be to add similar resources to google_dataproc_metastore_service_iam, but applied to: backups, databases and tables. I had a look into the google-beta provider and I couldn't find anything similar.

New or Affected Resource(s)

Potential Terraform Configuration

# Example of a database "admin" type grant using _member
resource "google_dataproc_metastore_database_iam_member" "member" {
  project = google_dataproc_metastore_service.default.project
  location = google_dataproc_metastore_service.default.location
  service_id = google_dataproc_metastore_service.default.service_id
  database = "example"
  role = "roles/metastore.metadataOwner"
  member = "user:jane@example.com"
}

References

Looking into the documentation, the beta roles should be considered - https://cloud.google.com/dataproc-metastore/docs/iam-roles.

The gcloud beta cli version supports adding policies at these different scopes:

b/299600951

melinath commented 1 year ago

Note: backups seems to be a real resource in that it has create and delete methods (but it is not supported by Terraform right now.)

databases and databases.tables are not real resources. For those two, we could still add support for IAM as described on https://googlecloudplatform.github.io/magic-modules/develop/resource/#add-iam-support in the "Handwritten" tab.