keycloak.CustomUserFederation

Explore with Pulumi AI

Import

Custom user federation providers can be imported using the format {{realm_id}}/{{custom_user_federation_id}}. The ID of the custom user federation provider can be found within the Keycloak GUI and is typically a GUIDbash

 $ pulumi import keycloak:index/customUserFederation:CustomUserFederation custom_user_federation my-realm/af2a6ca3-e4d7-49c3-b08b-1b3c70b4b860

Example Usage

using System.Collections.Generic;
using Pulumi;
using Keycloak = Pulumi.Keycloak;

return await Deployment.RunAsync(() => 
{
    var realm = new Keycloak.Realm("realm", new()
    {
        RealmName = "test",
        Enabled = true,
    });

    var customUserFederation = new Keycloak.CustomUserFederation("customUserFederation", new()
    {
        RealmId = realm.Id,
        ProviderId = "custom",
        Enabled = true,
        Config = 
        {
            { "dummyString", "foobar" },
            { "dummyBool", true },
            { "multivalue", "value1##value2" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-keycloak/sdk/v5/go/keycloak"
	"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("test"),
			Enabled: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = keycloak.NewCustomUserFederation(ctx, "customUserFederation", &keycloak.CustomUserFederationArgs{
			RealmId:    realm.ID(),
			ProviderId: pulumi.String("custom"),
			Enabled:    pulumi.Bool(true),
			Config: pulumi.AnyMap{
				"dummyString": pulumi.Any("foobar"),
				"dummyBool":   pulumi.Any(true),
				"multivalue":  pulumi.Any("value1##value2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.CustomUserFederation;
import com.pulumi.keycloak.CustomUserFederationArgs;
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("test")
            .enabled(true)
            .build());

        var customUserFederation = new CustomUserFederation("customUserFederation", CustomUserFederationArgs.builder()        
            .realmId(realm.id())
            .providerId("custom")
            .enabled(true)
            .config(Map.ofEntries(
                Map.entry("dummyString", "foobar"),
                Map.entry("dummyBool", true),
                Map.entry("multivalue", "value1##value2")
            ))
            .build());

    }
}
import pulumi
import pulumi_keycloak as keycloak

realm = keycloak.Realm("realm",
    realm="test",
    enabled=True)
custom_user_federation = keycloak.CustomUserFederation("customUserFederation",
    realm_id=realm.id,
    provider_id="custom",
    enabled=True,
    config={
        "dummyString": "foobar",
        "dummyBool": True,
        "multivalue": "value1##value2",
    })
import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";

const realm = new keycloak.Realm("realm", {
    realm: "test",
    enabled: true,
});
const customUserFederation = new keycloak.CustomUserFederation("customUserFederation", {
    realmId: realm.id,
    providerId: "custom",
    enabled: true,
    config: {
        dummyString: "foobar",
        dummyBool: true,
        multivalue: "value1##value2",
    },
});
resources:
  realm:
    type: keycloak:Realm
    properties:
      realm: test
      enabled: true
  customUserFederation:
    type: keycloak:CustomUserFederation
    properties:
      realmId: ${realm.id}
      providerId: custom
      enabled: true
      config:
        dummyString: foobar
        dummyBool: true
        multivalue: value1##value2

Create CustomUserFederation Resource

new CustomUserFederation(name: string, args: CustomUserFederationArgs, opts?: CustomResourceOptions);
@overload
def CustomUserFederation(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         cache_policy: Optional[str] = None,
                         changed_sync_period: Optional[int] = None,
                         config: Optional[Mapping[str, Any]] = None,
                         enabled: Optional[bool] = None,
                         full_sync_period: Optional[int] = None,
                         name: Optional[str] = None,
                         parent_id: Optional[str] = None,
                         priority: Optional[int] = None,
                         provider_id: Optional[str] = None,
                         realm_id: Optional[str] = None)
@overload
def CustomUserFederation(resource_name: str,
                         args: CustomUserFederationArgs,
                         opts: Optional[ResourceOptions] = None)
func NewCustomUserFederation(ctx *Context, name string, args CustomUserFederationArgs, opts ...ResourceOption) (*CustomUserFederation, error)
public CustomUserFederation(string name, CustomUserFederationArgs args, CustomResourceOptions? opts = null)
public CustomUserFederation(String name, CustomUserFederationArgs args)
public CustomUserFederation(String name, CustomUserFederationArgs args, CustomResourceOptions options)
type: keycloak:CustomUserFederation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

CustomUserFederation 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 CustomUserFederation resource accepts the following input properties:

ProviderId string

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

RealmId string

The realm that this provider will provide user federation for.

CachePolicy string

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

ChangedSyncPeriod int

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

Config Dictionary<string, object>

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

Enabled bool

When false, this provider will not be used when performing queries for users. Defaults to true.

FullSyncPeriod int

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

Name string

Display name of the provider when displayed in the console.

ParentId string

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

Priority int

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

ProviderId string

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

RealmId string

The realm that this provider will provide user federation for.

CachePolicy string

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

ChangedSyncPeriod int

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

Config map[string]interface{}

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

Enabled bool

When false, this provider will not be used when performing queries for users. Defaults to true.

FullSyncPeriod int

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

Name string

Display name of the provider when displayed in the console.

ParentId string

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

Priority int

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

providerId String

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realmId String

The realm that this provider will provide user federation for.

cachePolicy String

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changedSyncPeriod Integer

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config Map<String,Object>

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled Boolean

When false, this provider will not be used when performing queries for users. Defaults to true.

fullSyncPeriod Integer

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name String

Display name of the provider when displayed in the console.

parentId String

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority Integer

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

providerId string

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realmId string

The realm that this provider will provide user federation for.

cachePolicy string

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changedSyncPeriod number

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config {[key: string]: any}

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled boolean

When false, this provider will not be used when performing queries for users. Defaults to true.

fullSyncPeriod number

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name string

Display name of the provider when displayed in the console.

parentId string

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority number

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

provider_id str

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realm_id str

The realm that this provider will provide user federation for.

cache_policy str

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changed_sync_period int

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config Mapping[str, Any]

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled bool

When false, this provider will not be used when performing queries for users. Defaults to true.

full_sync_period int

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name str

Display name of the provider when displayed in the console.

parent_id str

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority int

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

providerId String

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realmId String

The realm that this provider will provide user federation for.

cachePolicy String

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changedSyncPeriod Number

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config Map<Any>

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled Boolean

When false, this provider will not be used when performing queries for users. Defaults to true.

fullSyncPeriod Number

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name String

Display name of the provider when displayed in the console.

parentId String

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority Number

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

Outputs

All input properties are implicitly available as output properties. Additionally, the CustomUserFederation 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 CustomUserFederation Resource

Get an existing CustomUserFederation 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?: CustomUserFederationState, opts?: CustomResourceOptions): CustomUserFederation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cache_policy: Optional[str] = None,
        changed_sync_period: Optional[int] = None,
        config: Optional[Mapping[str, Any]] = None,
        enabled: Optional[bool] = None,
        full_sync_period: Optional[int] = None,
        name: Optional[str] = None,
        parent_id: Optional[str] = None,
        priority: Optional[int] = None,
        provider_id: Optional[str] = None,
        realm_id: Optional[str] = None) -> CustomUserFederation
func GetCustomUserFederation(ctx *Context, name string, id IDInput, state *CustomUserFederationState, opts ...ResourceOption) (*CustomUserFederation, error)
public static CustomUserFederation Get(string name, Input<string> id, CustomUserFederationState? state, CustomResourceOptions? opts = null)
public static CustomUserFederation get(String name, Output<String> id, CustomUserFederationState 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:
CachePolicy string

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

ChangedSyncPeriod int

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

Config Dictionary<string, object>

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

Enabled bool

When false, this provider will not be used when performing queries for users. Defaults to true.

FullSyncPeriod int

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

Name string

Display name of the provider when displayed in the console.

ParentId string

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

Priority int

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

ProviderId string

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

RealmId string

The realm that this provider will provide user federation for.

CachePolicy string

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

ChangedSyncPeriod int

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

Config map[string]interface{}

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

Enabled bool

When false, this provider will not be used when performing queries for users. Defaults to true.

FullSyncPeriod int

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

Name string

Display name of the provider when displayed in the console.

ParentId string

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

Priority int

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

ProviderId string

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

RealmId string

The realm that this provider will provide user federation for.

cachePolicy String

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changedSyncPeriod Integer

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config Map<String,Object>

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled Boolean

When false, this provider will not be used when performing queries for users. Defaults to true.

fullSyncPeriod Integer

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name String

Display name of the provider when displayed in the console.

parentId String

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority Integer

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

providerId String

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realmId String

The realm that this provider will provide user federation for.

cachePolicy string

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changedSyncPeriod number

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config {[key: string]: any}

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled boolean

When false, this provider will not be used when performing queries for users. Defaults to true.

fullSyncPeriod number

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name string

Display name of the provider when displayed in the console.

parentId string

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority number

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

providerId string

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realmId string

The realm that this provider will provide user federation for.

cache_policy str

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changed_sync_period int

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config Mapping[str, Any]

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled bool

When false, this provider will not be used when performing queries for users. Defaults to true.

full_sync_period int

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name str

Display name of the provider when displayed in the console.

parent_id str

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority int

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

provider_id str

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realm_id str

The realm that this provider will provide user federation for.

cachePolicy String

Can be one of DEFAULT, EVICT_DAILY, EVICT_WEEKLY, MAX_LIFESPAN, or NO_CACHE. Defaults to DEFAULT.

changedSyncPeriod Number

How frequently Keycloak should sync changed users, in seconds. Omit this property to disable periodic changed users sync.

config Map<Any>

The provider configuration handed over to your custom user federation provider. In order to add multivalue settings, use ## to seperate the values.

enabled Boolean

When false, this provider will not be used when performing queries for users. Defaults to true.

fullSyncPeriod Number

How frequently Keycloak should sync all users, in seconds. Omit this property to disable periodic full sync.

name String

Display name of the provider when displayed in the console.

parentId String

Must be set to the realms' internal_id when it differs from the realm. This can happen when existing resources are imported into the state.

priority Number

Priority of this provider when looking up users. Lower values are first. Defaults to 0.

providerId String

The unique ID of the custom provider, specified in the getId implementation for the UserStorageProviderFactory interface.

realmId String

The realm that this provider will provide user federation for.

Package Details

Repository
Keycloak pulumi/pulumi-keycloak
License
Apache-2.0
Notes

This Pulumi package is based on the keycloak Terraform Provider.