1. Packages
  2. Keycloak Provider
  3. API Docs
  4. GroupRoles
Keycloak v5.4.0 published on Monday, Dec 9, 2024 by Pulumi

keycloak.GroupRoles

Explore with Pulumi AI

keycloak logo
Keycloak v5.4.0 published on Monday, Dec 9, 2024 by Pulumi

    Allows you to manage roles assigned to a Keycloak group.

    If exhaustive is true, this resource attempts to be an authoritative source over group roles: roles that are manually added to the group will be removed, and roles that are manually removed from the group will be added upon the next run of pulumi up. If exhaustive is false, this resource is a partial assignation of roles to a group. As a result, you can get multiple keycloak.GroupRoles for the same group_id.

    Note that when assigning composite roles to a group, you may see a non-empty plan following a pulumi up if you assign a role and a composite that includes that role to the same group.

    Example Usage

    Exhaustive Roles)

    import * as pulumi from "@pulumi/pulumi";
    import * as keycloak from "@pulumi/keycloak";
    
    const realm = new keycloak.Realm("realm", {
        realm: "my-realm",
        enabled: true,
    });
    const realmRole = new keycloak.Role("realm_role", {
        realmId: realm.id,
        name: "my-realm-role",
        description: "My Realm Role",
    });
    const client = new keycloak.openid.Client("client", {
        realmId: realm.id,
        clientId: "client",
        name: "client",
        enabled: true,
        accessType: "BEARER-ONLY",
    });
    const clientRole = new keycloak.Role("client_role", {
        realmId: realm.id,
        clientId: clientKeycloakClient.id,
        name: "my-client-role",
        description: "My Client Role",
    });
    const group = new keycloak.Group("group", {
        realmId: realm.id,
        name: "my-group",
    });
    const groupRoles = new keycloak.GroupRoles("group_roles", {
        realmId: realm.id,
        groupId: group.id,
        roleIds: [
            realmRole.id,
            clientRole.id,
        ],
    });
    
    import pulumi
    import pulumi_keycloak as keycloak
    
    realm = keycloak.Realm("realm",
        realm="my-realm",
        enabled=True)
    realm_role = keycloak.Role("realm_role",
        realm_id=realm.id,
        name="my-realm-role",
        description="My Realm Role")
    client = keycloak.openid.Client("client",
        realm_id=realm.id,
        client_id="client",
        name="client",
        enabled=True,
        access_type="BEARER-ONLY")
    client_role = keycloak.Role("client_role",
        realm_id=realm.id,
        client_id=client_keycloak_client["id"],
        name="my-client-role",
        description="My Client Role")
    group = keycloak.Group("group",
        realm_id=realm.id,
        name="my-group")
    group_roles = keycloak.GroupRoles("group_roles",
        realm_id=realm.id,
        group_id=group.id,
        role_ids=[
            realm_role.id,
            client_role.id,
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-keycloak/sdk/v5/go/keycloak"
    	"github.com/pulumi/pulumi-keycloak/sdk/v5/go/keycloak/openid"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		realm, err := keycloak.NewRealm(ctx, "realm", &keycloak.RealmArgs{
    			Realm:   pulumi.String("my-realm"),
    			Enabled: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		realmRole, err := keycloak.NewRole(ctx, "realm_role", &keycloak.RoleArgs{
    			RealmId:     realm.ID(),
    			Name:        pulumi.String("my-realm-role"),
    			Description: pulumi.String("My Realm Role"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = openid.NewClient(ctx, "client", &openid.ClientArgs{
    			RealmId:    realm.ID(),
    			ClientId:   pulumi.String("client"),
    			Name:       pulumi.String("client"),
    			Enabled:    pulumi.Bool(true),
    			AccessType: pulumi.String("BEARER-ONLY"),
    		})
    		if err != nil {
    			return err
    		}
    		clientRole, err := keycloak.NewRole(ctx, "client_role", &keycloak.RoleArgs{
    			RealmId:     realm.ID(),
    			ClientId:    pulumi.Any(clientKeycloakClient.Id),
    			Name:        pulumi.String("my-client-role"),
    			Description: pulumi.String("My Client Role"),
    		})
    		if err != nil {
    			return err
    		}
    		group, err := keycloak.NewGroup(ctx, "group", &keycloak.GroupArgs{
    			RealmId: realm.ID(),
    			Name:    pulumi.String("my-group"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = keycloak.NewGroupRoles(ctx, "group_roles", &keycloak.GroupRolesArgs{
    			RealmId: realm.ID(),
    			GroupId: group.ID(),
    			RoleIds: pulumi.StringArray{
    				realmRole.ID(),
    				clientRole.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Keycloak = Pulumi.Keycloak;
    
    return await Deployment.RunAsync(() => 
    {
        var realm = new Keycloak.Realm("realm", new()
        {
            RealmName = "my-realm",
            Enabled = true,
        });
    
        var realmRole = new Keycloak.Role("realm_role", new()
        {
            RealmId = realm.Id,
            Name = "my-realm-role",
            Description = "My Realm Role",
        });
    
        var client = new Keycloak.OpenId.Client("client", new()
        {
            RealmId = realm.Id,
            ClientId = "client",
            Name = "client",
            Enabled = true,
            AccessType = "BEARER-ONLY",
        });
    
        var clientRole = new Keycloak.Role("client_role", new()
        {
            RealmId = realm.Id,
            ClientId = clientKeycloakClient.Id,
            Name = "my-client-role",
            Description = "My Client Role",
        });
    
        var @group = new Keycloak.Group("group", new()
        {
            RealmId = realm.Id,
            Name = "my-group",
        });
    
        var groupRoles = new Keycloak.GroupRoles("group_roles", new()
        {
            RealmId = realm.Id,
            GroupId = @group.Id,
            RoleIds = new[]
            {
                realmRole.Id,
                clientRole.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.keycloak.Realm;
    import com.pulumi.keycloak.RealmArgs;
    import com.pulumi.keycloak.Role;
    import com.pulumi.keycloak.RoleArgs;
    import com.pulumi.keycloak.openid.Client;
    import com.pulumi.keycloak.openid.ClientArgs;
    import com.pulumi.keycloak.Group;
    import com.pulumi.keycloak.GroupArgs;
    import com.pulumi.keycloak.GroupRoles;
    import com.pulumi.keycloak.GroupRolesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var realm = new Realm("realm", RealmArgs.builder()
                .realm("my-realm")
                .enabled(true)
                .build());
    
            var realmRole = new Role("realmRole", RoleArgs.builder()
                .realmId(realm.id())
                .name("my-realm-role")
                .description("My Realm Role")
                .build());
    
            var client = new Client("client", ClientArgs.builder()
                .realmId(realm.id())
                .clientId("client")
                .name("client")
                .enabled(true)
                .accessType("BEARER-ONLY")
                .build());
    
            var clientRole = new Role("clientRole", RoleArgs.builder()
                .realmId(realm.id())
                .clientId(clientKeycloakClient.id())
                .name("my-client-role")
                .description("My Client Role")
                .build());
    
            var group = new Group("group", GroupArgs.builder()
                .realmId(realm.id())
                .name("my-group")
                .build());
    
            var groupRoles = new GroupRoles("groupRoles", GroupRolesArgs.builder()
                .realmId(realm.id())
                .groupId(group.id())
                .roleIds(            
                    realmRole.id(),
                    clientRole.id())
                .build());
    
        }
    }
    
    resources:
      realm:
        type: keycloak:Realm
        properties:
          realm: my-realm
          enabled: true
      realmRole:
        type: keycloak:Role
        name: realm_role
        properties:
          realmId: ${realm.id}
          name: my-realm-role
          description: My Realm Role
      client:
        type: keycloak:openid:Client
        properties:
          realmId: ${realm.id}
          clientId: client
          name: client
          enabled: true
          accessType: BEARER-ONLY
      clientRole:
        type: keycloak:Role
        name: client_role
        properties:
          realmId: ${realm.id}
          clientId: ${clientKeycloakClient.id}
          name: my-client-role
          description: My Client Role
      group:
        type: keycloak:Group
        properties:
          realmId: ${realm.id}
          name: my-group
      groupRoles:
        type: keycloak:GroupRoles
        name: group_roles
        properties:
          realmId: ${realm.id}
          groupId: ${group.id}
          roleIds:
            - ${realmRole.id}
            - ${clientRole.id}
    

    Non Exhaustive Roles)

    import * as pulumi from "@pulumi/pulumi";
    import * as keycloak from "@pulumi/keycloak";
    
    const realm = new keycloak.Realm("realm", {
        realm: "my-realm",
        enabled: true,
    });
    const realmRole = new keycloak.Role("realm_role", {
        realmId: realm.id,
        name: "my-realm-role",
        description: "My Realm Role",
    });
    const client = new keycloak.openid.Client("client", {
        realmId: realm.id,
        clientId: "client",
        name: "client",
        enabled: true,
        accessType: "BEARER-ONLY",
    });
    const clientRole = new keycloak.Role("client_role", {
        realmId: realm.id,
        clientId: clientKeycloakClient.id,
        name: "my-client-role",
        description: "My Client Role",
    });
    const group = new keycloak.Group("group", {
        realmId: realm.id,
        name: "my-group",
    });
    const groupRoleAssociation1 = new keycloak.GroupRoles("group_role_association1", {
        realmId: realm.id,
        groupId: group.id,
        exhaustive: false,
        roleIds: [realmRole.id],
    });
    const groupRoleAssociation2 = new keycloak.GroupRoles("group_role_association2", {
        realmId: realm.id,
        groupId: group.id,
        exhaustive: false,
        roleIds: [clientRole.id],
    });
    
    import pulumi
    import pulumi_keycloak as keycloak
    
    realm = keycloak.Realm("realm",
        realm="my-realm",
        enabled=True)
    realm_role = keycloak.Role("realm_role",
        realm_id=realm.id,
        name="my-realm-role",
        description="My Realm Role")
    client = keycloak.openid.Client("client",
        realm_id=realm.id,
        client_id="client",
        name="client",
        enabled=True,
        access_type="BEARER-ONLY")
    client_role = keycloak.Role("client_role",
        realm_id=realm.id,
        client_id=client_keycloak_client["id"],
        name="my-client-role",
        description="My Client Role")
    group = keycloak.Group("group",
        realm_id=realm.id,
        name="my-group")
    group_role_association1 = keycloak.GroupRoles("group_role_association1",
        realm_id=realm.id,
        group_id=group.id,
        exhaustive=False,
        role_ids=[realm_role.id])
    group_role_association2 = keycloak.GroupRoles("group_role_association2",
        realm_id=realm.id,
        group_id=group.id,
        exhaustive=False,
        role_ids=[client_role.id])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-keycloak/sdk/v5/go/keycloak"
    	"github.com/pulumi/pulumi-keycloak/sdk/v5/go/keycloak/openid"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		realm, err := keycloak.NewRealm(ctx, "realm", &keycloak.RealmArgs{
    			Realm:   pulumi.String("my-realm"),
    			Enabled: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		realmRole, err := keycloak.NewRole(ctx, "realm_role", &keycloak.RoleArgs{
    			RealmId:     realm.ID(),
    			Name:        pulumi.String("my-realm-role"),
    			Description: pulumi.String("My Realm Role"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = openid.NewClient(ctx, "client", &openid.ClientArgs{
    			RealmId:    realm.ID(),
    			ClientId:   pulumi.String("client"),
    			Name:       pulumi.String("client"),
    			Enabled:    pulumi.Bool(true),
    			AccessType: pulumi.String("BEARER-ONLY"),
    		})
    		if err != nil {
    			return err
    		}
    		clientRole, err := keycloak.NewRole(ctx, "client_role", &keycloak.RoleArgs{
    			RealmId:     realm.ID(),
    			ClientId:    pulumi.Any(clientKeycloakClient.Id),
    			Name:        pulumi.String("my-client-role"),
    			Description: pulumi.String("My Client Role"),
    		})
    		if err != nil {
    			return err
    		}
    		group, err := keycloak.NewGroup(ctx, "group", &keycloak.GroupArgs{
    			RealmId: realm.ID(),
    			Name:    pulumi.String("my-group"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = keycloak.NewGroupRoles(ctx, "group_role_association1", &keycloak.GroupRolesArgs{
    			RealmId:    realm.ID(),
    			GroupId:    group.ID(),
    			Exhaustive: pulumi.Bool(false),
    			RoleIds: pulumi.StringArray{
    				realmRole.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = keycloak.NewGroupRoles(ctx, "group_role_association2", &keycloak.GroupRolesArgs{
    			RealmId:    realm.ID(),
    			GroupId:    group.ID(),
    			Exhaustive: pulumi.Bool(false),
    			RoleIds: pulumi.StringArray{
    				clientRole.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Keycloak = Pulumi.Keycloak;
    
    return await Deployment.RunAsync(() => 
    {
        var realm = new Keycloak.Realm("realm", new()
        {
            RealmName = "my-realm",
            Enabled = true,
        });
    
        var realmRole = new Keycloak.Role("realm_role", new()
        {
            RealmId = realm.Id,
            Name = "my-realm-role",
            Description = "My Realm Role",
        });
    
        var client = new Keycloak.OpenId.Client("client", new()
        {
            RealmId = realm.Id,
            ClientId = "client",
            Name = "client",
            Enabled = true,
            AccessType = "BEARER-ONLY",
        });
    
        var clientRole = new Keycloak.Role("client_role", new()
        {
            RealmId = realm.Id,
            ClientId = clientKeycloakClient.Id,
            Name = "my-client-role",
            Description = "My Client Role",
        });
    
        var @group = new Keycloak.Group("group", new()
        {
            RealmId = realm.Id,
            Name = "my-group",
        });
    
        var groupRoleAssociation1 = new Keycloak.GroupRoles("group_role_association1", new()
        {
            RealmId = realm.Id,
            GroupId = @group.Id,
            Exhaustive = false,
            RoleIds = new[]
            {
                realmRole.Id,
            },
        });
    
        var groupRoleAssociation2 = new Keycloak.GroupRoles("group_role_association2", new()
        {
            RealmId = realm.Id,
            GroupId = @group.Id,
            Exhaustive = false,
            RoleIds = new[]
            {
                clientRole.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.keycloak.Realm;
    import com.pulumi.keycloak.RealmArgs;
    import com.pulumi.keycloak.Role;
    import com.pulumi.keycloak.RoleArgs;
    import com.pulumi.keycloak.openid.Client;
    import com.pulumi.keycloak.openid.ClientArgs;
    import com.pulumi.keycloak.Group;
    import com.pulumi.keycloak.GroupArgs;
    import com.pulumi.keycloak.GroupRoles;
    import com.pulumi.keycloak.GroupRolesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var realm = new Realm("realm", RealmArgs.builder()
                .realm("my-realm")
                .enabled(true)
                .build());
    
            var realmRole = new Role("realmRole", RoleArgs.builder()
                .realmId(realm.id())
                .name("my-realm-role")
                .description("My Realm Role")
                .build());
    
            var client = new Client("client", ClientArgs.builder()
                .realmId(realm.id())
                .clientId("client")
                .name("client")
                .enabled(true)
                .accessType("BEARER-ONLY")
                .build());
    
            var clientRole = new Role("clientRole", RoleArgs.builder()
                .realmId(realm.id())
                .clientId(clientKeycloakClient.id())
                .name("my-client-role")
                .description("My Client Role")
                .build());
    
            var group = new Group("group", GroupArgs.builder()
                .realmId(realm.id())
                .name("my-group")
                .build());
    
            var groupRoleAssociation1 = new GroupRoles("groupRoleAssociation1", GroupRolesArgs.builder()
                .realmId(realm.id())
                .groupId(group.id())
                .exhaustive(false)
                .roleIds(realmRole.id())
                .build());
    
            var groupRoleAssociation2 = new GroupRoles("groupRoleAssociation2", GroupRolesArgs.builder()
                .realmId(realm.id())
                .groupId(group.id())
                .exhaustive(false)
                .roleIds(clientRole.id())
                .build());
    
        }
    }
    
    resources:
      realm:
        type: keycloak:Realm
        properties:
          realm: my-realm
          enabled: true
      realmRole:
        type: keycloak:Role
        name: realm_role
        properties:
          realmId: ${realm.id}
          name: my-realm-role
          description: My Realm Role
      client:
        type: keycloak:openid:Client
        properties:
          realmId: ${realm.id}
          clientId: client
          name: client
          enabled: true
          accessType: BEARER-ONLY
      clientRole:
        type: keycloak:Role
        name: client_role
        properties:
          realmId: ${realm.id}
          clientId: ${clientKeycloakClient.id}
          name: my-client-role
          description: My Client Role
      group:
        type: keycloak:Group
        properties:
          realmId: ${realm.id}
          name: my-group
      groupRoleAssociation1:
        type: keycloak:GroupRoles
        name: group_role_association1
        properties:
          realmId: ${realm.id}
          groupId: ${group.id}
          exhaustive: false
          roleIds:
            - ${realmRole.id}
      groupRoleAssociation2:
        type: keycloak:GroupRoles
        name: group_role_association2
        properties:
          realmId: ${realm.id}
          groupId: ${group.id}
          exhaustive: false
          roleIds:
            - ${clientRole.id}
    

    Create GroupRoles Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GroupRoles(name: string, args: GroupRolesArgs, opts?: CustomResourceOptions);
    @overload
    def GroupRoles(resource_name: str,
                   args: GroupRolesArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupRoles(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   group_id: Optional[str] = None,
                   realm_id: Optional[str] = None,
                   role_ids: Optional[Sequence[str]] = None,
                   exhaustive: Optional[bool] = None)
    func NewGroupRoles(ctx *Context, name string, args GroupRolesArgs, opts ...ResourceOption) (*GroupRoles, error)
    public GroupRoles(string name, GroupRolesArgs args, CustomResourceOptions? opts = null)
    public GroupRoles(String name, GroupRolesArgs args)
    public GroupRoles(String name, GroupRolesArgs args, CustomResourceOptions options)
    
    type: keycloak:GroupRoles
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GroupRolesArgs
    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 GroupRolesArgs
    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 GroupRolesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupRolesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupRolesArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var groupRolesResource = new Keycloak.GroupRoles("groupRolesResource", new()
    {
        GroupId = "string",
        RealmId = "string",
        RoleIds = new[]
        {
            "string",
        },
        Exhaustive = false,
    });
    
    example, err := keycloak.NewGroupRoles(ctx, "groupRolesResource", &keycloak.GroupRolesArgs{
    	GroupId: pulumi.String("string"),
    	RealmId: pulumi.String("string"),
    	RoleIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Exhaustive: pulumi.Bool(false),
    })
    
    var groupRolesResource = new GroupRoles("groupRolesResource", GroupRolesArgs.builder()
        .groupId("string")
        .realmId("string")
        .roleIds("string")
        .exhaustive(false)
        .build());
    
    group_roles_resource = keycloak.GroupRoles("groupRolesResource",
        group_id="string",
        realm_id="string",
        role_ids=["string"],
        exhaustive=False)
    
    const groupRolesResource = new keycloak.GroupRoles("groupRolesResource", {
        groupId: "string",
        realmId: "string",
        roleIds: ["string"],
        exhaustive: false,
    });
    
    type: keycloak:GroupRoles
    properties:
        exhaustive: false
        groupId: string
        realmId: string
        roleIds:
            - string
    

    GroupRoles Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The GroupRoles resource accepts the following input properties:

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

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GroupRoles 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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing GroupRoles Resource

    Get an existing GroupRoles 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?: GroupRolesState, opts?: CustomResourceOptions): GroupRoles
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            exhaustive: Optional[bool] = None,
            group_id: Optional[str] = None,
            realm_id: Optional[str] = None,
            role_ids: Optional[Sequence[str]] = None) -> GroupRoles
    func GetGroupRoles(ctx *Context, name string, id IDInput, state *GroupRolesState, opts ...ResourceOption) (*GroupRoles, error)
    public static GroupRoles Get(string name, Input<string> id, GroupRolesState? state, CustomResourceOptions? opts = null)
    public static GroupRoles get(String name, Output<String> id, GroupRolesState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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 group will be removed. Defaults to true.
    GroupId string
    The ID of the group this resource should manage roles for.
    RealmId string
    The realm this group exists in.
    RoleIds List<string>
    A list of role IDs to map to the group.
    Exhaustive bool
    Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the group will be removed. Defaults to true.
    GroupId string
    The ID of the group this resource should manage roles for.
    RealmId string
    The realm this group exists in.
    RoleIds []string
    A list of role IDs to map to the group.
    exhaustive Boolean
    Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the group will be removed. Defaults to true.
    groupId String
    The ID of the group this resource should manage roles for.
    realmId String
    The realm this group exists in.
    roleIds List<String>
    A list of role IDs to map to the group.
    exhaustive boolean
    Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the group will be removed. Defaults to true.
    groupId string
    The ID of the group this resource should manage roles for.
    realmId string
    The realm this group exists in.
    roleIds string[]
    A list of role IDs to map to the group.
    exhaustive bool
    Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the group will be removed. Defaults to true.
    group_id str
    The ID of the group this resource should manage roles for.
    realm_id str
    The realm this group exists in.
    role_ids Sequence[str]
    A list of role IDs to map to the group.
    exhaustive Boolean
    Indicates if the list of roles is exhaustive. In this case, roles that are manually added to the group will be removed. Defaults to true.
    groupId String
    The ID of the group this resource should manage roles for.
    realmId String
    The realm this group exists in.
    roleIds List<String>
    A list of role IDs to map to the group.

    Import

    This resource can be imported using the format {{realm_id}}/{{group_id}}, where group_id is the unique ID that Keycloak

    assigns to the group upon creation. This value can be found in the URI when editing this group in the GUI, and is typically

    a GUID.

    Example:

    bash

    $ pulumi import keycloak:index/groupRoles:GroupRoles group_roles my-realm/18cc6b87-2ce7-4e59-bdc8-b9d49ec98a94
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Keycloak pulumi/pulumi-keycloak
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the keycloak Terraform Provider.
    keycloak logo
    Keycloak v5.4.0 published on Monday, Dec 9, 2024 by Pulumi