RealmKeystoreHmacGenerated

class RealmKeystoreHmacGenerated : KotlinCustomResource

Allows for creating and managing hmac-generated 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 keystoreHmacGenerated = new keycloak.RealmKeystoreHmacGenerated("keystore_hmac_generated", {
name: "my-hmac-generated-key",
realmId: realm.id,
enabled: true,
active: true,
priority: 100,
algorithm: "HS256",
secretSize: 64,
});
import pulumi
import pulumi_keycloak as keycloak
realm = keycloak.Realm("realm", realm="my-realm")
keystore_hmac_generated = keycloak.RealmKeystoreHmacGenerated("keystore_hmac_generated",
name="my-hmac-generated-key",
realm_id=realm.id,
enabled=True,
active=True,
priority=100,
algorithm="HS256",
secret_size=64)
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 keystoreHmacGenerated = new Keycloak.RealmKeystoreHmacGenerated("keystore_hmac_generated", new()
{
Name = "my-hmac-generated-key",
RealmId = realm.Id,
Enabled = true,
Active = true,
Priority = 100,
Algorithm = "HS256",
SecretSize = 64,
});
});
package main
import (
"github.com/pulumi/pulumi-keycloak/sdk/v6/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.NewRealmKeystoreHmacGenerated(ctx, "keystore_hmac_generated", &keycloak.RealmKeystoreHmacGeneratedArgs{
Name: pulumi.String("my-hmac-generated-key"),
RealmId: realm.ID(),
Enabled: pulumi.Bool(true),
Active: pulumi.Bool(true),
Priority: pulumi.Int(100),
Algorithm: pulumi.String("HS256"),
SecretSize: pulumi.Int(64),
})
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.RealmKeystoreHmacGenerated;
import com.pulumi.keycloak.RealmKeystoreHmacGeneratedArgs;
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 keystoreHmacGenerated = new RealmKeystoreHmacGenerated("keystoreHmacGenerated", RealmKeystoreHmacGeneratedArgs.builder()
.name("my-hmac-generated-key")
.realmId(realm.id())
.enabled(true)
.active(true)
.priority(100)
.algorithm("HS256")
.secretSize(64)
.build());
}
}
resources:
realm:
type: keycloak:Realm
properties:
realm: my-realm
keystoreHmacGenerated:
type: keycloak:RealmKeystoreHmacGenerated
name: keystore_hmac_generated
properties:
name: my-hmac-generated-key
realmId: ${realm.id}
enabled: true
active: true
priority: 100
algorithm: HS256
secretSize: 64

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/realmKeystoreHmacGenerated:RealmKeystoreHmacGenerated keystore_hmac_generated my-realm/618cfba7-49aa-4c09-9a19-2f699b576f0b

Properties

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

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

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

Intended algorithm for the key. Defaults to HS256

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

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

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Display name of provider when linked in admin console.

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

Priority for the provider. Defaults to 0

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 realm this keystore exists in.

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

Size in bytes for the generated secret. Defaults to 64.

Link copied to clipboard
val urn: Output<String>