Skip to content

postgresql_grant persistent plan drift even without underlying terraform code changed #197

@bfox1793

Description

@bfox1793

Terraform Version

1.1.3

Affected Resource(s)

postgresql_grant

Terraform Configuration Files

required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "= 3.71.0"
    }
    postgresql = {
      source  = "cyrilgdn/postgresql"
      version = "1.15.0"
    }
  }

Debug Output

N/A

Panic Output

N/A

Expected Behavior

Having a postgresql_grant object with privileges SELECT, UPDATE, INSERT without any changes reflects as much on subsequent terraform plan runs.

Actual Behavior

terraform plan detects constant drift between INSERT grants being either removed, and so it attempts to add it, or it says it was added and needs to remove the INSERT privilege (though I want the insert to be added).

These subsequent applies don't appear to affect the underlying resources, just the terraform state detection. The terraform configs are putting grants on the DB as-expected.

Steps to Reproduce

  1. terraform apply > creates the postgresql_grant with SELECT, UPDATE, INSERT access
  2. terraform plan > expect no drift since underlying TF code wasn't touched, but instead it detects that the grant's INSERT either needs to be added or removed from the grant.

Important Factoids

N/A

References

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions