terraform-provider-postgresql
terraform-provider-postgresql copied to clipboard
Suggested resource: postgresql_grant
I'd like to have support for managing GRANT and REVOKE statements on individual roles. This could be similar to the mysql_grant resource.
resource "postgresql_grant" "bob-users" {
role = "bob"
tables = ["users"]
privileges = ["SELECT"]
}
resource "postgresql_grant" "bob-sales" {
role = "bob"
tables = ["sales"]
privileges = ["ALL"]
}
There's quite a few combinations of parameters which drive the GRANT command, so this resource could get pretty complicated.
Edit: To end with a question: Is there interest in adding this resource?
The created resrource postgresql_grant in #51 only supports ALL TABLES or ALL SEQUENCES of a schema. Is there a plan to support specific table grants as per description above?
@adharmawan Yes, I can't really promise when it will be done but it was plan to be done in further iterations.
hi @cyrilgdn . Is there any plans to include this feature on the next release? I really need this feature...
@jmks is implementing granular grants on tables in https://github.com/terraform-providers/terraform-provider-postgresql/pull/156 👍