UserRoles

Import

This resource can be imported using the format {{realm_id}}/{{user_id}}, where user_id is the unique ID that Keycloak assigns to the user upon creation. This value can be found in the GUI when editing the user, and is typically a GUID. Examplebash

 $ pulumi import keycloak:index/userRoles:UserRoles user_roles my-realm/b0ae6924-1bd5-4655-9e38-dae7c5e42924

Create a UserRoles Resource

new UserRoles(name: string, args: UserRolesArgs, opts?: CustomResourceOptions);
@overload
def UserRoles(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              exhaustive: Optional[bool] = None,
              realm_id: Optional[str] = None,
              role_ids: Optional[Sequence[str]] = None,
              user_id: Optional[str] = None)
@overload
def UserRoles(resource_name: str,
              args: UserRolesArgs,
              opts: Optional[ResourceOptions] = None)
func NewUserRoles(ctx *Context, name string, args UserRolesArgs, opts ...ResourceOption) (*UserRoles, error)
public UserRoles(string name, UserRolesArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args UserRolesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args UserRolesArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args UserRolesArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args UserRolesArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

UserRoles Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The UserRoles resource accepts the following input properties:

RealmId string
The realm this user exists in.
RoleIds List<string>
A list of role IDs to map to the user
UserId string
The ID of the user this resource should manage roles for.
Exhaustive bool
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.
RealmId string
The realm this user exists in.
RoleIds []string
A list of role IDs to map to the user
UserId string
The ID of the user this resource should manage roles for.
Exhaustive bool
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.
realmId string
The realm this user exists in.
roleIds string[]
A list of role IDs to map to the user
userId string
The ID of the user this resource should manage roles for.
exhaustive boolean
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.
realm_id str
The realm this user exists in.
role_ids Sequence[str]
A list of role IDs to map to the user
user_id str
The ID of the user this resource should manage roles for.
exhaustive bool
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.

Outputs

All input properties are implicitly available as output properties. Additionally, the UserRoles resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing UserRoles Resource

Get an existing UserRoles resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: UserRolesState, opts?: CustomResourceOptions): UserRoles
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        exhaustive: Optional[bool] = None,
        realm_id: Optional[str] = None,
        role_ids: Optional[Sequence[str]] = None,
        user_id: Optional[str] = None) -> UserRoles
func GetUserRoles(ctx *Context, name string, id IDInput, state *UserRolesState, opts ...ResourceOption) (*UserRoles, error)
public static UserRoles Get(string name, Input<string> id, UserRolesState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Exhaustive bool
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.
RealmId string
The realm this user exists in.
RoleIds List<string>
A list of role IDs to map to the user
UserId string
The ID of the user this resource should manage roles for.
Exhaustive bool
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.
RealmId string
The realm this user exists in.
RoleIds []string
A list of role IDs to map to the user
UserId string
The ID of the user this resource should manage roles for.
exhaustive boolean
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.
realmId string
The realm this user exists in.
roleIds string[]
A list of role IDs to map to the user
userId string
The ID of the user this resource should manage roles for.
exhaustive bool
Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the user will be removed. Defaults to true.
realm_id str
The realm this user exists in.
role_ids Sequence[str]
A list of role IDs to map to the user
user_id str
The ID of the user this resource should manage roles for.

Package Details

Repository
https://github.com/pulumi/pulumi-keycloak
License
Apache-2.0
Notes
This Pulumi package is based on the keycloak Terraform Provider.