UNPKG

@komminarlabs/influxdb

Version:

A Pulumi package for creating and managing InfluxDB resources.

78 lines 4.08 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.Authorization = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Creates and manages an authorization and returns the authorization with the generated API token. Use this resource to create/manage an authorization, which generates an API token with permissions to read or write to a specific resource or type of resource. */ class Authorization extends pulumi.CustomResource { /** * Get an existing Authorization 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 Authorization(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Authorization. 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'] === Authorization.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["org"] = state ? state.org : undefined; resourceInputs["orgId"] = state ? state.orgId : undefined; resourceInputs["permissions"] = state ? state.permissions : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["token"] = state ? state.token : undefined; resourceInputs["updatedAt"] = state ? state.updatedAt : undefined; resourceInputs["user"] = state ? state.user : undefined; resourceInputs["userId"] = state ? state.userId : undefined; } else { const args = argsOrState; if ((!args || args.orgId === undefined) && !opts.urn) { throw new Error("Missing required property 'orgId'"); } if ((!args || args.permissions === undefined) && !opts.urn) { throw new Error("Missing required property 'permissions'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["orgId"] = args ? args.orgId : undefined; resourceInputs["permissions"] = args ? args.permissions : undefined; resourceInputs["status"] = args ? args.status : undefined; resourceInputs["user"] = args ? args.user : undefined; resourceInputs["userId"] = args ? args.userId : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["org"] = undefined /*out*/; resourceInputs["token"] = undefined /*out*/; resourceInputs["updatedAt"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["token"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Authorization.__pulumiType, name, resourceInputs, opts); } } exports.Authorization = Authorization; /** @internal */ Authorization.__pulumiType = 'influxdb:index/authorization:Authorization'; //# sourceMappingURL=authorization.js.map