Kaginari / terraform-provider-mongodb

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

mongodb_db_user resource only allows 2 roles #2

Closed rubenqba closed 3 years ago

rubenqba commented 3 years ago

Hi, I'm trying to assign several roles to users, but it seems that the role attribute only allows a maximum of 2 roles.

I'm using this test resource

resource "mongodb_db_user" "test_user" {
  auth_database = "admin"
  name = "test_user"
  password = "s3cr3t"
  role {
    role = "readWrite"
    db =   "develop"
  }  
  role {
    role = "readWrite"
    db =   "staging"
  }  
  role {
    role = "readWrite"
    db =   "production"
  }  
}

and then I got the following response:

Error: List longer than MaxItems

  on users.tf line 18, in resource "mongodb_db_user" "test_user":
  18: resource "mongodb_db_user" "user" {

Attribute supports 2 item maximum, config has 3 declared

Just like the error message says if I only define one or two roles, it executes successfully.

ITMonta commented 3 years ago

@rubenqba Thank you , it only support 2 roles for now as you can create custom role and use it, we are looking to add multi role support up to 10 in the next release

ITMonta commented 3 years ago

New release support up to 10 roles per user.

https://registry.terraform.io/providers/Kaginari/mongodb/latest/docs