UNPKG

@lbrlabs/pulumi-grafana

Version:

A Pulumi package for creating and managing grafana.

132 lines (131 loc) 4.68 kB
import * as pulumi from "@pulumi/pulumi"; /** * **Note:** This resource is available only with Grafana Enterprise 9.2+. * * [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/access_control/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@lbrlabs/pulumi-grafana"; * * const testRole = new grafana.Role("testRole", { * uid: "testrole", * version: 1, * global: true, * permissions: [{ * action: "org.users:add", * scope: "users:*", * }], * }); * const testTeam = new grafana.Team("testTeam", {}); * const testUser = new grafana.User("testUser", { * email: "terraform_user@test.com", * login: "terraform_user@test.com", * password: "password", * }); * const testSa = new grafana.ServiceAccount("testSa", {role: "Viewer"}); * const test = new grafana.RoleAssignment("test", { * roleUid: testRole.uid, * users: [testUser.id], * teams: [testTeam.id], * serviceAccounts: [testSa.id], * }); * ``` */ export declare class RoleAssignment extends pulumi.CustomResource { /** * Get an existing RoleAssignment 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?: RoleAssignmentState, opts?: pulumi.CustomResourceOptions): RoleAssignment; /** * Returns true if the given object is an instance of RoleAssignment. 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 RoleAssignment; /** * The Organization ID. If not set, the Org ID defined in the provider block will be used. */ readonly orgId: pulumi.Output<string | undefined>; /** * Grafana RBAC role UID. */ readonly roleUid: pulumi.Output<string>; /** * IDs of service accounts that the role should be assigned to. */ readonly serviceAccounts: pulumi.Output<string[] | undefined>; /** * IDs of teams that the role should be assigned to. */ readonly teams: pulumi.Output<string[] | undefined>; /** * IDs of users that the role should be assigned to. */ readonly users: pulumi.Output<number[] | undefined>; /** * Create a RoleAssignment 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: RoleAssignmentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RoleAssignment resources. */ export interface RoleAssignmentState { /** * The Organization ID. If not set, the Org ID defined in the provider block will be used. */ orgId?: pulumi.Input<string>; /** * Grafana RBAC role UID. */ roleUid?: pulumi.Input<string>; /** * IDs of service accounts that the role should be assigned to. */ serviceAccounts?: pulumi.Input<pulumi.Input<string>[]>; /** * IDs of teams that the role should be assigned to. */ teams?: pulumi.Input<pulumi.Input<string>[]>; /** * IDs of users that the role should be assigned to. */ users?: pulumi.Input<pulumi.Input<number>[]>; } /** * The set of arguments for constructing a RoleAssignment resource. */ export interface RoleAssignmentArgs { /** * The Organization ID. If not set, the Org ID defined in the provider block will be used. */ orgId?: pulumi.Input<string>; /** * Grafana RBAC role UID. */ roleUid: pulumi.Input<string>; /** * IDs of service accounts that the role should be assigned to. */ serviceAccounts?: pulumi.Input<pulumi.Input<string>[]>; /** * IDs of teams that the role should be assigned to. */ teams?: pulumi.Input<pulumi.Input<string>[]>; /** * IDs of users that the role should be assigned to. */ users?: pulumi.Input<pulumi.Input<number>[]>; }