Keycloak

v4.11.0 published on Thursday, Aug 4, 2022 by Pulumi

ExecutionConfig

Allows for managing an authentication execution’s configuration. If a particular authentication execution supports additional configuration (such as with the identity-provider-redirector execution), this can be managed with this resource.

Example Usage

using Pulumi;
using Keycloak = Pulumi.Keycloak;

class MyStack : Stack
{
    public MyStack()
    {
        var realm = new Keycloak.Realm("realm", new Keycloak.RealmArgs
        {
            RealmName = "my-realm",
            Enabled = true,
        });
        var flow = new Keycloak.Authentication.Flow("flow", new Keycloak.Authentication.FlowArgs
        {
            RealmId = realm.Id,
            Alias = "my-flow-alias",
        });
        var execution = new Keycloak.Authentication.Execution("execution", new Keycloak.Authentication.ExecutionArgs
        {
            RealmId = realm.Id,
            ParentFlowAlias = flow.Alias,
            Authenticator = "identity-provider-redirector",
        });
        var config = new Keycloak.Authentication.ExecutionConfig("config", new Keycloak.Authentication.ExecutionConfigArgs
        {
            RealmId = realm.Id,
            ExecutionId = execution.Id,
            Alias = "my-config-alias",
            Config = 
            {
                { "defaultProvider", "my-config-default-idp" },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-keycloak/sdk/v4/go/keycloak"
	"github.com/pulumi/pulumi-keycloak/sdk/v4/go/keycloak/authentication"
	"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
		}
		flow, err := authentication.NewFlow(ctx, "flow", &authentication.FlowArgs{
			RealmId: realm.ID(),
			Alias:   pulumi.String("my-flow-alias"),
		})
		if err != nil {
			return err
		}
		execution, err := authentication.NewExecution(ctx, "execution", &authentication.ExecutionArgs{
			RealmId:         realm.ID(),
			ParentFlowAlias: flow.Alias,
			Authenticator:   pulumi.String("identity-provider-redirector"),
		})
		if err != nil {
			return err
		}
		_, err = authentication.NewExecutionConfig(ctx, "config", &authentication.ExecutionConfigArgs{
			RealmId:     realm.ID(),
			ExecutionId: execution.ID(),
			Alias:       pulumi.String("my-config-alias"),
			Config: pulumi.StringMap{
				"defaultProvider": pulumi.String("my-config-default-idp"),
			},
		})
		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.authentication.Flow;
import com.pulumi.keycloak.authentication.FlowArgs;
import com.pulumi.keycloak.authentication.Execution;
import com.pulumi.keycloak.authentication.ExecutionArgs;
import com.pulumi.keycloak.authentication.ExecutionConfig;
import com.pulumi.keycloak.authentication.ExecutionConfigArgs;
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 flow = new Flow("flow", FlowArgs.builder()        
            .realmId(realm.id())
            .alias("my-flow-alias")
            .build());

        var execution = new Execution("execution", ExecutionArgs.builder()        
            .realmId(realm.id())
            .parentFlowAlias(flow.alias())
            .authenticator("identity-provider-redirector")
            .build());

        var config = new ExecutionConfig("config", ExecutionConfigArgs.builder()        
            .realmId(realm.id())
            .executionId(execution.id())
            .alias("my-config-alias")
            .config(Map.of("defaultProvider", "my-config-default-idp"))
            .build());

    }
}
import pulumi
import pulumi_keycloak as keycloak

realm = keycloak.Realm("realm",
    realm="my-realm",
    enabled=True)
flow = keycloak.authentication.Flow("flow",
    realm_id=realm.id,
    alias="my-flow-alias")
execution = keycloak.authentication.Execution("execution",
    realm_id=realm.id,
    parent_flow_alias=flow.alias,
    authenticator="identity-provider-redirector")
config = keycloak.authentication.ExecutionConfig("config",
    realm_id=realm.id,
    execution_id=execution.id,
    alias="my-config-alias",
    config={
        "defaultProvider": "my-config-default-idp",
    })
import * as pulumi from "@pulumi/pulumi";
import * as keycloak from "@pulumi/keycloak";

const realm = new keycloak.Realm("realm", {
    realm: "my-realm",
    enabled: true,
});
const flow = new keycloak.authentication.Flow("flow", {
    realmId: realm.id,
    alias: "my-flow-alias",
});
const execution = new keycloak.authentication.Execution("execution", {
    realmId: realm.id,
    parentFlowAlias: flow.alias,
    authenticator: "identity-provider-redirector",
});
const config = new keycloak.authentication.ExecutionConfig("config", {
    realmId: realm.id,
    executionId: execution.id,
    alias: "my-config-alias",
    config: {
        defaultProvider: "my-config-default-idp",
    },
});
resources:
  realm:
    type: keycloak:Realm
    properties:
      realm: my-realm
      enabled: true
  flow:
    type: keycloak:authentication:Flow
    properties:
      realmId: ${realm.id}
      alias: my-flow-alias
  execution:
    type: keycloak:authentication:Execution
    properties:
      realmId: ${realm.id}
      parentFlowAlias: ${flow.alias}
      authenticator: identity-provider-redirector
  config:
    type: keycloak:authentication:ExecutionConfig
    properties:
      realmId: ${realm.id}
      executionId: ${execution.id}
      alias: my-config-alias
      config:
        defaultProvider: my-config-default-idp

Create a ExecutionConfig Resource

new ExecutionConfig(name: string, args: ExecutionConfigArgs, opts?: CustomResourceOptions);
@overload
def ExecutionConfig(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    alias: Optional[str] = None,
                    config: Optional[Mapping[str, str]] = None,
                    execution_id: Optional[str] = None,
                    realm_id: Optional[str] = None)
@overload
def ExecutionConfig(resource_name: str,
                    args: ExecutionConfigArgs,
                    opts: Optional[ResourceOptions] = None)
func NewExecutionConfig(ctx *Context, name string, args ExecutionConfigArgs, opts ...ResourceOption) (*ExecutionConfig, error)
public ExecutionConfig(string name, ExecutionConfigArgs args, CustomResourceOptions? opts = null)
public ExecutionConfig(String name, ExecutionConfigArgs args)
public ExecutionConfig(String name, ExecutionConfigArgs args, CustomResourceOptions options)
type: keycloak:authentication:ExecutionConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ExecutionConfigArgs
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 ExecutionConfigArgs
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 ExecutionConfigArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ExecutionConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ExecutionConfigArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ExecutionConfig 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 ExecutionConfig resource accepts the following input properties:

Alias string

The name of the configuration.

Config Dictionary<string, string>

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

ExecutionId string

The authentication execution this configuration is attached to.

RealmId string

The realm the authentication execution exists in.

Alias string

The name of the configuration.

Config map[string]string

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

ExecutionId string

The authentication execution this configuration is attached to.

RealmId string

The realm the authentication execution exists in.

alias String

The name of the configuration.

config Map<String,String>

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

executionId String

The authentication execution this configuration is attached to.

realmId String

The realm the authentication execution exists in.

alias string

The name of the configuration.

config {[key: string]: string}

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

executionId string

The authentication execution this configuration is attached to.

realmId string

The realm the authentication execution exists in.

alias str

The name of the configuration.

config Mapping[str, str]

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

execution_id str

The authentication execution this configuration is attached to.

realm_id str

The realm the authentication execution exists in.

alias String

The name of the configuration.

config Map<String>

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

executionId String

The authentication execution this configuration is attached to.

realmId String

The realm the authentication execution exists in.

Outputs

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

Get an existing ExecutionConfig 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?: ExecutionConfigState, opts?: CustomResourceOptions): ExecutionConfig
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        alias: Optional[str] = None,
        config: Optional[Mapping[str, str]] = None,
        execution_id: Optional[str] = None,
        realm_id: Optional[str] = None) -> ExecutionConfig
