1. Packages
  2. FusionAuth
  3. API Docs
  4. FusionAuthLambda
FusionAuth v5.1.0 published on Tuesday, Oct 22, 2024 by Theo Gravity

fusionauth.FusionAuthLambda

Explore with Pulumi AI

fusionauth logo
FusionAuth v5.1.0 published on Tuesday, Oct 22, 2024 by Theo Gravity

    # Lambda Resource

    Lambdas are user defined JavaScript functions that may be executed at runtime to perform various functions. Lambdas may be used to customize the claims returned in a JWT, reconcile a SAML v2 response or an OpenID Connect response when using these external identity providers.

    Lambdas API

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fusionauth from "pulumi-fusionauth";
    
    const preferred_Username = new fusionauth.FusionAuthLambda("preferred Username", {
        body: `// Using the user and registration parameters add additional values to the jwt object.
    function populate(jwt, user, registration) {
      jwt.preferred_username = registration.username;
    }
      
    `,
        enabled: true,
        type: "JWTPopulate",
    });
    
    import pulumi
    import theogravity_pulumi_fusionauth as fusionauth
    
    preferred__username = fusionauth.FusionAuthLambda("preferred Username",
        body="""// Using the user and registration parameters add additional values to the jwt object.
    function populate(jwt, user, registration) {
      jwt.preferred_username = registration.username;
    }
      
    """,
        enabled=True,
        type="JWTPopulate")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/theogravity/pulumi-fusionauth/sdk/go/fusionauth"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := fusionauth.NewFusionAuthLambda(ctx, "preferred Username", &fusionauth.FusionAuthLambdaArgs{
    			Body: pulumi.String(`// Using the user and registration parameters add additional values to the jwt object.
    function populate(jwt, user, registration) {
      jwt.preferred_username = registration.username;
    }
      
    `),
    			Enabled: pulumi.Bool(true),
    			Type:    pulumi.String("JWTPopulate"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Fusionauth = theogravity.Fusionauth;
    
    return await Deployment.RunAsync(() => 
    {
        var preferred_Username = new Fusionauth.FusionAuthLambda("preferred Username", new()
        {
            Body = @"// Using the user and registration parameters add additional values to the jwt object.
    function populate(jwt, user, registration) {
      jwt.preferred_username = registration.username;
    }
      
    ",
            Enabled = true,
            Type = "JWTPopulate",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.fusionauth.FusionAuthLambda;
    import com.pulumi.fusionauth.FusionAuthLambdaArgs;
    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 preferred_Username = new FusionAuthLambda("preferred Username", FusionAuthLambdaArgs.builder()
                .body("""
    // Using the user and registration parameters add additional values to the jwt object.
    function populate(jwt, user, registration) {
      jwt.preferred_username = registration.username;
    }
      
                """)
                .enabled(true)
                .type("JWTPopulate")
                .build());
    
        }
    }
    
    resources:
      preferred Username:
        type: fusionauth:FusionAuthLambda
        properties:
          body: "// Using the user and registration parameters add additional values to the jwt object.\nfunction populate(jwt, user, registration) {\n  jwt.preferred_username = registration.username;\n}\n  \n"
          enabled: true
          type: JWTPopulate
    

    Create FusionAuthLambda Resource

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

    Constructor syntax

    new FusionAuthLambda(name: string, args: FusionAuthLambdaArgs, opts?: CustomResourceOptions);
    @overload
    def FusionAuthLambda(resource_name: str,
                         args: FusionAuthLambdaArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def FusionAuthLambda(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         body: Optional[str] = None,
                         type: Optional[str] = None,
                         debug: Optional[bool] = None,
                         enabled: Optional[bool] = None,
                         engine_type: Optional[str] = None,
                         lambda_id: Optional[str] = None,
                         name: Optional[str] = None)
    func NewFusionAuthLambda(ctx *Context, name string, args FusionAuthLambdaArgs, opts ...ResourceOption) (*FusionAuthLambda, error)
    public FusionAuthLambda(string name, FusionAuthLambdaArgs args, CustomResourceOptions? opts = null)
    public FusionAuthLambda(String name, FusionAuthLambdaArgs args)
    public FusionAuthLambda(String name, FusionAuthLambdaArgs args, CustomResourceOptions options)
    
    type: fusionauth:FusionAuthLambda
    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 FusionAuthLambdaArgs
    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 FusionAuthLambdaArgs
    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 FusionAuthLambdaArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FusionAuthLambdaArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FusionAuthLambdaArgs
    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 fusionAuthLambdaResource = new Fusionauth.FusionAuthLambda("fusionAuthLambdaResource", new()
    {
        Body = "string",
        Type = "string",
        Debug = false,
        EngineType = "string",
        LambdaId = "string",
        Name = "string",
    });
    
    example, err := fusionauth.NewFusionAuthLambda(ctx, "fusionAuthLambdaResource", &fusionauth.FusionAuthLambdaArgs{
    	Body:       pulumi.String("string"),
    	Type:       pulumi.String("string"),
    	Debug:      pulumi.Bool(false),
    	EngineType: pulumi.String("string"),
    	LambdaId:   pulumi.String("string"),
    	Name:       pulumi.String("string"),
    })
    
    var fusionAuthLambdaResource = new FusionAuthLambda("fusionAuthLambdaResource", FusionAuthLambdaArgs.builder()
        .body("string")
        .type("string")
        .debug(false)
        .engineType("string")
        .lambdaId("string")
        .name("string")
        .build());
    
    fusion_auth_lambda_resource = fusionauth.FusionAuthLambda("fusionAuthLambdaResource",
        body="string",
        type="string",
        debug=False,
        engine_type="string",
        lambda_id="string",
        name="string")
    
    const fusionAuthLambdaResource = new fusionauth.FusionAuthLambda("fusionAuthLambdaResource", {
        body: "string",
        type: "string",
        debug: false,
        engineType: "string",
        lambdaId: "string",
        name: "string",
    });
    
    type: fusionauth:FusionAuthLambda
    properties:
        body: string
        debug: false
        engineType: string
        lambdaId: string
        name: string
        type: string
    

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

    Body string
    The lambda function body, a JavaScript function.
    Type string
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    Debug bool
    Whether or not debug event logging is enabled for this Lambda.
    Enabled bool
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    EngineType string
    The JavaScript execution engine for the lambda.
    LambdaId string
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    Name string
    The name of the lambda.
    Body string
    The lambda function body, a JavaScript function.
    Type string
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    Debug bool
    Whether or not debug event logging is enabled for this Lambda.
    Enabled bool
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    EngineType string
    The JavaScript execution engine for the lambda.
    LambdaId string
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    Name string
    The name of the lambda.
    body String
    The lambda function body, a JavaScript function.
    type String
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    debug Boolean
    Whether or not debug event logging is enabled for this Lambda.
    enabled Boolean
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engineType String
    The JavaScript execution engine for the lambda.
    lambdaId String
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name String
    The name of the lambda.
    body string
    The lambda function body, a JavaScript function.
    type string
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    debug boolean
    Whether or not debug event logging is enabled for this Lambda.
    enabled boolean
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engineType string
    The JavaScript execution engine for the lambda.
    lambdaId string
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name string
    The name of the lambda.
    body str
    The lambda function body, a JavaScript function.
    type str
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    debug bool
    Whether or not debug event logging is enabled for this Lambda.
    enabled bool
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engine_type str
    The JavaScript execution engine for the lambda.
    lambda_id str
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name str
    The name of the lambda.
    body String
    The lambda function body, a JavaScript function.
    type String
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    debug Boolean
    Whether or not debug event logging is enabled for this Lambda.
    enabled Boolean
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engineType String
    The JavaScript execution engine for the lambda.
    lambdaId String
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name String
    The name of the lambda.

    Outputs

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

    Get an existing FusionAuthLambda 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?: FusionAuthLambdaState, opts?: CustomResourceOptions): FusionAuthLambda
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            body: Optional[str] = None,
            debug: Optional[bool] = None,
            enabled: Optional[bool] = None,
            engine_type: Optional[str] = None,
            lambda_id: Optional[str] = None,
            name: Optional[str] = None,
            type: Optional[str] = None) -> FusionAuthLambda
    func GetFusionAuthLambda(ctx *Context, name string, id IDInput, state *FusionAuthLambdaState, opts ...ResourceOption) (*FusionAuthLambda, error)
    public static FusionAuthLambda Get(string name, Input<string> id, FusionAuthLambdaState? state, CustomResourceOptions? opts = null)
    public static FusionAuthLambda get(String name, Output<String> id, FusionAuthLambdaState 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:
    Body string
    The lambda function body, a JavaScript function.
    Debug bool
    Whether or not debug event logging is enabled for this Lambda.
    Enabled bool
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    EngineType string
    The JavaScript execution engine for the lambda.
    LambdaId string
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    Name string
    The name of the lambda.
    Type string
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    Body string
    The lambda function body, a JavaScript function.
    Debug bool
    Whether or not debug event logging is enabled for this Lambda.
    Enabled bool
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    EngineType string
    The JavaScript execution engine for the lambda.
    LambdaId string
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    Name string
    The name of the lambda.
    Type string
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    body String
    The lambda function body, a JavaScript function.
    debug Boolean
    Whether or not debug event logging is enabled for this Lambda.
    enabled Boolean
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engineType String
    The JavaScript execution engine for the lambda.
    lambdaId String
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name String
    The name of the lambda.
    type String
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    body string
    The lambda function body, a JavaScript function.
    debug boolean
    Whether or not debug event logging is enabled for this Lambda.
    enabled boolean
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engineType string
    The JavaScript execution engine for the lambda.
    lambdaId string
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name string
    The name of the lambda.
    type string
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    body str
    The lambda function body, a JavaScript function.
    debug bool
    Whether or not debug event logging is enabled for this Lambda.
    enabled bool
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engine_type str
    The JavaScript execution engine for the lambda.
    lambda_id str
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name str
    The name of the lambda.
    type str
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate
    body String
    The lambda function body, a JavaScript function.
    debug Boolean
    Whether or not debug event logging is enabled for this Lambda.
    enabled Boolean
    Whether or not this Lambda is enabled.

    Deprecated: Not currently used and may be removed in a future version.

    engineType String
    The JavaScript execution engine for the lambda.
    lambdaId String
    The Id to use for the new lambda. If not specified a secure random UUID will be generated.
    name String
    The name of the lambda.
    type String
    The lambda type. The possible values are:

    • JWTPopulate
    • OpenIDReconcile
    • SAMLv2Reconcile
    • SAMLv2Populate
    • AppleReconcile
    • ExternalJWTReconcile
    • FacebookReconcile
    • GoogleReconcile
    • HYPRReconcile
    • TwitterReconcile
    • LDAPConnectorReconcile
    • LinkedInReconcile
    • EpicGamesReconcile
    • NintendoReconcile
    • SonyPSNReconcile
    • SteamReconcile
    • TwitchReconcile
    • XboxReconcile
    • SelfServiceRegistrationValidation
    • ClientCredentialsJWTPopulate

    Package Details

    Repository
    fusionauth theogravity/pulumi-fusionauth
    License
    MIT
    Notes
    This Pulumi package is based on the fusionauth Terraform Provider.
    fusionauth logo
    FusionAuth v5.1.0 published on Tuesday, Oct 22, 2024 by Theo Gravity