Show / Hide Table of Contents

Class HardcodedRoleMapper

# keycloak.ldap.HardcodedRoleMapper

This mapper will grant a specified Keycloak role to each Keycloak user linked with LDAP.

Example Usage

using Pulumi;
using Keycloak = Pulumi.Keycloak;

class MyStack : Stack
{
public MyStack()
{
    var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
    {
        Realm = "test",
        Enabled = true,
    });
    var ldapUserFederation = new Keycloak.Ldap.UserFederation("ldapUserFederation", new Keycloak.Ldap.UserFederationArgs
    {
        RealmId = realm.Id,
        UsernameLdapAttribute = "cn",
        RdnLdapAttribute = "cn",
        UuidLdapAttribute = "entryDN",
        UserObjectClasses = 
        {
            "simpleSecurityObject",
            "organizationalRole",
        },
        ConnectionUrl = "ldap://openldap",
        UsersDn = "dc=example,dc=org",
        BindDn = "cn=admin,dc=example,dc=org",
        BindCredential = "admin",
    });
    var assignAdminRoleToAllUsers = new Keycloak.Ldap.HardcodedRoleMapper("assignAdminRoleToAllUsers", new Keycloak.Ldap.HardcodedRoleMapperArgs
    {
        RealmId = realm.Id,
        LdapUserFederationId = ldapUserFederation.Id,
        Role = "admin",
    });
}

}

Argument Reference

The following arguments are supported:

  • realm_id - (Required) The realm that this LDAP mapper will exist in.
  • ldap_user_federation_id - (Required) The ID of the LDAP user federation provider to attach this mapper to.
  • name - (Required) Display name of this mapper when displayed in the console.
  • role - (Required) The role which should be assigned to the users.
Inheritance
System.Object
Resource
CustomResource
HardcodedRoleMapper
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Keycloak.Ldap
Assembly: Pulumi.Keycloak.dll
Syntax
public class HardcodedRoleMapper : CustomResource

Constructors

View Source

HardcodedRoleMapper(String, HardcodedRoleMapperArgs, CustomResourceOptions)

Create a HardcodedRoleMapper resource with the given unique name, arguments, and options.

Declaration
public HardcodedRoleMapper(string name, HardcodedRoleMapperArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

HardcodedRoleMapperArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

LdapUserFederationId

The ldap user federation provider to attach this mapper to.

Declaration
public Output<string> LdapUserFederationId { get; }
Property Value
Type Description
Output<System.String>
View Source

Name

Display name of the mapper when displayed in the console.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

RealmId

The realm in which the ldap user federation provider exists.

Declaration
public Output<string> RealmId { get; }
Property Value
Type Description
Output<System.String>
View Source

Role

Role to grant to user.

Declaration
public Output<string> Role { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, HardcodedRoleMapperState, CustomResourceOptions)

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

Declaration
public static HardcodedRoleMapper Get(string name, Input<string> id, HardcodedRoleMapperState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

HardcodedRoleMapperState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
HardcodedRoleMapper
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.