terraform-provider-postgresql
terraform-provider-postgresql copied to clipboard
Dependency wait failed for postgresql_role
Hi there,
Thanks for the provider, i've having a issue when creating a lot of roles, the creation of the roles itself works great, but when comes to grant roles, provider can't create the role before try to grant it.
Terraform Version
~ terraform -v
Terraform v1.6.1
on darwin_arm64
Affected Resource(s)
Please list the resources as a list, for example:
- postgresql_role.role
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
https://drive.google.com/drive/folders/1LVOyg_kE9FuBjZCjg9Cd8Xd69kRAwW82?usp=sharing
Debug Output
terraform.log in the same share
Expected Behavior
It should calculate the dependency in order to create the roles before grant to another.
Actual Behavior
╷
│ Error: could not grant role grp_su_app_xpto4 to usr_sys_su_app_xpto4: pq: role "grp_su_app_xpto4" does not exist
│
│ with postgresql_role.role["usr_sys_su_app_xpto4"],
│ on roles.tf line 1, in resource "postgresql_role" "role":
│ 1: resource "postgresql_role" "role" {
│
╵
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
Using AWS RDS PSQL 14
Tested this scenario with : terraform apply -parallelism=1 and it worked, but in the project i'm creating with 59 roles, it just breaks.
I guess for now i'm going to split manually the resources to tackle the issue temporary.
Ricardo
I have the exact same issue. Therefore, I have to split my resources unfortunately.