-
We noticed a similar issue that's described in this SO post https://stackoverflow.com/questions/22684255/grant-privileges-on-future-tables-in-postgresql Basically, existing privileges granted by Is there a technique to manage these privileges with a single resource? Are we using these correctly or am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello,
If you define the However, in my team we defined both in a Terraform module (that manages a whole database) so we are sure that potential manual modifications will be fixed in next Terraform apply and that all the tables have expected permissions. The provider could technically provide a resource to do both but I feel like it will be too much code complexity for a little reward |
Beta Was this translation helpful? Give feedback.
Hello,
postgresql_grant
needs to exist only if you want to be always sure that existing tables has the right privileges.If you define the
postgresql_default_privileges
at database creation, all the created tables after that will have the required permissions, as soon as nobody can/will manually change them. If some tables exist when definingpostgresql_default_privileges
but you want to avoid havingpostgresql_grant
resource, you could also manually fixed permissions of existing tables.However, in my team we defined both in a Terraform module (that manages a whole database) so we are sure that potential manual modifications will be fixed in next Terraform apply and that all the tables h…