UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

107 lines 4.2 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.DataSourceConfigLbacRules = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages LBAC rules for a data source. * * !> Warning: 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/developer-resources/api-reference/http-api/api-legacy/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 * terraform import grafana_data_source_config_lbac_rules.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, { ...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?.datasourceUid; resourceInputs["rules"] = state?.rules; } else { const args = argsOrState; if (args?.datasourceUid === undefined && !opts.urn) { throw new Error("Missing required property 'datasourceUid'"); } if (args?.rules === undefined && !opts.urn) { throw new Error("Missing required property 'rules'"); } resourceInputs["datasourceUid"] = args?.datasourceUid; resourceInputs["rules"] = args?.rules; } 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