pulumi-fusionauth
Version:
A Pulumi package for managing FusionAuth instances.
91 lines • 4.42 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.FusionAuthApiKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## # API Key
*
* The FusionAuth APIs are primarily secured using API keys. This API can only be accessed using an API key that is set as a keyManager. In order to retrieve, update or delete an API key, an API key with equal or greater permissions must be used. A "tenant-scoped" API key can retrieve, create, update or delete an API key for the same tenant. This page describes APIs that are used to manage API keys.
*
* [API Key](https://fusionauth.io/docs/v1/tech/apis/api-keys/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fusionauth from "pulumi-fusionauth";
*
* const example = new fusionauth.FusionAuthApiKey("example", {
* description: "my super secret key",
* key: "super-secret-key",
* permissionsEndpoints: [{
* "delete": true,
* endpoint: "/api/application",
* get: true,
* patch: true,
* post: true,
* put: true,
* }],
* tenantId: "94f751c5-4883-4684-a817-6b106778edec",
* });
* ```
*/
class FusionAuthApiKey extends pulumi.CustomResource {
/**
* Get an existing FusionAuthApiKey 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 FusionAuthApiKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FusionAuthApiKey. 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'] === FusionAuthApiKey.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["expirationInstant"] = state ? state.expirationInstant : undefined;
resourceInputs["ipAccessControlListId"] = state ? state.ipAccessControlListId : undefined;
resourceInputs["key"] = state ? state.key : undefined;
resourceInputs["keyId"] = state ? state.keyId : undefined;
resourceInputs["permissionsEndpoints"] = state ? state.permissionsEndpoints : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
}
else {
const args = argsOrState;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["expirationInstant"] = args ? args.expirationInstant : undefined;
resourceInputs["ipAccessControlListId"] = args ? args.ipAccessControlListId : undefined;
resourceInputs["key"] = (args === null || args === void 0 ? void 0 : args.key) ? pulumi.secret(args.key) : undefined;
resourceInputs["keyId"] = args ? args.keyId : undefined;
resourceInputs["permissionsEndpoints"] = args ? args.permissionsEndpoints : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["key"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(FusionAuthApiKey.__pulumiType, name, resourceInputs, opts);
}
}
exports.FusionAuthApiKey = FusionAuthApiKey;
/** @internal */
FusionAuthApiKey.__pulumiType = 'fusionauth:index/fusionAuthApiKey:FusionAuthApiKey';
//# sourceMappingURL=fusionAuthApiKey.js.map