@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
109 lines • 4.59 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.Role = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* **Note:** This resource is available only with Grafana Enterprise 8.+.
*
* * [Official documentation](https://grafana.com/docs/grafana/latest/administration/roles-and-permissions/access-control/)
* * [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/access_control/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@lbrlabs/pulumi-grafana";
*
* const superUser = new grafana.Role("superUser", {
* description: "My Super User description",
* global: true,
* permissions: [
* {
* action: "org.users:add",
* scope: "users:*",
* },
* {
* action: "org.users:write",
* scope: "users:*",
* },
* {
* action: "org.users:read",
* scope: "users:*",
* },
* ],
* uid: "superuseruid",
* version: 1,
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/role:Role role_name {{uid}}
* ```
*/
class Role extends pulumi.CustomResource {
/**
* Get an existing Role 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 Role(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Role. 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'] === Role.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoIncrementVersion"] = state ? state.autoIncrementVersion : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["global"] = state ? state.global : undefined;
resourceInputs["group"] = state ? state.group : undefined;
resourceInputs["hidden"] = state ? state.hidden : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["orgId"] = state ? state.orgId : undefined;
resourceInputs["permissions"] = state ? state.permissions : undefined;
resourceInputs["uid"] = state ? state.uid : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
resourceInputs["autoIncrementVersion"] = args ? args.autoIncrementVersion : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["global"] = args ? args.global : undefined;
resourceInputs["group"] = args ? args.group : undefined;
resourceInputs["hidden"] = args ? args.hidden : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["orgId"] = args ? args.orgId : undefined;
resourceInputs["permissions"] = args ? args.permissions : undefined;
resourceInputs["uid"] = args ? args.uid : undefined;
resourceInputs["version"] = args ? args.version : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Role.__pulumiType, name, resourceInputs, opts);
}
}
exports.Role = Role;
/** @internal */
Role.__pulumiType = 'grafana:index/role:Role';
//# sourceMappingURL=role.js.map