RealmEvents

class RealmEvents : KotlinCustomResource

Allows for managing Realm Events settings within Keycloak.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";
const realm = new keycloak.Realm("realm", {
realm: "my-realm",
enabled: true,
});
const realmEvents = new keycloak.RealmEvents("realm_events", {
realmId: realm.id,
eventsEnabled: true,
eventsExpiration: 3600,
adminEventsEnabled: true,
adminEventsDetailsEnabled: true,
enabledEventTypes: [
"LOGIN",
"LOGOUT",
],
eventsListeners: ["jboss-logging"],
});
import pulumi
import pulumi_keycloak as keycloak
realm = keycloak.Realm("realm",
realm="my-realm",
enabled=True)
realm_events = keycloak.RealmEvents("realm_events",
realm_id=realm.id,
events_enabled=True,
events_expiration=3600,
admin_events_enabled=True,
admin_events_details_enabled=True,
enabled_event_types=[
"LOGIN",
"LOGOUT",
],
events_listeners=["jboss-logging"])
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 realmEvents = new Keycloak.RealmEvents("realm_events", new()
{
RealmId = realm.Id,
EventsEnabled = true,
EventsExpiration = 3600,
AdminEventsEnabled = true,
AdminEventsDetailsEnabled = true,
EnabledEventTypes = new[]
{
"LOGIN",
"LOGOUT",
},
EventsListeners = new[]
{
"jboss-logging",
},
});
});
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("my-realm"),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = keycloak.NewRealmEvents(ctx, "realm_events", &keycloak.RealmEventsArgs{
RealmId: realm.ID(),
EventsEnabled: pulumi.Bool(true),
EventsExpiration: pulumi.Int(3600),
AdminEventsEnabled: pulumi.Bool(true),
AdminEventsDetailsEnabled: pulumi.Bool(true),
EnabledEventTypes: pulumi.StringArray{
pulumi.String("LOGIN"),
pulumi.String("LOGOUT"),
},
EventsListeners: pulumi.StringArray{
pulumi.String("jboss-logging"),
},
})
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.RealmEvents;
import com.pulumi.keycloak.RealmEventsArgs;
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 realmEvents = new RealmEvents("realmEvents", RealmEventsArgs.builder()
.realmId(realm.id())
.eventsEnabled(true)
.eventsExpiration(3600)
.adminEventsEnabled(true)
.adminEventsDetailsEnabled(true)
.enabledEventTypes(
"LOGIN",
"LOGOUT")
.eventsListeners("jboss-logging")
.build());
}
}
resources:
realm:
type: keycloak:Realm
properties:
realm: my-realm
enabled: true
realmEvents:
type: keycloak:RealmEvents
name: realm_events
properties:
realmId: ${realm.id}
eventsEnabled: true
eventsExpiration: 3600
adminEventsEnabled: true
adminEventsDetailsEnabled: true # When omitted or left empty, keycloak will enable all event types
enabledEventTypes:
- LOGIN
- LOGOUT
eventsListeners:
- jboss-logging

Import

This resource currently does not support importing.

Properties

Link copied to clipboard

When true, saved admin events will included detailed information for create/update requests. Defaults to false.

Link copied to clipboard

When true, admin events are saved to the database, making them available through the admin console. Defaults to false.

Link copied to clipboard

The event types that will be saved to the database. Omitting this field enables all event types. Defaults to [] or all event types.

Link copied to clipboard
val eventsEnabled: Output<Boolean>?

When true, events from enabled_event_types are saved to the database, making them available through the admin console. Defaults to false.

Link copied to clipboard
val eventsExpiration: Output<Int>?

The amount of time in seconds events will be saved in the database. Defaults to 0 or never.

Link copied to clipboard
val eventsListeners: Output<List<String>>?

The event listeners that events should be sent to. Defaults to [] or none. Note that new realms enable the jboss-logging listener by default, and this resource will remove that unless it is specified.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val realmId: Output<String>

The name of the realm the event settings apply to.

Link copied to clipboard
val urn: Output<String>