Skip to content

Invalid grant with grant using database wildcards #94

@MikeDevresse

Description

@MikeDevresse

Hi,

I created a bunch of grants like this:

resource "clickhousedbops_grant_privilege" "my_role" {
  for_each = {for privilege in ["CREATE TABLE","CLUSTER","SELECT","ALTER TABLE","DROP TABLE","INSERT","SHOW TABLES","TRUNCATE"]: privilege => privilege}
  privilege_name = each.value
  cluster_name = "staging"
  database_name = each.value != "CLUSTER" ? "my_db_*": null
  grantee_role_name = "my_role"
}

When I exec SELECT * FROM system.grants they show as planned, in the database row I get my_db_* but I still don't get the permission.

Then when I manually exec for instance GRANT ON CLUSTER staging SELECT ON my_db_*.* TO my_role, and then show them with SELECT * FROM system.grants, the wildcard is not there I only got my_db_, but this time it works.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions