@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
125 lines (124 loc) • 4.79 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Manages the entire set of permissions for a dashboard. Permissions that aren't specified when applying this resource will be removed.
* * [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 grafana from "@pulumiverse/grafana";
*
* const team = new grafana.oss.Team("team", {name: "Team Name"});
* const user = new grafana.oss.User("user", {
* email: "user.name@example.com",
* password: "my-password",
* login: "user.name",
* });
* const metrics = new grafana.oss.Dashboard("metrics", {configJson: JSON.stringify({
* title: "My Dashboard",
* uid: "my-dashboard-uid",
* })});
* const collectionPermission = new grafana.oss.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:oss/dashboardPermission:DashboardPermission name "{{ dashboardUID }}"
* ```
*
* ```sh
* $ pulumi import grafana:oss/dashboardPermission:DashboardPermission name "{{ orgID }}:{{ dashboardUID }}"
* ```
*/
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;
/**
* 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.oss.DashboardPermissionPermission[] | undefined>;
/**
* 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 {
/**
* 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.oss.DashboardPermissionPermission>[]>;
}
/**
* The set of arguments for constructing a DashboardPermission resource.
*/
export interface DashboardPermissionArgs {
/**
* 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.oss.DashboardPermissionPermission>[]>;
}