Kaginari / terraform-provider-mongodb

Terraform provider for mongodb instance (selfhosted, AWS documentDB and cloud instances )
MIT License
26 stars 33 forks source link

Issues when deleting or importing users #11

Closed eivindam closed 3 years ago

eivindam commented 3 years ago

We had issues with importing and deleting users. When deleting a user the state is gone but the mongodb user is still present.

On user import we got this issue:

Error: Invalid address to set: []string{"database"}

ITMonta commented 3 years ago

@eivindam thank you again for the feedback and contribution , the import function is not supported we will add it. the delete problem is probably because you delete a user created in a different database as its configured to delete users from admin database (default database for selfhosted mongodb) which is a bug if you are using documentDB . you solution should work with deleting the users thank you, As for the import we will implement it as it's not implemented yet

ITMonta commented 3 years ago

Terraform import users added

ITMonta commented 3 years ago

Terraform import role added

ITMonta commented 3 years ago

Fixed in version 0.0.8 Add terraform import for users https://registry.terraform.io/providers/Kaginari/mongodb/latest/docs/resources/database_user?pollNotifications=true#import Add terraform import for roles https://registry.terraform.io/providers/Kaginari/mongodb/latest/docs/resources/database_role?pollNotifications=true#import-1 thank you again for the contribution @eivindam