Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getRealm

This data source can be used to fetch properties of a Keycloak realm for usage with other resources.

Example Usage

using Pulumi;
using Keycloak = Pulumi.Keycloak;

class MyStack : Stack
{
    public MyStack()
    {
        var realm = Output.Create(Keycloak.GetRealm.InvokeAsync(new Keycloak.GetRealmArgs
        {
            Realm = "my-realm",
        }));
        var @group = new Keycloak.Role("group", new Keycloak.RoleArgs
        {
            RealmId = realm.Apply(realm => realm.Id),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-keycloak/sdk/v3/go/keycloak"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        realm, err := keycloak.LookupRealm(ctx, &keycloak.LookupRealmArgs{
            Realm: "my-realm",
        }, nil)
        if err != nil {
            return err
        }
        _, err = keycloak.NewRole(ctx, "group", &keycloak.RoleArgs{
            RealmId: pulumi.String(realm.Id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_keycloak as keycloak

realm = keycloak.get_realm(realm="my-realm")
group = keycloak.Role("group", realm_id=realm.id)
import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";

const realm = keycloak.getRealm({
    realm: "my-realm",
});
const group = new keycloak.Role("group", {realmId: realm.then(realm => realm.id)});

Using getRealm

function getRealm(args: GetRealmArgs, opts?: InvokeOptions): Promise<GetRealmResult>
def get_realm(attributes: Optional[Mapping[str, Any]] = None, default_default_client_scopes: Optional[Sequence[str]] = None, default_optional_client_scopes: Optional[Sequence[str]] = None, display_name_html: Optional[str] = None, internationalizations: Optional[Sequence[GetRealmInternationalizationArgs]] = None, realm: Optional[str] = None, security_defenses: Optional[Sequence[GetRealmSecurityDefenseArgs]] = None, smtp_servers: Optional[Sequence[GetRealmSmtpServerArgs]] = None, web_authn_passwordless_policy: Optional[GetRealmWebAuthnPasswordlessPolicyArgs] = None, web_authn_policy: Optional[GetRealmWebAuthnPolicyArgs] = None, opts: Optional[InvokeOptions] = None) -> GetRealmResult
func LookupRealm(ctx *Context, args *LookupRealmArgs, opts ...InvokeOption) (*LookupRealmResult, error)

Note: This function is named LookupRealm in the Go SDK.

public static class GetRealm {
    public static Task<GetRealmResult> InvokeAsync(GetRealmArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

getRealm Result

The following output properties are available:

AccessCodeLifespan string
AccessCodeLifespanLogin string
AccessCodeLifespanUserAction string
AccessTokenLifespan string
AccessTokenLifespanForImplicitFlow string
AccountTheme string
ActionTokenGeneratedByAdminLifespan string
ActionTokenGeneratedByUserLifespan string
AdminTheme string
Attributes Dictionary<string, object>
BrowserFlow string
ClientAuthenticationFlow string
DefaultDefaultClientScopes List<string>
DefaultOptionalClientScopes List<string>
DefaultSignatureAlgorithm string
DirectGrantFlow string
DisplayName string
DockerAuthenticationFlow string
DuplicateEmailsAllowed bool
EditUsernameAllowed bool
EmailTheme string
Enabled bool
Id string

The provider-assigned unique ID for this managed resource.

InternalId string
Internationalizations List<GetRealmInternationalization>
LoginTheme string
LoginWithEmailAllowed bool
OfflineSessionIdleTimeout string
OfflineSessionMaxLifespan string
OfflineSessionMaxLifespanEnabled bool
PasswordPolicy string
Realm string
RefreshTokenMaxReuse int
RegistrationAllowed bool
RegistrationEmailAsUsername bool
RegistrationFlow string
RememberMe bool
ResetCredentialsFlow string
ResetPasswordAllowed bool
RevokeRefreshToken bool
SecurityDefenses List<GetRealmSecurityDefense>
SmtpServers List<GetRealmSmtpServer>
SslRequired string
SsoSessionIdleTimeout string
SsoSessionIdleTimeoutRememberMe string
SsoSessionMaxLifespan string
SsoSessionMaxLifespanRememberMe string
UserManagedAccess bool
VerifyEmail bool
WebAuthnPasswordlessPolicy GetRealmWebAuthnPasswordlessPolicy
WebAuthnPolicy GetRealmWebAuthnPolicy
DisplayNameHtml string
AccessCodeLifespan string
AccessCodeLifespanLogin string
AccessCodeLifespanUserAction string
AccessTokenLifespan string
AccessTokenLifespanForImplicitFlow string
AccountTheme string
ActionTokenGeneratedByAdminLifespan string
ActionTokenGeneratedByUserLifespan string
AdminTheme string
Attributes map[string]interface{}
BrowserFlow string
ClientAuthenticationFlow string
DefaultDefaultClientScopes []string
DefaultOptionalClientScopes []string
DefaultSignatureAlgorithm string
DirectGrantFlow string
DisplayName string
DockerAuthenticationFlow string
DuplicateEmailsAllowed bool
EditUsernameAllowed bool
EmailTheme string
Enabled bool
Id string

The provider-assigned unique ID for this managed resource.

InternalId string
Internationalizations []GetRealmInternationalization
LoginTheme string
LoginWithEmailAllowed bool
OfflineSessionIdleTimeout string
OfflineSessionMaxLifespan string
OfflineSessionMaxLifespanEnabled bool
PasswordPolicy string
Realm string
RefreshTokenMaxReuse int
RegistrationAllowed bool
RegistrationEmailAsUsername bool
RegistrationFlow string
RememberMe bool
ResetCredentialsFlow string
ResetPasswordAllowed bool
RevokeRefreshToken bool
SecurityDefenses []GetRealmSecurityDefense
SmtpServers []GetRealmSmtpServer
SslRequired string
SsoSessionIdleTimeout string
SsoSessionIdleTimeoutRememberMe string
SsoSessionMaxLifespan string
SsoSessionMaxLifespanRememberMe string
UserManagedAccess bool
VerifyEmail bool
WebAuthnPasswordlessPolicy GetRealmWebAuthnPasswordlessPolicy
WebAuthnPolicy GetRealmWebAuthnPolicy
DisplayNameHtml string
accessCodeLifespan string
accessCodeLifespanLogin string
accessCodeLifespanUserAction string
accessTokenLifespan string
accessTokenLifespanForImplicitFlow string
accountTheme string
actionTokenGeneratedByAdminLifespan string
actionTokenGeneratedByUserLifespan string
adminTheme string
attributes {[key: string]: any}
browserFlow string
clientAuthenticationFlow string
defaultDefaultClientScopes string[]
defaultOptionalClientScopes string[]
defaultSignatureAlgorithm string
directGrantFlow string
displayName string
dockerAuthenticationFlow string
duplicateEmailsAllowed boolean
editUsernameAllowed boolean
emailTheme string
enabled boolean
id string

The provider-assigned unique ID for this managed resource.

internalId string
internationalizations GetRealmInternationalization[]
loginTheme string
loginWithEmailAllowed boolean
offlineSessionIdleTimeout string
offlineSessionMaxLifespan string
offlineSessionMaxLifespanEnabled boolean
passwordPolicy string
realm string
refreshTokenMaxReuse number
registrationAllowed boolean
registrationEmailAsUsername boolean
registrationFlow string
rememberMe boolean
resetCredentialsFlow string
resetPasswordAllowed boolean
revokeRefreshToken boolean
securityDefenses GetRealmSecurityDefense[]
smtpServers GetRealmSmtpServer[]
sslRequired string
ssoSessionIdleTimeout string
ssoSessionIdleTimeoutRememberMe string
ssoSessionMaxLifespan string
ssoSessionMaxLifespanRememberMe string
userManagedAccess boolean
verifyEmail boolean
webAuthnPasswordlessPolicy GetRealmWebAuthnPasswordlessPolicy
webAuthnPolicy GetRealmWebAuthnPolicy
displayNameHtml string
access_code_lifespan str
access_code_lifespan_login str
access_code_lifespan_user_action str
access_token_lifespan str
access_token_lifespan_for_implicit_flow str
account_theme str
action_token_generated_by_admin_lifespan str
action_token_generated_by_user_lifespan str
admin_theme str
attributes Mapping[str, Any]
browser_flow str
client_authentication_flow str
default_default_client_scopes Sequence[str]
default_optional_client_scopes Sequence[str]
default_signature_algorithm str
direct_grant_flow str
display_name str
docker_authentication_flow str
duplicate_emails_allowed bool
edit_username_allowed bool
email_theme str
enabled bool
id str

The provider-assigned unique ID for this managed resource.

internal_id str
internationalizations Sequence[GetRealmInternationalization]
login_theme str
login_with_email_allowed bool
offline_session_idle_timeout str
offline_session_max_lifespan str
offline_session_max_lifespan_enabled bool
password_policy str
realm str
refresh_token_max_reuse int
registration_allowed bool
registration_email_as_username bool
registration_flow str
remember_me bool
reset_credentials_flow str
reset_password_allowed bool
revoke_refresh_token bool
security_defenses Sequence[GetRealmSecurityDefense]
smtp_servers Sequence[GetRealmSmtpServer]
ssl_required str
sso_session_idle_timeout str
sso_session_idle_timeout_remember_me str
sso_session_max_lifespan str
sso_session_max_lifespan_remember_me str
user_managed_access bool
verify_email bool
web_authn_passwordless_policy GetRealmWebAuthnPasswordlessPolicy
web_authn_policy GetRealmWebAuthnPolicy
display_name_html str

Supporting Types

GetRealmInternationalization

DefaultLocale string
SupportedLocales List<string>

GetRealmSecurityDefense

GetRealmSecurityDefenseBruteForceDetection

GetRealmSecurityDefenseHeader

GetRealmSmtpServer

GetRealmSmtpServerAuth

Password string
Username string
Password string
Username string
password string
username string

GetRealmWebAuthnPasswordlessPolicy

GetRealmWebAuthnPolicy

Package Details

Repository
https://github.com/pulumi/pulumi-keycloak
License
Apache-2.0
Notes
This Pulumi package is based on the keycloak Terraform Provider.