-
Notifications
You must be signed in to change notification settings - Fork 3
fix: support unmanaged roles on user resource #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -77,7 +80,7 @@ func TestAccUserResource(t *testing.T) { | |||
ImportStateVerify: true, | |||
ImportStateId: "example", | |||
// We can't pull the password from the API. | |||
ImportStateVerifyIgnore: []string{"password"}, | |||
ImportStateVerifyIgnore: []string{"password", "roles"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we're using null
to signify that roles
shouldn't be managed by Terraform, we have the same problem we have with the group
resource: we don't know whether or not the null
value was set in the config, or is null because it's an import. Frustratingly, the provider framework doesn't provide a way to differentiate the two.
Merge activity
|
A customer ran into an issue when creating an OIDC user while role sync was enabled on the deployment:
This is because we always call
UpdateUserRoles
onCreate
andUpdate
.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 tonull
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.