pulumi-fusionauth
Version:
A Pulumi package for managing FusionAuth instances.
92 lines • 4.21 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.FusionAuthLambda = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## # 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](https://fusionauth.io/docs/v1/tech/apis/lambdas)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fusionauth from "pulumi-fusionauth";
*
* const preferredUsername = new fusionauth.FusionAuthLambda("preferredUsername", {
* 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",
* });
* ```
*/
class FusionAuthLambda extends pulumi.CustomResource {
/**
* Get an existing FusionAuthLambda resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new FusionAuthLambda(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FusionAuthLambda. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === FusionAuthLambda.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["body"] = state ? state.body : undefined;
resourceInputs["debug"] = state ? state.debug : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["engineType"] = state ? state.engineType : undefined;
resourceInputs["lambdaId"] = state ? state.lambdaId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["type"] = state ? state.type : undefined;
}
else {
const args = argsOrState;
if ((!args || args.body === undefined) && !opts.urn) {
throw new Error("Missing required property 'body'");
}
if ((!args || args.type === undefined) && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["body"] = args ? args.body : undefined;
resourceInputs["debug"] = args ? args.debug : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["engineType"] = args ? args.engineType : undefined;
resourceInputs["lambdaId"] = args ? args.lambdaId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["type"] = args ? args.type : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(FusionAuthLambda.__pulumiType, name, resourceInputs, opts);
}
}
exports.FusionAuthLambda = FusionAuthLambda;
/** @internal */
FusionAuthLambda.__pulumiType = 'fusionauth:index/fusionAuthLambda:FusionAuthLambda';
//# sourceMappingURL=fusionAuthLambda.js.map