@lbrlabs/pulumi-grafana
Version:
A Pulumi package for creating and managing grafana.
132 lines (131 loc) • 5.01 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* * [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/dashboard_permissions/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fs from "fs";
* import * as grafana from "@lbrlabs/pulumi-grafana";
*
* const team = new grafana.Team("team", {});
* const user = new grafana.User("user", {email: "user.name@example.com"});
* const metrics = new grafana.Dashboard("metrics", {configJson: fs.readFileSync("grafana-dashboard.json")});
* const collectionPermission = new grafana.DashboardPermission("collectionPermission", {
* dashboardUid: metrics.uid,
* permissions: [
* {
* role: "Editor",
* permission: "Edit",
* },
* {
* teamId: team.id,
* permission: "View",
* },
* {
* userId: user.id,
* permission: "Admin",
* },
* ],
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/dashboardPermission:DashboardPermission dashboard_name {{dashboard_uid}}
* ```
*/
export declare class DashboardPermission extends pulumi.CustomResource {
/**
* Get an existing DashboardPermission 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?: DashboardPermissionState, opts?: pulumi.CustomResourceOptions): DashboardPermission;
/**
* Returns true if the given object is an instance of DashboardPermission. 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 DashboardPermission;
/**
* ID of the dashboard to apply permissions to. Deprecated: use `dashboardUid` instead.
*
* @deprecated use `dashboard_uid` instead
*/
readonly dashboardId: pulumi.Output<number>;
/**
* UID of the dashboard to apply permissions to.
*/
readonly dashboardUid: pulumi.Output<string>;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
readonly orgId: pulumi.Output<string | undefined>;
/**
* The permission items to add/update. Items that are omitted from the list will be removed.
*/
readonly permissions: pulumi.Output<outputs.DashboardPermissionPermission[]>;
/**
* Create a DashboardPermission 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: DashboardPermissionArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DashboardPermission resources.
*/
export interface DashboardPermissionState {
/**
* ID of the dashboard to apply permissions to. Deprecated: use `dashboardUid` instead.
*
* @deprecated use `dashboard_uid` instead
*/
dashboardId?: pulumi.Input<number>;
/**
* UID of the dashboard to apply permissions to.
*/
dashboardUid?: pulumi.Input<string>;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
orgId?: pulumi.Input<string>;
/**
* The permission items to add/update. Items that are omitted from the list will be removed.
*/
permissions?: pulumi.Input<pulumi.Input<inputs.DashboardPermissionPermission>[]>;
}
/**
* The set of arguments for constructing a DashboardPermission resource.
*/
export interface DashboardPermissionArgs {
/**
* ID of the dashboard to apply permissions to. Deprecated: use `dashboardUid` instead.
*
* @deprecated use `dashboard_uid` instead
*/
dashboardId?: pulumi.Input<number>;
/**
* UID of the dashboard to apply permissions to.
*/
dashboardUid?: pulumi.Input<string>;
/**
* The Organization ID. If not set, the Org ID defined in the provider block will be used.
*/
orgId?: pulumi.Input<string>;
/**
* The permission items to add/update. Items that are omitted from the list will be removed.
*/
permissions: pulumi.Input<pulumi.Input<inputs.DashboardPermissionPermission>[]>;
}