keycloak.RealmKeystoreJavaGenerated
Explore with Pulumi AI
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")
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
})
}
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 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
Create RealmKeystoreJavaGenerated Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RealmKeystoreJavaGenerated(name: string, args: RealmKeystoreJavaGeneratedArgs, opts?: CustomResourceOptions);
@overload
def RealmKeystoreJavaGenerated(resource_name: str,
args: RealmKeystoreJavaGeneratedArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RealmKeystoreJavaGenerated(resource_name: str,
opts: Optional[ResourceOptions] = None,
key_alias: Optional[str] = None,
key_password: Optional[str] = None,
keystore: Optional[str] = None,
keystore_password: Optional[str] = None,
realm_id: Optional[str] = None,
active: Optional[bool] = None,
algorithm: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
priority: Optional[int] = None)
func NewRealmKeystoreJavaGenerated(ctx *Context, name string, args RealmKeystoreJavaGeneratedArgs, opts ...ResourceOption) (*RealmKeystoreJavaGenerated, error)
public RealmKeystoreJavaGenerated(string name, RealmKeystoreJavaGeneratedArgs args, CustomResourceOptions? opts = null)
public RealmKeystoreJavaGenerated(String name, RealmKeystoreJavaGeneratedArgs args)
public RealmKeystoreJavaGenerated(String name, RealmKeystoreJavaGeneratedArgs args, CustomResourceOptions options)
type: keycloak:RealmKeystoreJavaGenerated
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RealmKeystoreJavaGeneratedArgs
- 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 RealmKeystoreJavaGeneratedArgs
- 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 RealmKeystoreJavaGeneratedArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RealmKeystoreJavaGeneratedArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RealmKeystoreJavaGeneratedArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var realmKeystoreJavaGeneratedResource = new Keycloak.RealmKeystoreJavaGenerated("realmKeystoreJavaGeneratedResource", new()
{
KeyAlias = "string",
KeyPassword = "string",
Keystore = "string",
KeystorePassword = "string",
RealmId = "string",
Active = false,
Algorithm = "string",
Enabled = false,
Name = "string",
Priority = 0,
});
example, err := keycloak.NewRealmKeystoreJavaGenerated(ctx, "realmKeystoreJavaGeneratedResource", &keycloak.RealmKeystoreJavaGeneratedArgs{
KeyAlias: pulumi.String("string"),
KeyPassword: pulumi.String("string"),
Keystore: pulumi.String("string"),
KeystorePassword: pulumi.String("string"),
RealmId: pulumi.String("string"),
Active: pulumi.Bool(false),
Algorithm: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Name: pulumi.String("string"),
Priority: pulumi.Int(0),
})
var realmKeystoreJavaGeneratedResource = new RealmKeystoreJavaGenerated("realmKeystoreJavaGeneratedResource", RealmKeystoreJavaGeneratedArgs.builder()
.keyAlias("string")
.keyPassword("string")
.keystore("string")
.keystorePassword("string")
.realmId("string")
.active(false)
.algorithm("string")
.enabled(false)
.name("string")
.priority(0)
.build());
realm_keystore_java_generated_resource = keycloak.RealmKeystoreJavaGenerated("realmKeystoreJavaGeneratedResource",
key_alias="string",
key_password="string",
keystore="string",
keystore_password="string",
realm_id="string",
active=False,
algorithm="string",
enabled=False,
name="string",
priority=0)
const realmKeystoreJavaGeneratedResource = new keycloak.RealmKeystoreJavaGenerated("realmKeystoreJavaGeneratedResource", {
keyAlias: "string",
keyPassword: "string",
keystore: "string",
keystorePassword: "string",
realmId: "string",
active: false,
algorithm: "string",
enabled: false,
name: "string",
priority: 0,
});
type: keycloak:RealmKeystoreJavaGenerated
properties:
active: false
algorithm: string
enabled: false
keyAlias: string
keyPassword: string
keystore: string
keystorePassword: string
name: string
priority: 0
realmId: string
RealmKeystoreJavaGenerated Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RealmKeystoreJavaGenerated resource accepts the following input properties:
- Key
Alias string - Alias for the private key.
- Key
Password string - Password for the private key.
- Keystore string
- Path to keys file on keycloak instance.
- Keystore
Password string - Password for the keys.
- Realm
Id string - The realm this keystore exists in.
- Active bool
- When
false
, key in not used for signing. Defaults totrue
. - Algorithm string
- Intended algorithm for the key. Defaults to
RS256
- Enabled bool
- When
false
, key is not accessible in this realm. Defaults totrue
. - Name string
- Display name of provider when linked in admin console.
- Priority int
- Priority for the provider. Defaults to
0
- Key
Alias string - Alias for the private key.
- Key
Password string - Password for the private key.
- Keystore string
- Path to keys file on keycloak instance.
- Keystore
Password string - Password for the keys.
- Realm
Id string - The realm this keystore exists in.
- Active bool
- When
false
, key in not used for signing. Defaults totrue
. - Algorithm string
- Intended algorithm for the key. Defaults to
RS256
- Enabled bool
- When
false
, key is not accessible in this realm. Defaults totrue
. - Name string
- Display name of provider when linked in admin console.
- Priority int
- Priority for the provider. Defaults to
0
- key
Alias String - Alias for the private key.
- key
Password String - Password for the private key.
- keystore String
- Path to keys file on keycloak instance.
- keystore
Password String - Password for the keys.
- realm
Id String - The realm this keystore exists in.
- active Boolean
- When
false
, key in not used for signing. Defaults totrue
. - algorithm String
- Intended algorithm for the key. Defaults to
RS256
- enabled Boolean
- When
false
, key is not accessible in this realm. Defaults totrue
. - name String
- Display name of provider when linked in admin console.
- priority Integer
- Priority for the provider. Defaults to
0
- key
Alias string - Alias for the private key.
- key
Password string - Password for the private key.
- keystore string
- Path to keys file on keycloak instance.
- keystore
Password string - Password for the keys.
- realm
Id string - The realm this keystore exists in.
- active boolean
- When
false
, key in not used for signing. Defaults totrue
. - algorithm string
- Intended algorithm for the key. Defaults to
RS256
- enabled boolean
- When
false
, key is not accessible in this realm. Defaults totrue
. - name string
- Display name of provider when linked in admin console.
- priority number
- Priority for the provider. Defaults to
0
- key_
alias str - Alias for the private key.
- key_
password str - Password for the private key.
- keystore str
- Path to keys file on keycloak instance.
- keystore_
password str - Password for the keys.
- realm_
id str - The realm this keystore exists in.
- active bool
- When
false
, key in not used for signing. Defaults totrue
. - algorithm str
- Intended algorithm for the key. Defaults to
RS256
- enabled bool
- When
false
, key is not accessible in this realm. Defaults totrue
. - name str
- Display name of provider when linked in admin console.
- priority int
- Priority for the provider. Defaults to
0
- key
Alias String - Alias for the private key.
- key
Password String - Password for the private key.
- keystore String
- Path to keys file on keycloak instance.
- keystore
Password String - Password for the keys.
- realm
Id String - The realm this keystore exists in.
- active Boolean
- When
false
, key in not used for signing. Defaults totrue
. - algorithm String
- Intended algorithm for the key. Defaults to
RS256
- enabled Boolean
- When
false
, key is not accessible in this realm. Defaults totrue
. - name String
- Display name of provider when linked in admin console.
- priority Number
- Priority for the provider. Defaults to
0
Outputs
All input properties are implicitly available as output properties. Additionally, the RealmKeystoreJavaGenerated 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 RealmKeystoreJavaGenerated Resource
Get an existing RealmKeystoreJavaGenerated 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?: RealmKeystoreJavaGeneratedState, opts?: CustomResourceOptions): RealmKeystoreJavaGenerated
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
active: Optional[bool] = None,
algorithm: Optional[str] = None,
enabled: Optional[bool] = None,
key_alias: Optional[str] = None,
key_password: Optional[str] = None,
keystore: Optional[str] = None,
keystore_password: Optional[str] = None,
name: Optional[str] = None,
priority: Optional[int] = None,
realm_id: Optional[str] = None) -> RealmKeystoreJavaGenerated
func GetRealmKeystoreJavaGenerated(ctx *Context, name string, id IDInput, state *RealmKeystoreJavaGeneratedState, opts ...ResourceOption) (*RealmKeystoreJavaGenerated, error)
public static RealmKeystoreJavaGenerated Get(string name, Input<string> id, RealmKeystoreJavaGeneratedState? state, CustomResourceOptions? opts = null)
public static RealmKeystoreJavaGenerated get(String name, Output<String> id, RealmKeystoreJavaGeneratedState 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.
- Active bool
- When
false
, key in not used for signing. Defaults totrue
. - Algorithm string
- Intended algorithm for the key. Defaults to
RS256
- Enabled bool
- When
false
, key is not accessible in this realm. Defaults totrue
. - Key
Alias string - Alias for the private key.
- Key
Password string - Password for the private key.
- Keystore string
- Path to keys file on keycloak instance.
- Keystore
Password string - Password for the keys.
- Name string
- Display name of provider when linked in admin console.
- Priority int
- Priority for the provider. Defaults to
0
- Realm
Id string - The realm this keystore exists in.
- Active bool
- When
false
, key in not used for signing. Defaults totrue
. - Algorithm string
- Intended algorithm for the key. Defaults to
RS256
- Enabled bool
- When
false
, key is not accessible in this realm. Defaults totrue
. - Key
Alias string - Alias for the private key.
- Key
Password string - Password for the private key.
- Keystore string
- Path to keys file on keycloak instance.
- Keystore
Password string - Password for the keys.
- Name string
- Display name of provider when linked in admin console.
- Priority int
- Priority for the provider. Defaults to
0
- Realm
Id string - The realm this keystore exists in.
- active Boolean
- When
false
, key in not used for signing. Defaults totrue
. - algorithm String
- Intended algorithm for the key. Defaults to
RS256
- enabled Boolean
- When
false
, key is not accessible in this realm. Defaults totrue
. - key
Alias String - Alias for the private key.
- key
Password String - Password for the private key.
- keystore String
- Path to keys file on keycloak instance.
- keystore
Password String - Password for the keys.
- name String
- Display name of provider when linked in admin console.
- priority Integer
- Priority for the provider. Defaults to
0
- realm
Id String - The realm this keystore exists in.
- active boolean
- When
false
, key in not used for signing. Defaults totrue
. - algorithm string
- Intended algorithm for the key. Defaults to
RS256
- enabled boolean
- When
false
, key is not accessible in this realm. Defaults totrue
. - key
Alias string - Alias for the private key.
- key
Password string - Password for the private key.
- keystore string
- Path to keys file on keycloak instance.
- keystore
Password string - Password for the keys.
- name string
- Display name of provider when linked in admin console.
- priority number
- Priority for the provider. Defaults to
0
- realm
Id string - The realm this keystore exists in.
- active bool
- When
false
, key in not used for signing. Defaults totrue
. - algorithm str
- Intended algorithm for the key. Defaults to
RS256
- enabled bool
- When
false
, key is not accessible in this realm. Defaults totrue
. - key_
alias str - Alias for the private key.
- key_
password str - Password for the private key.
- keystore str
- Path to keys file on keycloak instance.
- keystore_
password str - Password for the keys.
- name str
- Display name of provider when linked in admin console.
- priority int
- Priority for the provider. Defaults to
0
- realm_
id str - The realm this keystore exists in.
- active Boolean
- When
false
, key in not used for signing. Defaults totrue
. - algorithm String
- Intended algorithm for the key. Defaults to
RS256
- enabled Boolean
- When
false
, key is not accessible in this realm. Defaults totrue
. - key
Alias String - Alias for the private key.
- key
Password String - Password for the private key.
- keystore String
- Path to keys file on keycloak instance.
- keystore
Password String - Password for the keys.
- name String
- Display name of provider when linked in admin console.
- priority Number
- Priority for the provider. Defaults to
0
- realm
Id String - The realm this keystore exists in.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Keycloak pulumi/pulumi-keycloak
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
keycloak
Terraform Provider.