How to grant a role on a specific CloudSQL instance?
locals{
instance_admins = {
"db-group": "group:gcp-ccoe-sre@mycloud.io",
"dev-team": "user:dp@mycloud.io"
}
}
resource "google_project_iam_member" "instance_admin" {
for_each = var.instance_admins
project = "my-first-project"
role = "roles/cloudsql.admin"
member = each.value
condition{
title = "cloudsql admin role for db team"
description = "cloudsql admin role for db team"
expression = "resource.name == \"${google_sql_database_instance.instance.self_link}\""
}
}
Comments
Post a Comment