You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: support unmanaged roles on user resource (#250)
A customer ran into an issue when creating an OIDC user while role sync was enabled on the deployment:
```
Error: 'User Role Field' is set in the OIDC configuration. All role changes must come from the oidc identity provider.
```
This is because we always call `UpdateUserRoles` on `Create` and `Update`.
OIDC User roles cannot be managed via the API if role sync is used, as the API always returns an error on any role update request.
With this PR, `roles` can now be set to `null` in the config, whereby the Terraform provider will not attempt to read or update the user's roles under any circumstances. This prevents config drift when roles are set via Role Sync.
-`login_type` (String) Type of login for the user. Valid types are `none`, `password`, `github`, and `oidc`.
57
57
-`name` (String) Display name of the user. Defaults to username.
58
58
-`password` (String, Sensitive) Password for the user. Required when `login_type` is `password`. Passwords are saved into the state as plain text and should only be used for testing purposes.
59
-
-`roles` (Set of String) Roles assigned to the user. Valid roles are `owner`, `template-admin`, `user-admin`, and `auditor`.
59
+
-`roles` (Set of String) Roles assigned to the user. Valid roles are `owner`, `template-admin`, `user-admin`, and `auditor`. If `null`, roles will not be managed by Terraform. This attribute must be null if the user is an OIDC user and role sync is configured
60
60
-`suspended` (Boolean) Whether the user is suspended.
MarkdownDescription: "Roles assigned to the user. Valid roles are `owner`, `template-admin`, `user-admin`, and `auditor`.",
92
-
Computed: true,
90
+
MarkdownDescription: "Roles assigned to the user. Valid roles are `owner`, `template-admin`, `user-admin`, and `auditor`. If `null`, roles will not be managed by Terraform. This attribute must be null if the user is an OIDC user and role sync is configured",
0 commit comments