Skip to content
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

Terraform reapplying permissions unnecessarily to PostgreSQL #1147

Open
ootneim opened this issue Nov 29, 2024 · 1 comment
Open

Terraform reapplying permissions unnecessarily to PostgreSQL #1147

ootneim opened this issue Nov 29, 2024 · 1 comment
Assignees
Labels
area/platform Issues related to Altinn Platform solutions (Øystein,Simon, Sebastian) area/postgreSQL Issues related to postgreSQL (Øystein,Simon,Bengt)

Comments

@ootneim
Copy link
Member

ootneim commented Nov 29, 2024

Description

Terraform is attempting to reapply permissions that should already be set. This is causing unnecessary replacement of postgresql_grant resources.

Example Output

The following output is from a terraform plan:

-/+ resource "postgresql_grant" "platform_profile_admin_public_sequence_flex" {
      ~ id                = "platform_profile_admin_profiledb_public_sequence" -> (known after apply)
      ~ privileges        = [ # forces replacement
          + "SELECT",
          + "UPDATE",
          + "USAGE",
        ]
        # (5 unchanged attributes hidden)
    }

  # postgresql_grant.platform_profile_admin_public_table_flex must be replaced
-/+ resource "postgresql_grant" "platform_profile_admin_public_table_flex" {
      ~ id                = "platform_profile_admin_profiledb_public_table" -> (known after apply)
      ~ privileges        = [ # forces replacement
          + "DELETE",
          + "INSERT",
          + "REFERENCES",
          + "SELECT",
          + "TRIGGER",
          + "TRUNCATE",
          + "UPDATE",
        ]
        # (5 unchanged attributes hidden)
    }

  # postgresql_grant.platform_profile_public_sequence_flex must be replaced
-/+ resource "postgresql_grant" "platform_profile_public_sequence_flex" {
      ~ id                = "platform_profile_profiledb_public_sequence" -> (known after apply)
      ~ privileges        = [ # forces replacement
          + "SELECT",
          + "UPDATE",
          + "USAGE",
        ]
        # (5 unchanged attributes hidden)
    }

  # postgresql_grant.platform_profile_public_table_flex must be replaced
-/+ resource "postgresql_grant" "platform_profile_public_table_flex" {
      ~ id                = "platform_profile_profiledb_public_table" -> (known after apply)
      ~ privileges        = [ # forces replacement
          + "DELETE",
          + "INSERT",
          + "REFERENCES",
          + "SELECT",
          + "TRIGGER",
          + "TRUNCATE",
          + "UPDATE",
        ]
        # (5 unchanged attributes hidden)
    }
@ootneim ootneim changed the title Terraform is reapplying PostgreSQL permissions Terraform reapplying permissions unnecessarily to PostgreSQL Nov 29, 2024
@ootneim ootneim added area/platform Issues related to Altinn Platform solutions (Øystein,Simon, Sebastian) area/postgreSQL Issues related to postgreSQL (Øystein,Simon,Bengt) labels Nov 29, 2024
@ootneim ootneim self-assigned this Nov 29, 2024
@ootneim
Copy link
Member Author

ootneim commented Jan 2, 2025

Updated postgresql provider with this fix:
cyrilgdn/terraform-provider-postgresql#321

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform Issues related to Altinn Platform solutions (Øystein,Simon, Sebastian) area/postgreSQL Issues related to postgreSQL (Øystein,Simon,Bengt)
Projects
None yet
Development

No branches or pull requests

1 participant