@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
107 lines • 4.4 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.DataSourceConfigLbacRules = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages LBAC rules for a data source.
*
* !> Warning: The resource is experimental and will be subject to change. This resource manages the entire LBAC rules tree, and will overwrite any existing rules.
*
* * [Official documentation](https://grafana.com/docs/grafana/latest/administration/data-source-management/teamlbac/)
* * [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/datasource_lbac_rules/)
*
* This resource requires Grafana >=11.5.0.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const team = new grafana.oss.Team("team", {name: "Team Name"});
* const test = new grafana.oss.DataSource("test", {
* type: "loki",
* name: "loki-from-terraform",
* url: "https://mylokiurl.net",
* basicAuthEnabled: true,
* basicAuthUsername: "username",
* jsonDataEncoded: JSON.stringify({
* authType: "default",
* basicAuthPassword: "password",
* }),
* });
* const testRule = new grafana.enterprise.DataSourceConfigLbacRules("test_rule", {
* datasourceUid: test.uid,
* rules: pulumi.jsonStringify(team.teamUid.apply(teamUid => {
* [teamUid]: [
* "{ cluster = \"dev-us-central-0\", namespace = \"hosted-grafana\" }",
* "{ foo = \"qux\" }",
* ],
* })),
* }, {
* dependsOn: [
* team,
* test,
* ],
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:enterprise/dataSourceConfigLbacRules:DataSourceConfigLbacRules name "{{ datasource_uid }}"
* ```
*/
class DataSourceConfigLbacRules extends pulumi.CustomResource {
/**
* Get an existing DataSourceConfigLbacRules 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 DataSourceConfigLbacRules(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DataSourceConfigLbacRules. 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'] === DataSourceConfigLbacRules.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["datasourceUid"] = state ? state.datasourceUid : undefined;
resourceInputs["rules"] = state ? state.rules : undefined;
}
else {
const args = argsOrState;
if ((!args || args.datasourceUid === undefined) && !opts.urn) {
throw new Error("Missing required property 'datasourceUid'");
}
if ((!args || args.rules === undefined) && !opts.urn) {
throw new Error("Missing required property 'rules'");
}
resourceInputs["datasourceUid"] = args ? args.datasourceUid : undefined;
resourceInputs["rules"] = args ? args.rules : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DataSourceConfigLbacRules.__pulumiType, name, resourceInputs, opts);
}
}
exports.DataSourceConfigLbacRules = DataSourceConfigLbacRules;
/** @internal */
DataSourceConfigLbacRules.__pulumiType = 'grafana:enterprise/dataSourceConfigLbacRules:DataSourceConfigLbacRules';
//# sourceMappingURL=dataSourceConfigLbacRules.js.map