1. Packages
  2. Keycloak
  3. API Docs
  4. RequiredAction
Keycloak v5.3.2 published on Friday, May 10, 2024 by Pulumi

keycloak.RequiredAction

Explore with Pulumi AI

keycloak logo
Keycloak v5.3.2 published on Friday, May 10, 2024 by Pulumi

    Allows for creating and managing required actions within Keycloak.

    Required actions specify actions required before the first login of all new users.

    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 requiredAction = new keycloak.RequiredAction("required_action", {
        realmId: realm.realm,
        alias: "webauthn-register",
        enabled: true,
        name: "Webauthn Register",
    });
    
    import pulumi
    import pulumi_keycloak as keycloak
    
    realm = keycloak.Realm("realm",
        realm="my-realm",
        enabled=True)
    required_action = keycloak.RequiredAction("required_action",
        realm_id=realm.realm,
        alias="webauthn-register",
        enabled=True,
        name="Webauthn Register")
    
    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.NewRequiredAction(ctx, "required_action", &keycloak.RequiredActionArgs{
    			RealmId: realm.Realm,
    			Alias:   pulumi.String("webauthn-register"),
    			Enabled: pulumi.Bool(true),
    			Name:    pulumi.String("Webauthn Register"),
    		})
    		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",
            Enabled = true,
        });
    
        var requiredAction = new Keycloak.RequiredAction("required_action", new()
        {
            RealmId = realm.RealmName,
            Alias = "webauthn-register",
            Enabled = true,
            Name = "Webauthn Register",
        });
    
    });
    
    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.RequiredAction;
    import com.pulumi.keycloak.RequiredActionArgs;
    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 requiredAction = new RequiredAction("requiredAction", RequiredActionArgs.builder()        
                .realmId(realm.realm())
                .alias("webauthn-register")
                .enabled(true)
                .name("Webauthn Register")
                .build());
    
        }
    }
    
    resources:
      realm:
        type: keycloak:Realm
        properties:
          realm: my-realm
          enabled: true
      requiredAction:
        type: keycloak:RequiredAction
        name: required_action
        properties:
          realmId: ${realm.realm}
          alias: webauthn-register
          enabled: true
          name: Webauthn Register
    

    Create RequiredAction Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RequiredAction(name: string, args: RequiredActionArgs, opts?: CustomResourceOptions);
    @overload
    def RequiredAction(resource_name: str,
                       args: RequiredActionArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def RequiredAction(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       alias: Optional[str] = None,
                       realm_id: Optional[str] = None,
                       default_action: Optional[bool] = None,
                       enabled: Optional[bool] = None,
                       name: Optional[str] = None,
                       priority: Optional[int] = None)
    func NewRequiredAction(ctx *Context, name string, args RequiredActionArgs, opts ...ResourceOption) (*RequiredAction, error)
    public RequiredAction(string name, RequiredActionArgs args, CustomResourceOptions? opts = null)
    public RequiredAction(String name, RequiredActionArgs args)
    public RequiredAction(String name, RequiredActionArgs args, CustomResourceOptions options)
    
    type: keycloak:RequiredAction
    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 RequiredActionArgs
    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 RequiredActionArgs
    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 RequiredActionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RequiredActionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RequiredActionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var requiredActionResource = new Keycloak.RequiredAction("requiredActionResource", new()
    {
        Alias = "string",
        RealmId = "string",
        DefaultAction = false,
        Enabled = false,
        Name = "string",
        Priority = 0,
    });
    
    example, err := keycloak.NewRequiredAction(ctx, "requiredActionResource", &keycloak.RequiredActionArgs{
    	Alias:         pulumi.String("string"),
    	RealmId:       pulumi.String("string"),
    	DefaultAction: pulumi.Bool(false),
    	Enabled:       pulumi.Bool(false),
    	Name:          pulumi.String("string"),
    	Priority:      pulumi.Int(0),
    })
    
    var requiredActionResource = new RequiredAction("requiredActionResource", RequiredActionArgs.builder()        
        .alias("string")
        .realmId("string")
        .defaultAction(false)
        .enabled(false)
        .name("string")
        .priority(0)
        .build());
    
    required_action_resource = keycloak.RequiredAction("requiredActionResource",
        alias="string",
        realm_id="string",
        default_action=False,
        enabled=False,
        name="string",
        priority=0)
    
    const requiredActionResource = new keycloak.RequiredAction("requiredActionResource", {
        alias: "string",
        realmId: "string",
        defaultAction: false,
        enabled: false,
        name: "string",
        priority: 0,
    });
    
    type: keycloak:RequiredAction
    properties:
        alias: string
        defaultAction: false
        enabled: false
        name: string
        priority: 0
        realmId: string
    

    RequiredAction Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The RequiredAction resource accepts the following input properties:

    Alias string
    The alias of the action to attach as a required action.
    RealmId string
    The realm the required action exists in.
    DefaultAction bool
    When true, the required action is set as the default action for new users. Defaults to false.
    Enabled bool
    When false, the required action is not enabled for new users. Defaults to false.
    Name string
    The name of the required action.
    Priority int
    The priority of the required action.
    Alias string
    The alias of the action to attach as a required action.
    RealmId string
    The realm the required action exists in.
    DefaultAction bool
    When true, the required action is set as the default action for new users. Defaults to false.
    Enabled bool
    When false, the required action is not enabled for new users. Defaults to false.
    Name string
    The name of the required action.
    Priority int
    The priority of the required action.
    alias String
    The alias of the action to attach as a required action.
    realmId String
    The realm the required action exists in.
    defaultAction Boolean
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled Boolean
    When false, the required action is not enabled for new users. Defaults to false.
    name String
    The name of the required action.
    priority Integer
    The priority of the required action.
    alias string
    The alias of the action to attach as a required action.
    realmId string
    The realm the required action exists in.
    defaultAction boolean
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled boolean
    When false, the required action is not enabled for new users. Defaults to false.
    name string
    The name of the required action.
    priority number
    The priority of the required action.
    alias str
    The alias of the action to attach as a required action.
    realm_id str
    The realm the required action exists in.
    default_action bool
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled bool
    When false, the required action is not enabled for new users. Defaults to false.
    name str
    The name of the required action.
    priority int
    The priority of the required action.
    alias String
    The alias of the action to attach as a required action.
    realmId String
    The realm the required action exists in.
    defaultAction Boolean
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled Boolean
    When false, the required action is not enabled for new users. Defaults to false.
    name String
    The name of the required action.
    priority Number
    The priority of the required action.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RequiredAction 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 RequiredAction Resource

    Get an existing RequiredAction 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?: RequiredActionState, opts?: CustomResourceOptions): RequiredAction
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alias: Optional[str] = None,
            default_action: Optional[bool] = None,
            enabled: Optional[bool] = None,
            name: Optional[str] = None,
            priority: Optional[int] = None,
            realm_id: Optional[str] = None) -> RequiredAction
    func GetRequiredAction(ctx *Context, name string, id IDInput, state *RequiredActionState, opts ...ResourceOption) (*RequiredAction, error)
    public static RequiredAction Get(string name, Input<string> id, RequiredActionState? state, CustomResourceOptions? opts = null)
    public static RequiredAction get(String name, Output<String> id, RequiredActionState 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.
    The following state arguments are supported:
    Alias string
    The alias of the action to attach as a required action.
    DefaultAction bool
    When true, the required action is set as the default action for new users. Defaults to false.
    Enabled bool
    When false, the required action is not enabled for new users. Defaults to false.
    Name string
    The name of the required action.
    Priority int
    The priority of the required action.
    RealmId string
    The realm the required action exists in.
    Alias string
    The alias of the action to attach as a required action.
    DefaultAction bool
    When true, the required action is set as the default action for new users. Defaults to false.
    Enabled bool
    When false, the required action is not enabled for new users. Defaults to false.
    Name string
    The name of the required action.
    Priority int
    The priority of the required action.
    RealmId string
    The realm the required action exists in.
    alias String
    The alias of the action to attach as a required action.
    defaultAction Boolean
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled Boolean
    When false, the required action is not enabled for new users. Defaults to false.
    name String
    The name of the required action.
    priority Integer
    The priority of the required action.
    realmId String
    The realm the required action exists in.
    alias string
    The alias of the action to attach as a required action.
    defaultAction boolean
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled boolean
    When false, the required action is not enabled for new users. Defaults to false.
    name string
    The name of the required action.
    priority number
    The priority of the required action.
    realmId string
    The realm the required action exists in.
    alias str
    The alias of the action to attach as a required action.
    default_action bool
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled bool
    When false, the required action is not enabled for new users. Defaults to false.
    name str
    The name of the required action.
    priority int
    The priority of the required action.
    realm_id str
    The realm the required action exists in.
    alias String
    The alias of the action to attach as a required action.
    defaultAction Boolean
    When true, the required action is set as the default action for new users. Defaults to false.
    enabled Boolean
    When false, the required action is not enabled for new users. Defaults to false.
    name String
    The name of the required action.
    priority Number
    The priority of the required action.
    realmId String
    The realm the required action exists in.

    Import

    Authentication executions can be imported using the formats: {{realm}}/{{alias}}.

    Example:

    bash

    $ pulumi import keycloak:index/requiredAction:RequiredAction required_action my-realm/my-default-action-alias
    

    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.
    keycloak logo
    Keycloak v5.3.2 published on Friday, May 10, 2024 by Pulumi