@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
150 lines (149 loc) • 5.48 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages the entire set of assignments for a role. Assignments that aren't specified when applying this resource will be removed.
* **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 "@pulumiverse/grafana";
*
* const testRole = new grafana.enterprise.Role("test_role", {
* name: "Test Role",
* uid: "testrole",
* version: 1,
* global: true,
* permissions: [{
* action: "org.users:add",
* scope: "users:*",
* }],
* });
* const testTeam = new grafana.oss.Team("test_team", {name: "terraform_test_team"});
* const testUser = new grafana.oss.User("test_user", {
* email: "terraform_user@test.com",
* login: "terraform_user@test.com",
* password: "password",
* });
* const testSa = new grafana.oss.ServiceAccount("test_sa", {
* name: "terraform_test_sa",
* role: "Viewer",
* });
* const test = new grafana.enterprise.RoleAssignment("test", {
* roleUid: testRole.uid,
* users: [testUser.id],
* teams: [testTeam.id],
* serviceAccounts: [testSa.id],
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:index/roleAssignment:RoleAssignment name "{{ roleUID }}"
* ```
*
* ```sh
* $ pulumi import grafana:index/roleAssignment:RoleAssignment name "{{ orgID }}:{{ roleUID }}"
* ```
*
* @deprecated grafana.index/roleassignment.RoleAssignment has been deprecated in favor of grafana.enterprise/roleassignment.RoleAssignment
*/
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.
*/
/** @deprecated grafana.index/roleassignment.RoleAssignment has been deprecated in favor of grafana.enterprise/roleassignment.RoleAssignment */
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>[]>;
}