@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
111 lines (110 loc) • 4.07 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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 }}"
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: DataSourceConfigLbacRulesState, opts?: pulumi.CustomResourceOptions): DataSourceConfigLbacRules;
/**
* 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: any): obj is DataSourceConfigLbacRules;
/**
* The UID of the datasource.
*/
readonly datasourceUid: pulumi.Output<string>;
/**
* JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
*/
readonly rules: pulumi.Output<string>;
/**
* Create a DataSourceConfigLbacRules resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DataSourceConfigLbacRulesArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DataSourceConfigLbacRules resources.
*/
export interface DataSourceConfigLbacRulesState {
/**
* The UID of the datasource.
*/
datasourceUid?: pulumi.Input<string>;
/**
* JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
*/
rules?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DataSourceConfigLbacRules resource.
*/
export interface DataSourceConfigLbacRulesArgs {
/**
* The UID of the datasource.
*/
datasourceUid: pulumi.Input<string>;
/**
* JSON-encoded LBAC rules for the data source. Map of team UIDs to lists of rule strings.
*/
rules: pulumi.Input<string>;
}