-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add role_assignment, user, sso_group resources and data sources #164
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
e807d72 to
7a1c00e
Compare
albertodonato
left a comment
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.
LGTM, thanks.
A couple of minor comments inline, but nothing really blocking
| func (r *roleAssignmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { | ||
| // Role assignments must be imported using the composite key: "role_name,principal,target" | ||
| // Example: "viewer,user:1,account-group:abc-123" | ||
| parts := strings.Split(req.ID, ",") |
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.
too bad we can't use importState here due to the : in ids...
fix: role_assignment bug where state was using id which does not work for querying objects from api.
7a1c00e to
5d551fa
Compare
update: docs for user api and role_assignment
5d551fa to
cd8529a
Compare
internal/models/user.go
Outdated
|
|
||
| roles, d := types.ListValueFrom(ctx, types.StringType, user.Roles) | ||
| diags.Append(d...) | ||
| m.Roles = 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.
All four of these fields are deprecated.
albertodonato
left a comment
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.
LGTM, thanks
ENG-5987
what
Adds
role_assignment,user,sso_groupresource types to terraform providerAdds
user,sso_groupdata sources to terraform provider.why
These data sources enable users to:
role_assignmentresourceThis is part of the RBAC support feature set, specifically focusing on resources and the data sources necessary to creating role assignments
testing
docs
examples/data-sources/stacklet_userandexamples/data-sources/stacklet_sso_group/as well as the resourcesexamples/resources/stacklet_role_assigment