MsadUserAccountControlMapper
# keycloak.ldap.MsadUserAccountControlMapper
Allows for creating and managing MSAD user account control mappers for Keycloak users federated via LDAP.
The MSAD (Microsoft Active Directory) user account control mapper is specific to LDAP user federation providers that are pulling from AD, and it can propagate AD user state to Keycloak in order to enforce settings like expired passwords or disabled accounts.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";
const realm = new keycloak.Realm("realm", {
enabled: true,
realm: "test",
});
const ldapUserFederation = new keycloak.ldap.UserFederation("ldap_user_federation", {
bindCredential: "admin",
bindDn: "cn=admin,dc=example,dc=org",
connectionUrl: "ldap://my-ad-server",
rdnLdapAttribute: "cn",
realmId: realm.id,
userObjectClasses: [
"person",
"organizationalPerson",
"user",
],
usernameLdapAttribute: "cn",
usersDn: "dc=example,dc=org",
uuidLdapAttribute: "objectGUID",
});
const msadUserAccountControlMapper = new keycloak.ldap.MsadUserAccountControlMapper("msad_user_account_control_mapper", {
ldapUserFederationId: ldapUserFederation.id,
realmId: realm.id,
});import pulumi
import pulumi_keycloak as keycloak
realm = keycloak.Realm("realm",
enabled=True,
realm="test")
ldap_user_federation = keycloak.ldap.UserFederation("ldapUserFederation",
bind_credential="admin",
bind_dn="cn=admin,dc=example,dc=org",
connection_url="ldap://my-ad-server",
rdn_ldap_attribute="cn",
realm_id=realm.id,
user_object_classes=[
"person",
"organizationalPerson",
"user",
],
username_ldap_attribute="cn",
users_dn="dc=example,dc=org",
uuid_ldap_attribute="objectGUID")
msad_user_account_control_mapper = keycloak.ldap.MsadUserAccountControlMapper("msadUserAccountControlMapper",
ldap_user_federation_id=ldap_user_federation.id,
realm_id=realm.id)using Pulumi;
using Keycloak = Pulumi.Keycloak;
class MyStack : Stack
{
public MyStack()
{
var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
{
Enabled = true,
Realm = "test",
});
var ldapUserFederation = new Keycloak.Ldap.UserFederation("ldapUserFederation", new Keycloak.Ldap.UserFederationArgs
{
BindCredential = "admin",
BindDn = "cn=admin,dc=example,dc=org",
ConnectionUrl = "ldap://my-ad-server",
RdnLdapAttribute = "cn",
RealmId = realm.Id,
UserObjectClasses =
{
"person",
"organizationalPerson",
"user",
},
UsernameLdapAttribute = "cn",
UsersDn = "dc=example,dc=org",
UuidLdapAttribute = "objectGUID",
});
var msadUserAccountControlMapper = new Keycloak.Ldap.MsadUserAccountControlMapper("msadUserAccountControlMapper", new Keycloak.Ldap.MsadUserAccountControlMapperArgs
{
LdapUserFederationId = ldapUserFederation.Id,
RealmId = realm.Id,
});
}
}
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.ldap_password_policy_hints_enabled- (Optional) Whentrue, advanced password policies, such as password hints and previous password history will be used when writing new passwords to AD. Defaults tofalse.
Create a MsadUserAccountControlMapper Resource
new MsadUserAccountControlMapper(name: string, args: MsadUserAccountControlMapperArgs, opts?: CustomResourceOptions);def MsadUserAccountControlMapper(resource_name, opts=None, ldap_password_policy_hints_enabled=None, ldap_user_federation_id=None, name=None, realm_id=None, __props__=None);func NewMsadUserAccountControlMapper(ctx *Context, name string, args MsadUserAccountControlMapperArgs, opts ...ResourceOption) (*MsadUserAccountControlMapper, error)public MsadUserAccountControlMapper(string name, MsadUserAccountControlMapperArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args MsadUserAccountControlMapperArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args MsadUserAccountControlMapperArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MsadUserAccountControlMapperArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
MsadUserAccountControlMapper Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The MsadUserAccountControlMapper resource accepts the following input properties:
- Ldap
User stringFederation Id The ldap user federation provider to attach this mapper to.
- Realm
Id string The realm in which the ldap user federation provider exists.
- Ldap
Password boolPolicy Hints Enabled - Name string
Display name of the mapper when displayed in the console.
- Ldap
User stringFederation Id The ldap user federation provider to attach this mapper to.
- Realm
Id string The realm in which the ldap user federation provider exists.
- Ldap
Password boolPolicy Hints Enabled - Name string
Display name of the mapper when displayed in the console.
- ldap
User stringFederation Id The ldap user federation provider to attach this mapper to.
- realm
Id string The realm in which the ldap user federation provider exists.
- ldap
Password booleanPolicy Hints Enabled - name string
Display name of the mapper when displayed in the console.
- ldap_
user_ strfederation_ id The ldap user federation provider to attach this mapper to.
- realm_
id str The realm in which the ldap user federation provider exists.
- ldap_
password_ boolpolicy_ hints_ enabled - name str
Display name of the mapper when displayed in the console.
Outputs
All input properties are implicitly available as output properties. Additionally, the MsadUserAccountControlMapper resource produces the following output properties:
Look up an Existing MsadUserAccountControlMapper Resource
Get an existing MsadUserAccountControlMapper 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?: MsadUserAccountControlMapperState, opts?: CustomResourceOptions): MsadUserAccountControlMapperstatic get(resource_name, id, opts=None, ldap_password_policy_hints_enabled=None, ldap_user_federation_id=None, name=None, realm_id=None, __props__=None);func GetMsadUserAccountControlMapper(ctx *Context, name string, id IDInput, state *MsadUserAccountControlMapperState, opts ...ResourceOption) (*MsadUserAccountControlMapper, error)public static MsadUserAccountControlMapper Get(string name, Input<string> id, MsadUserAccountControlMapperState? 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:
- Ldap
Password boolPolicy Hints Enabled - Ldap
User stringFederation Id The ldap user federation provider to attach this mapper to.
- Name string
Display name of the mapper when displayed in the console.
- Realm
Id string The realm in which the ldap user federation provider exists.
- Ldap
Password boolPolicy Hints Enabled - Ldap
User stringFederation Id The ldap user federation provider to attach this mapper to.
- Name string
Display name of the mapper when displayed in the console.
- Realm
Id string The realm in which the ldap user federation provider exists.
- ldap
Password booleanPolicy Hints Enabled - ldap
User stringFederation Id The ldap user federation provider to attach this mapper to.
- name string
Display name of the mapper when displayed in the console.
- realm
Id string The realm in which the ldap user federation provider exists.
- ldap_
password_ boolpolicy_ hints_ enabled - ldap_
user_ strfederation_ id The ldap user federation provider to attach this mapper to.
- name str
Display name of the mapper when displayed in the console.
- realm_
id str The realm in which the ldap user federation provider exists.
Package Details
- Repository
- https://github.com/pulumi/pulumi-keycloak
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
keycloakTerraform Provider.