@pulumiverse/cockroach
Version:
A Pulumi package to create and managed Cockroach DB resources in Pulumi programs.
76 lines • 3.13 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.UserRoleGrant = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ## Import
*
* Cluster and folder level role grants can be imported using:
*
* <user_id>,<role_name>,<resource_type>,<resource_id>
*
* ```sh
* $ pulumi import cockroach:index/userRoleGrant:UserRoleGrant admin_grant 1f69fdd2-600a-4cfc-a9ba-16995df0d77d,CLUSTER_ADMIN,CLUSTER,9b9d23fe-3848-40b2-a3c5-d8ccb1c4f831
* ```
*
* Organization level grants can omit the resource_id
*
* ```sh
* $ pulumi import cockroach:index/userRoleGrant:UserRoleGrant org_level_grant 1f69fdd2-600a-4cfc-a9ba-16995df0d77d,ORG_ADMIN,ORGANIZATION
* ```
*/
class UserRoleGrant extends pulumi.CustomResource {
/**
* Get an existing UserRoleGrant 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 UserRoleGrant(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of UserRoleGrant. 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'] === UserRoleGrant.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["role"] = state ? state.role : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.role === undefined) && !opts.urn) {
throw new Error("Missing required property 'role'");
}
if ((!args || args.userId === undefined) && !opts.urn) {
throw new Error("Missing required property 'userId'");
}
resourceInputs["role"] = args ? args.role : undefined;
resourceInputs["userId"] = args ? args.userId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UserRoleGrant.__pulumiType, name, resourceInputs, opts);
}
}
exports.UserRoleGrant = UserRoleGrant;
/** @internal */
UserRoleGrant.__pulumiType = 'cockroach:index/userRoleGrant:UserRoleGrant';
//# sourceMappingURL=userRoleGrant.js.map