-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant configuration drift on postgresql_grant
for ALL TABLES
#303
Comments
Does it still happen if you order the privileges in your configuration alphabetically? |
@mootari, yes, it does not seem to matter. Currently, I'm having the same issue with |
I'm having the same with grant on schema with |
Same here. I have constantly problems with this. I need to normally apply the same config 2 or 3 times. |
This hits really hard, it made us lost grants altogether. We had for some reasons |
I'm experiencing the same issue. Tried to debug a bit more. I will share the details, maybe it helps someone from the team to find the cause. To start I have the following grant: resource "postgresql_grant" "table" {
database = postgresql_database.this.name
role = postgresql_role.this.name
schema = "public"
object_type = "table"
privileges = ["SELECT"]
} Running the apply, the state has the privileges on the grant of the table. Running a plan right after the apply we get the different in the config, as it wants to add those privileges again. Running a I got the
I still don't know why it is happening, but there seems to be something going on in the refresh, like it cannot get the values of the privileges, and then the plan wants to add them again, even tho originally after the first apply they were added. Hope it helps. |
The grant I have the most issues with is configured just like @raul-verdi described above. Only a single |
I see such behaviour, when I add new table to DB. As I understand new table not inherit any permissions, and terraform sees the drift. |
I can confirm that this behavior happens after a new table / sequence creation. I've reproduced this by manual table creation -> I've tried also to play a little bit with |
I am having the same issue with grants after new tables are created. Any updates or workaround? |
@jaorr95 I'm pretty sure I've used Terraform's |
@karelorigin this issue is known and being fixed with the following PR: #339 |
Terraform Version
Affected Resource(s)
Terraform Configuration Files
And
role
is in the form[email protected]
for google service accountsExpected Behavior
Grants are already applied, it shouldn't try to recreate them.
Actual Behavior
Almost all the time, but not quite always, it wants to replace the grants:
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
Important Factoids
Cloud SQL on Google with IAM auth.
When I try to inspect the state I get an error, even with the latest version of Terraform:
References
The text was updated successfully, but these errors were encountered: