onelogin / terraform-provider-onelogin

GNU General Public License v3.0
27 stars 19 forks source link

Add new resource type to enable user role attachment #86

Closed at-k closed 1 year ago

at-k commented 1 year ago

Background

This PR resolve issue #80 https://github.com/onelogin/onelogin-go-sdk/pull/62 is required

How it work

resource "onelogin_roles" "role" {
  name   = "Test Role"
  apps   = [
    local.app_id,
  ]
  users  = []
  admins = []

  lifecycle {
    ignore_changes = [users, admins]
  }
}

resource "onelogin_user_role_attachments" "attachments" {
  role_id = onelogin_roles.role.id
  users = [
     local.user_a.id,
     local.user_b.id,
  ]
}