1. Packages
  2. Authentik Provider
  3. API Docs
  4. StageRedirect
authentik 2024.12.1 published on Friday, Mar 7, 2025 by goauthentik

authentik.StageRedirect

Explore with Pulumi AI

authentik logo
authentik 2024.12.1 published on Friday, Mar 7, 2025 by goauthentik

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as authentik from "@pulumi/authentik";
    
    // Create a static redirect stage
    const static = new authentik.StageRedirect("static", {
        mode: "static",
        targetStatic: "https://goauthentik.io",
    });
    // Create a flow redirect stage
    const default-authorization-flow = authentik.getFlow({
        slug: "default-provider-authorization-implicit-consent",
    });
    const flow = new authentik.StageRedirect("flow", {
        mode: "flow",
        targetFlow: default_authorization_flow.then(default_authorization_flow => default_authorization_flow.id),
    });
    
    import pulumi
    import pulumi_authentik as authentik
    
    # Create a static redirect stage
    static = authentik.StageRedirect("static",
        mode="static",
        target_static="https://goauthentik.io")
    # Create a flow redirect stage
    default_authorization_flow = authentik.get_flow(slug="default-provider-authorization-implicit-consent")
    flow = authentik.StageRedirect("flow",
        mode="flow",
        target_flow=default_authorization_flow.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/authentik/v2024/authentik"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a static redirect stage
    		_, err := authentik.NewStageRedirect(ctx, "static", &authentik.StageRedirectArgs{
    			Mode:         pulumi.String("static"),
    			TargetStatic: pulumi.String("https://goauthentik.io"),
    		})
    		if err != nil {
    			return err
    		}
    		default_authorization_flow, err := authentik.LookupFlow(ctx, &authentik.LookupFlowArgs{
    			Slug: pulumi.StringRef("default-provider-authorization-implicit-consent"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = authentik.NewStageRedirect(ctx, "flow", &authentik.StageRedirectArgs{
    			Mode:       pulumi.String("flow"),
    			TargetFlow: pulumi.String(default_authorization_flow.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Authentik = Pulumi.Authentik;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a static redirect stage
        var @static = new Authentik.StageRedirect("static", new()
        {
            Mode = "static",
            TargetStatic = "https://goauthentik.io",
        });
    
        // Create a flow redirect stage
        var default_authorization_flow = Authentik.GetFlow.Invoke(new()
        {
            Slug = "default-provider-authorization-implicit-consent",
        });
    
        var flow = new Authentik.StageRedirect("flow", new()
        {
            Mode = "flow",
            TargetFlow = default_authorization_flow.Apply(default_authorization_flow => default_authorization_flow.Apply(getFlowResult => getFlowResult.Id)),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.authentik.StageRedirect;
    import com.pulumi.authentik.StageRedirectArgs;
    import com.pulumi.authentik.AuthentikFunctions;
    import com.pulumi.authentik.inputs.GetFlowArgs;
    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) {
            // Create a static redirect stage
            var static_ = new StageRedirect("static", StageRedirectArgs.builder()
                .mode("static")
                .targetStatic("https://goauthentik.io")
                .build());
    
            // Create a flow redirect stage
            final var default-authorization-flow = AuthentikFunctions.getFlow(GetFlowArgs.builder()
                .slug("default-provider-authorization-implicit-consent")
                .build());
    
            var flow = new StageRedirect("flow", StageRedirectArgs.builder()
                .mode("flow")
                .targetFlow(default_authorization_flow.id())
                .build());
    
        }
    }
    
    resources:
      # Create a static redirect stage
      static: # Create a flow redirect stage
        type: authentik:StageRedirect
        properties:
          mode: static
          targetStatic: https://goauthentik.io
      flow:
        type: authentik:StageRedirect
        properties:
          mode: flow
          targetFlow: ${["default-authorization-flow"].id}
    variables:
      default-authorization-flow:
        fn::invoke:
          function: authentik:getFlow
          arguments:
            slug: default-provider-authorization-implicit-consent
    

    Create StageRedirect Resource

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

    Constructor syntax

    new StageRedirect(name: string, args?: StageRedirectArgs, opts?: CustomResourceOptions);
    @overload
    def StageRedirect(resource_name: str,
                      args: Optional[StageRedirectArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def StageRedirect(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      keep_context: Optional[bool] = None,
                      mode: Optional[str] = None,
                      name: Optional[str] = None,
                      stage_redirect_id: Optional[str] = None,
                      target_flow: Optional[str] = None,
                      target_static: Optional[str] = None)
    func NewStageRedirect(ctx *Context, name string, args *StageRedirectArgs, opts ...ResourceOption) (*StageRedirect, error)
    public StageRedirect(string name, StageRedirectArgs? args = null, CustomResourceOptions? opts = null)
    public StageRedirect(String name, StageRedirectArgs args)
    public StageRedirect(String name, StageRedirectArgs args, CustomResourceOptions options)
    
    type: authentik:StageRedirect
    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 StageRedirectArgs
    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 StageRedirectArgs
    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 StageRedirectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args StageRedirectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args StageRedirectArgs
    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 stageRedirectResource = new Authentik.StageRedirect("stageRedirectResource", new()
    {
        KeepContext = false,
        Mode = "string",
        Name = "string",
        StageRedirectId = "string",
        TargetFlow = "string",
        TargetStatic = "string",
    });
    
    example, err := authentik.NewStageRedirect(ctx, "stageRedirectResource", &authentik.StageRedirectArgs{
    	KeepContext:     pulumi.Bool(false),
    	Mode:            pulumi.String("string"),
    	Name:            pulumi.String("string"),
    	StageRedirectId: pulumi.String("string"),
    	TargetFlow:      pulumi.String("string"),
    	TargetStatic:    pulumi.String("string"),
    })
    
    var stageRedirectResource = new StageRedirect("stageRedirectResource", StageRedirectArgs.builder()
        .keepContext(false)
        .mode("string")
        .name("string")
        .stageRedirectId("string")
        .targetFlow("string")
        .targetStatic("string")
        .build());
    
    stage_redirect_resource = authentik.StageRedirect("stageRedirectResource",
        keep_context=False,
        mode="string",
        name="string",
        stage_redirect_id="string",
        target_flow="string",
        target_static="string")
    
    const stageRedirectResource = new authentik.StageRedirect("stageRedirectResource", {
        keepContext: false,
        mode: "string",
        name: "string",
        stageRedirectId: "string",
        targetFlow: "string",
        targetStatic: "string",
    });
    
    type: authentik:StageRedirect
    properties:
        keepContext: false
        mode: string
        name: string
        stageRedirectId: string
        targetFlow: string
        targetStatic: string
    

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

    KeepContext bool
    Defaults to true.
    Mode string
    Allowed values: - static - flow Defaults to flow.
    Name string
    StageRedirectId string
    TargetFlow string
    TargetStatic string
    KeepContext bool
    Defaults to true.
    Mode string
    Allowed values: - static - flow Defaults to flow.
    Name string
    StageRedirectId string
    TargetFlow string
    TargetStatic string
    keepContext Boolean
    Defaults to true.
    mode String
    Allowed values: - static - flow Defaults to flow.
    name String
    stageRedirectId String
    targetFlow String
    targetStatic String
    keepContext boolean
    Defaults to true.
    mode string
    Allowed values: - static - flow Defaults to flow.
    name string
    stageRedirectId string
    targetFlow string
    targetStatic string
    keep_context bool
    Defaults to true.
    mode str
    Allowed values: - static - flow Defaults to flow.
    name str
    stage_redirect_id str
    target_flow str
    target_static str
    keepContext Boolean
    Defaults to true.
    mode String
    Allowed values: - static - flow Defaults to flow.
    name String
    stageRedirectId String
    targetFlow String
    targetStatic String

    Outputs

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

    Get an existing StageRedirect 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?: StageRedirectState, opts?: CustomResourceOptions): StageRedirect
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            keep_context: Optional[bool] = None,
            mode: Optional[str] = None,
            name: Optional[str] = None,
            stage_redirect_id: Optional[str] = None,
            target_flow: Optional[str] = None,
            target_static: Optional[str] = None) -> StageRedirect
    func GetStageRedirect(ctx *Context, name string, id IDInput, state *StageRedirectState, opts ...ResourceOption) (*StageRedirect, error)
    public static StageRedirect Get(string name, Input<string> id, StageRedirectState? state, CustomResourceOptions? opts = null)
    public static StageRedirect get(String name, Output<String> id, StageRedirectState state, CustomResourceOptions options)
    resources:  _:    type: authentik:StageRedirect    get:      id: ${id}
    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:
    KeepContext bool
    Defaults to true.
    Mode string
    Allowed values: - static - flow Defaults to flow.
    Name string
    StageRedirectId string
    TargetFlow string
    TargetStatic string
    KeepContext bool
    Defaults to true.
    Mode string
    Allowed values: - static - flow Defaults to flow.
    Name string
    StageRedirectId string
    TargetFlow string
    TargetStatic string
    keepContext Boolean
    Defaults to true.
    mode String
    Allowed values: - static - flow Defaults to flow.
    name String
    stageRedirectId String
    targetFlow String
    targetStatic String
    keepContext boolean
    Defaults to true.
    mode string
    Allowed values: - static - flow Defaults to flow.
    name string
    stageRedirectId string
    targetFlow string
    targetStatic string
    keep_context bool
    Defaults to true.
    mode str
    Allowed values: - static - flow Defaults to flow.
    name str
    stage_redirect_id str
    target_flow str
    target_static str
    keepContext Boolean
    Defaults to true.
    mode String
    Allowed values: - static - flow Defaults to flow.
    name String
    stageRedirectId String
    targetFlow String
    targetStatic String

    Package Details

    Repository
    authentik goauthentik/terraform-provider-authentik
    License
    Notes
    This Pulumi package is based on the authentik Terraform Provider.
    authentik logo
    authentik 2024.12.1 published on Friday, Mar 7, 2025 by goauthentik