UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

160 lines 7.25 kB
"use strict"; // *** 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.User = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a Linode User. * For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-user). * * ## Example Usage * * Create an unrestricted user: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const john = new linode.User("john", { * username: "john123", * email: "john@acme.io", * }); * ``` * * Create a restricted user with grants: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const fooser = new linode.User("fooser", { * username: "cooluser123", * email: "cool@acme.io", * restricted: true, * globalGrants: { * addLinodes: true, * addImages: true, * }, * linodeGrants: [{ * id: 12345, * permissions: "read_write", * }], * }); * ``` * * ## Global Grants * * * `accountAccess` - (optional) The level of access this User has to Account-level actions, like billing information. (`readOnly`, `readWrite`) * * * `addDomains` - (optional) If true, this User may add Domains. * * * `addDatabases` - (optional) If true, this User may add Databases. * * * `addFirewalls` - (optional) If true, this User may add Firewalls. * * * `addImages` - (optional) If true, this User may add Images. * * * `addLinodes` - (optional) If true, this User may create Linodes. * * * `addLongview` - (optional) If true, this User may create Longview clients and view the current plan. * * * `addNodebalancers` - (optional) If true, this User may add NodeBalancers. * * * `addPlacementGroups` - (optional) If true, this User may add Placement Groups. * * * `addStackscripts` - (optional) If true, this User may add StackScripts. * * * `addVpcs` - (optional) If true, this User may add Virtual Private Clouds (VPCs). * * * `cancelAccount` - (optional) If true, this User may cancel the entire Account. * * * `longviewSubscription` - (optional) If true, this User may manage the Account’s Longview subscription. * * ## Entity Grants * * * `id` - (required) The ID of the entity this grant applies to. * * * `permissions` - (required) The level of access this User has to this entity. (`readOnly`, `readWrite`) */ class User extends pulumi.CustomResource { /** * Get an existing User 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 User(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of User. 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'] === User.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["domainGrants"] = state ? state.domainGrants : undefined; resourceInputs["email"] = state ? state.email : undefined; resourceInputs["firewallGrants"] = state ? state.firewallGrants : undefined; resourceInputs["globalGrants"] = state ? state.globalGrants : undefined; resourceInputs["imageGrants"] = state ? state.imageGrants : undefined; resourceInputs["linodeGrants"] = state ? state.linodeGrants : undefined; resourceInputs["longviewGrants"] = state ? state.longviewGrants : undefined; resourceInputs["nodebalancerGrants"] = state ? state.nodebalancerGrants : undefined; resourceInputs["placementGroupGrants"] = state ? state.placementGroupGrants : undefined; resourceInputs["restricted"] = state ? state.restricted : undefined; resourceInputs["sshKeys"] = state ? state.sshKeys : undefined; resourceInputs["stackscriptGrants"] = state ? state.stackscriptGrants : undefined; resourceInputs["tfaEnabled"] = state ? state.tfaEnabled : undefined; resourceInputs["userType"] = state ? state.userType : undefined; resourceInputs["username"] = state ? state.username : undefined; resourceInputs["volumeGrants"] = state ? state.volumeGrants : undefined; resourceInputs["vpcGrants"] = state ? state.vpcGrants : undefined; } else { const args = argsOrState; if ((!args || args.email === undefined) && !opts.urn) { throw new Error("Missing required property 'email'"); } if ((!args || args.username === undefined) && !opts.urn) { throw new Error("Missing required property 'username'"); } resourceInputs["domainGrants"] = args ? args.domainGrants : undefined; resourceInputs["email"] = args ? args.email : undefined; resourceInputs["firewallGrants"] = args ? args.firewallGrants : undefined; resourceInputs["globalGrants"] = args ? args.globalGrants : undefined; resourceInputs["imageGrants"] = args ? args.imageGrants : undefined; resourceInputs["linodeGrants"] = args ? args.linodeGrants : undefined; resourceInputs["longviewGrants"] = args ? args.longviewGrants : undefined; resourceInputs["nodebalancerGrants"] = args ? args.nodebalancerGrants : undefined; resourceInputs["placementGroupGrants"] = args ? args.placementGroupGrants : undefined; resourceInputs["restricted"] = args ? args.restricted : undefined; resourceInputs["stackscriptGrants"] = args ? args.stackscriptGrants : undefined; resourceInputs["username"] = args ? args.username : undefined; resourceInputs["volumeGrants"] = args ? args.volumeGrants : undefined; resourceInputs["vpcGrants"] = args ? args.vpcGrants : undefined; resourceInputs["sshKeys"] = undefined /*out*/; resourceInputs["tfaEnabled"] = undefined /*out*/; resourceInputs["userType"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(User.__pulumiType, name, resourceInputs, opts); } } exports.User = User; /** @internal */ User.__pulumiType = 'linode:index/user:User'; //# sourceMappingURL=user.js.map