func GetExecutionConfig(ctx *Context, name string, id IDInput, state *ExecutionConfigState, opts ...ResourceOption) (*ExecutionConfig, error)
public static ExecutionConfig Get(string name, Input<string> id, ExecutionConfigState? state, CustomResourceOptions? opts = null)
public static ExecutionConfig get(String name, Output<String> id, ExecutionConfigState 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 name of the configuration.

Config Dictionary<string, string>

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

ExecutionId string

The authentication execution this configuration is attached to.

RealmId string

The realm the authentication execution exists in.

Alias string

The name of the configuration.

Config map[string]string

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

ExecutionId string

The authentication execution this configuration is attached to.

RealmId string

The realm the authentication execution exists in.

alias String

The name of the configuration.

config Map<String,String>

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

executionId String

The authentication execution this configuration is attached to.

realmId String

The realm the authentication execution exists in.

alias string

The name of the configuration.

config {[key: string]: string}

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

executionId string

The authentication execution this configuration is attached to.

realmId string

The realm the authentication execution exists in.

alias str

The name of the configuration.

config Mapping[str, str]

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

execution_id str

The authentication execution this configuration is attached to.

realm_id str

The realm the authentication execution exists in.

alias String

The name of the configuration.

config Map<String>

The configuration. Keys are specific to each configurable authentication execution and not checked when applying.

executionId String

The authentication execution this configuration is attached to.

realmId String

The realm the authentication execution exists in.

Import

Configurations can be imported using the format {{realm}}/{{authenticationExecutionId}}/{{authenticationExecutionConfigId}}. If the authenticationExecutionId is incorrect, the import will still be successful. A subsequent apply will change the authenticationExecutionId to the correct one, which causes the configuration to be replaced. Examplebash

 $ pulumi import keycloak:authentication/executionConfig:ExecutionConfig config my-realm/be081463-ddbf-4b42-9eff-9c97886f24ff/30559fcf-6fb8-45ea-8c46-2b86f46ebc17

Package Details

Repository
https://github.com/pulumi/pulumi-keycloak
License
Apache-2.0
Notes

This Pulumi package is based on the keycloak Terraform Provider.