1. Packages
  2. Keycloak Provider
  3. API Docs
  4. getRole
Keycloak v5.3.5 published on Wednesday, Oct 16, 2024 by Pulumi

keycloak.getRole

Explore with Pulumi AI

keycloak logo
Keycloak v5.3.5 published on Wednesday, Oct 16, 2024 by Pulumi

    # keycloak.Role data source

    This data source can be used to fetch properties of a Keycloak role for usage with other resources, such as keycloak.GroupRoles.

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    resources:
      realm:
        type: keycloak:Realm
        properties:
          realm: my-realm
          enabled: true
      # use the data source
      group:
        type: keycloak:Group
        properties:
          realmId: ${realm.id}
          name: group
      groupRoles:
        type: keycloak:GroupRoles
        name: group_roles
        properties:
          realmId: ${realm.id}
          groupId: ${group.id}
          roles:
            - ${offlineAccess.id}
    variables:
      offlineAccess:
        fn::invoke:
          Function: keycloak:getRole
          Arguments:
            realmId: ${realm.id}
            name: offline_access
    

    Argument Reference

    The following arguments are supported:

    • realm_id - (Required) The realm this role exists within.
    • client_id - (Optional) When specified, this role is assumed to be a client role belonging to the client with the provided ID
    • name - (Required) The name of the role

    Attributes Reference

    In addition to the arguments listed above, the following computed attributes are exported:

    • id - The unique ID of the role, which can be used as an argument to other resources supported by this provider.
    • description - The description of the role.

    Using getRole

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRole(args: GetRoleArgs, opts?: InvokeOptions): Promise<GetRoleResult>
    function getRoleOutput(args: GetRoleOutputArgs, opts?: InvokeOptions): Output<GetRoleResult>
    def get_role(client_id: Optional[str] = None,
                 name: Optional[str] = None,
                 realm_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRoleResult
    def get_role_output(client_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 realm_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetRoleResult]
    func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
    func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput

    > Note: This function is named LookupRole in the Go SDK.

    public static class GetRole 
    {
        public static Task<GetRoleResult> InvokeAsync(GetRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetRoleResult> Invoke(GetRoleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: keycloak:index/getRole:getRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    RealmId string
    ClientId string
    Name string
    RealmId string
    ClientId string
    name String
    realmId String
    clientId String
    name string
    realmId string
    clientId string
    name String
    realmId String
    clientId String

    getRole Result

    The following output properties are available:

    Attributes Dictionary<string, string>
    CompositeRoles List<string>
    Description string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    RealmId string
    ClientId string
    Attributes map[string]string
    CompositeRoles []string
    Description string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    RealmId string
    ClientId string
    attributes Map<String,String>
    compositeRoles List<String>
    description String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    realmId String
    clientId String
    attributes {[key: string]: string}
    compositeRoles string[]
    description string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    realmId string
    clientId string
    attributes Mapping[str, str]
    composite_roles Sequence[str]
    description str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    realm_id str
    client_id str
    attributes Map<String>
    compositeRoles List<String>
    description String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    realmId String
    clientId String

    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.3.5 published on Wednesday, Oct 16, 2024 by Pulumi