FusionAuth

Community
Package contributed by a community member
v0.9.7 published on Thursday, Jul 28, 2022 by Theo Gravity

FusionAuthLambda

# 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

using Pulumi;
using Fusionauth = theogravity.Fusionauth;

class MyStack : Stack
{
    public MyStack()
    {
        var preferred_Username = new Fusionauth.FusionAuthLambda("preferred Username", new Fusionauth.FusionAuthLambdaArgs
        {
            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 (
	"fmt"

	"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(fmt.Sprintf("%v%v%v%v%v", "// Using the user and registration parameters add additional values to the jwt object.\n", "function populate(jwt, user, registration) {\n", "  jwt.preferred_username = registration.username;\n", "}\n", "  \n")),
			Enabled: pulumi.Bool(true),
			Type:    pulumi.String("JWTPopulate"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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());

    }
}
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")
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",
});
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 a FusionAuthLambda Resource

new FusionAuthLambda(name: string, args: FusionAuthLambdaArgs, opts?: CustomResourceOptions);
@overload
def FusionAuthLambda(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     body: Optional[str] = None,
                     debug: Optional[bool] = None,
                     enabled: Optional[bool] = None,
                     engine_type: Optional[str] = None,
                     name: Optional[str] = None,
                     type: Optional[str] = None)
@overload
def FusionAuthLambda(resource_name: str,
                     args: FusionAuthLambdaArgs,
                     opts: Optional[ResourceOptions] = 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.

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.

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

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
  • 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.

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
  • 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.

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
  • 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.

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
  • 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.

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
  • 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.

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
  • 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.

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 an 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,
        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.

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
  • 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.

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
  • 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.

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
  • 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.

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
  • 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.

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
  • 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.

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
  • ClientCredentialsJWTPopulate

Package Details

Repository
https://github.com/theogravity/pulumi-fusionauth
License
MIT
Notes

This Pulumi package is based on the fusionauth Terraform Provider.