cyrilgdn / terraform-provider-postgresql

Terraform PostgreSQL provider
https://www.terraform.io/docs/providers/postgresql/
Mozilla Public License 2.0
355 stars 180 forks source link

Please add the ability to import postgresql_grant_role #420

Open mbyio opened 3 months ago

mbyio commented 3 months ago

Hi there,

Thank you for opening an issue. Please provide the following information:

Terraform Version

1.7.4

Affected Resource(s)

Terraform Configuration Files

I don't think an example is needed for this feature request, but I can create one if needed.

Expected Behavior

Be able to import a resource

Actual Behavior

Not able to import the resource

Important Factoids

We used the roles attribute of postgresql_role to setup role grants initially. Later we used postgresql_grant_role to add more roles. This caused thrashing, and per the docs we started ignoring the role grants on the postgresql_role resource. I feel like this is the right thing to do because it is more generic.

However, now I want to update the resources that were setup using the roles attribute on postgresql_role to use postgresql_grant_role. Unfortunately that seems impossible because I can't import the existing role grants into postgresql_grant_role.