pulumi-fusionauth
Version:
A Pulumi package for managing FusionAuth instances.
98 lines • 5.14 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.FusionAuthRegistration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## # Registration Resource
*
* A registration is the association between a User and an Application that they log into.
*
* [Registrations API](https://fusionauth.io/docs/v1/tech/apis/registrations)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fusionauth from "pulumi-fusionauth";
*
* const example = new fusionauth.FusionAuthRegistration("example", {
* userId: fusionauth_user.example.id,
* applicationId: data.fusionauth_application.FusionAuth.id,
* roles: ["admin"],
* username: "theadmin",
* });
* ```
*/
class FusionAuthRegistration extends pulumi.CustomResource {
/**
* Get an existing FusionAuthRegistration 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 FusionAuthRegistration(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FusionAuthRegistration. 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'] === FusionAuthRegistration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["applicationId"] = state ? state.applicationId : undefined;
resourceInputs["authenticationToken"] = state ? state.authenticationToken : undefined;
resourceInputs["data"] = state ? state.data : undefined;
resourceInputs["generateAuthenticationToken"] = state ? state.generateAuthenticationToken : undefined;
resourceInputs["preferredLanguages"] = state ? state.preferredLanguages : undefined;
resourceInputs["registrationId"] = state ? state.registrationId : undefined;
resourceInputs["roles"] = state ? state.roles : undefined;
resourceInputs["skipRegistrationValidation"] = state ? state.skipRegistrationValidation : undefined;
resourceInputs["timezone"] = state ? state.timezone : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
resourceInputs["username"] = state ? state.username : undefined;
}
else {
const args = argsOrState;
if ((!args || args.applicationId === undefined) && !opts.urn) {
throw new Error("Missing required property 'applicationId'");
}
if ((!args || args.userId === undefined) && !opts.urn) {
throw new Error("Missing required property 'userId'");
}
resourceInputs["applicationId"] = args ? args.applicationId : undefined;
resourceInputs["authenticationToken"] = (args === null || args === void 0 ? void 0 : args.authenticationToken) ? pulumi.secret(args.authenticationToken) : undefined;
resourceInputs["data"] = args ? args.data : undefined;
resourceInputs["generateAuthenticationToken"] = args ? args.generateAuthenticationToken : undefined;
resourceInputs["preferredLanguages"] = args ? args.preferredLanguages : undefined;
resourceInputs["registrationId"] = args ? args.registrationId : undefined;
resourceInputs["roles"] = args ? args.roles : undefined;
resourceInputs["skipRegistrationValidation"] = args ? args.skipRegistrationValidation : undefined;
resourceInputs["timezone"] = args ? args.timezone : undefined;
resourceInputs["userId"] = args ? args.userId : undefined;
resourceInputs["username"] = args ? args.username : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["authenticationToken"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(FusionAuthRegistration.__pulumiType, name, resourceInputs, opts);
}
}
exports.FusionAuthRegistration = FusionAuthRegistration;
/** @internal */
FusionAuthRegistration.__pulumiType = 'fusionauth:index/fusionAuthRegistration:FusionAuthRegistration';
//# sourceMappingURL=fusionAuthRegistration.js.map