RealmKeystoreJavaGeneratedArgs

data class RealmKeystoreJavaGeneratedArgs(val active: Output<Boolean>? = null, val algorithm: Output<String>? = null, val enabled: Output<Boolean>? = null, val keyAlias: Output<String>? = null, val keyPassword: Output<String>? = null, val keystore: Output<String>? = null, val keystorePassword: Output<String>? = null, val name: Output<String>? = null, val priority: Output<Int>? = null, val realmId: Output<String>? = null) : ConvertibleToJava<RealmKeystoreJavaGeneratedArgs>

Allows for creating and managing java-keystore Realm keystores within Keycloak. A realm keystore manages generated key pairs that are used by Keycloak to perform cryptographic signatures and encryption.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";
const realm = new keycloak.Realm("realm", {realm: "my-realm"});
const javaKeystore = new keycloak.RealmKeystoreJavaGenerated("java_keystore", {
name: "my-java-keystore",
realmId: realm.id,
enabled: true,
active: true,
keystore: "<path to your keystore>",
keystorePassword: "<password for keystore>",
keyAlias: "<alias for the private key>",
keyPassword: "<password for the private key>",
priority: 100,
algorithm: "RS256",
});
import pulumi
import pulumi_keycloak as keycloak
realm = keycloak.Realm("realm", realm="my-realm")
java_keystore = keycloak.RealmKeystoreJavaGenerated("java_keystore",
name="my-java-keystore",
realm_id=realm.id,
enabled=True,
active=True,
keystore="<path to your keystore>",
keystore_password="<password for keystore>",
key_alias="<alias for the private key>",
key_password="<password for the private key>",
priority=100,
algorithm="RS256")
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",
});
var javaKeystore = new Keycloak.RealmKeystoreJavaGenerated("java_keystore", new()
{
Name = "my-java-keystore",
RealmId = realm.Id,
Enabled = true,
Active = true,
Keystore = "<path to your keystore>",
KeystorePassword = "<password for keystore>",
KeyAlias = "<alias for the private key>",
KeyPassword = "<password for the private key>",
Priority = 100,
Algorithm = "RS256",
});
});
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"),
})
if err != nil {
return err
}
_, err = keycloak.NewRealmKeystoreJavaGenerated(ctx, "java_keystore", &keycloak.RealmKeystoreJavaGeneratedArgs{
Name: pulumi.String("my-java-keystore"),
RealmId: realm.ID(),
Enabled: pulumi.Bool(true),
Active: pulumi.Bool(true),
Keystore: pulumi.String("<path to your keystore>"),
KeystorePassword: pulumi.String("<password for keystore>"),
KeyAlias: pulumi.String("<alias for the private key>"),
KeyPassword: pulumi.String("<password for the private key>"),
Priority: pulumi.Int(100),
Algorithm: pulumi.String("RS256"),
})
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.RealmKeystoreJavaGenerated;
import com.pulumi.keycloak.RealmKeystoreJavaGeneratedArgs;
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")
.build());
var javaKeystore = new RealmKeystoreJavaGenerated("javaKeystore", RealmKeystoreJavaGeneratedArgs.builder()
.name("my-java-keystore")
.realmId(realm.id())
.enabled(true)
.active(true)
.keystore("<path to your keystore>")
.keystorePassword("<password for keystore>")
.keyAlias("<alias for the private key>")
.keyPassword("<password for the private key>")
.priority(100)
.algorithm("RS256")
.build());
}
}
resources:
realm:
type: keycloak:Realm
properties:
realm: my-realm
javaKeystore:
type: keycloak:RealmKeystoreJavaGenerated
name: java_keystore
properties:
name: my-java-keystore
realmId: ${realm.id}
enabled: true
active: true
keystore: <path to your keystore>
keystorePassword: <password for keystore>
keyAlias: <alias for the private key>
keyPassword: <password for the private key>
priority: 100
algorithm: RS256

Import

Realm keys can be imported using realm name and keystore id, you can find it in web UI. Example: bash

$ pulumi import keycloak:index/realmKeystoreJavaGenerated:RealmKeystoreJavaGenerated java_keystore my-realm/618cfba7-49aa-4c09-9a19-2f699b576f0b

Constructors

Link copied to clipboard
constructor(active: Output<Boolean>? = null, algorithm: Output<String>? = null, enabled: Output<Boolean>? = null, keyAlias: Output<String>? = null, keyPassword: Output<String>? = null, keystore: Output<String>? = null, keystorePassword: Output<String>? = null, name: Output<String>? = null, priority: Output<Int>? = null, realmId: Output<String>? = null)

Properties

Link copied to clipboard
val active: Output<Boolean>? = null

When false, key in not used for signing. Defaults to true.

Link copied to clipboard
val algorithm: Output<String>? = null

Intended algorithm for the key. Defaults to RS256

Link copied to clipboard
val enabled: Output<Boolean>? = null

When false, key is not accessible in this realm. Defaults to true.

Link copied to clipboard
val keyAlias: Output<String>? = null

Alias for the private key.

Link copied to clipboard
val keyPassword: Output<String>? = null

Password for the private key.

Link copied to clipboard
val keystore: Output<String>? = null

Path to keys file on keycloak instance.

Link copied to clipboard
val keystorePassword: Output<String>? = null

Password for the keys.

Link copied to clipboard
val name: Output<String>? = null

Display name of provider when linked in admin console.

Link copied to clipboard
val priority: Output<Int>? = null

Priority for the provider. Defaults to 0

Link copied to clipboard
val realmId: Output<String>? = null

The realm this keystore exists in.

Functions

Link copied to clipboard
open override fun toJava(): RealmKeystoreJavaGeneratedArgs