pulumi-fusionauth
Version:
A Pulumi package for managing FusionAuth instances.
86 lines • 4.58 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.FusionAuthEntity = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## # Entity Resource
*
* Entities are arbitrary objects which can be modeled in FusionAuth. Anything which is not a user but might need
* permissions managed by FusionAuth is a possible entity. Examples might include devices, cars, computers, customers,
* companies, etc.
*
* FusionAuth’s Entity Management has the following major concepts:
*
* * Entity Types categorize Entities. An Entity Type could be `Device`, `API` or `Company`.
* * Permissions are defined on an Entity Type. These are arbitrary strings which can fit the business domain. A Permission
* could be `read`, `write`, or `file-lawsuit`.
* * Entities are instances of a single type. An Entity could be a `nest device`, an `Email API` or `Raviga`.
* * Entities can have Grants. Grants are relationships between a target Entity and one of two other types: a recipient
* Entity or a User. Grants can have zero or more Permissions associated with them.
*
* You can use the Client Credentials grant to see if an Entity has permission to access another Entity.
*
* [Entity API](https://fusionauth.io/docs/v1/tech/apis/entity-management/entities)
*/
class FusionAuthEntity extends pulumi.CustomResource {
/**
* Get an existing FusionAuthEntity 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 FusionAuthEntity(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FusionAuthEntity. 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'] === FusionAuthEntity.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clientId"] = state ? state.clientId : undefined;
resourceInputs["clientSecret"] = state ? state.clientSecret : undefined;
resourceInputs["data"] = state ? state.data : undefined;
resourceInputs["entityId"] = state ? state.entityId : undefined;
resourceInputs["entityTypeId"] = state ? state.entityTypeId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.entityTypeId === undefined) && !opts.urn) {
throw new Error("Missing required property 'entityTypeId'");
}
resourceInputs["clientId"] = args ? args.clientId : undefined;
resourceInputs["clientSecret"] = (args === null || args === void 0 ? void 0 : args.clientSecret) ? pulumi.secret(args.clientSecret) : undefined;
resourceInputs["data"] = args ? args.data : undefined;
resourceInputs["entityId"] = args ? args.entityId : undefined;
resourceInputs["entityTypeId"] = args ? args.entityTypeId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["clientSecret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(FusionAuthEntity.__pulumiType, name, resourceInputs, opts);
}
}
exports.FusionAuthEntity = FusionAuthEntity;
/** @internal */
FusionAuthEntity.__pulumiType = 'fusionauth:index/fusionAuthEntity:FusionAuthEntity';
//# sourceMappingURL=fusionAuthEntity.js.map