@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
173 lines (172 loc) • 6.27 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages a single permission item for a datasource. Conflicts with the "grafana.enterprise.DataSourcePermission" resource which manages the entire set of permissions for a datasource.
*
* ## 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 foo = new grafana.oss.DataSource("foo", {
* type: "cloudwatch",
* name: "cw-example",
* jsonDataEncoded: JSON.stringify({
* defaultRegion: "us-east-1",
* authType: "keys",
* }),
* secureJsonDataEncoded: JSON.stringify({
* accessKey: "123",
* secretKey: "456",
* }),
* });
* const user = new grafana.oss.User("user", {
* name: "test-ds-permissions",
* email: "test-ds-permissions@example.com",
* login: "test-ds-permissions",
* password: "hunter2",
* });
* const sa = new grafana.oss.ServiceAccount("sa", {
* name: "test-ds-permissions",
* role: "Viewer",
* });
* const teamDataSourcePermissionItem = new grafana.enterprise.DataSourcePermissionItem("team", {
* datasourceUid: foo.uid,
* team: team.id,
* permission: "Edit",
* });
* const userDataSourcePermissionItem = new grafana.enterprise.DataSourcePermissionItem("user", {
* datasourceUid: foo.uid,
* user: user.id,
* permission: "Edit",
* });
* const role = new grafana.enterprise.DataSourcePermissionItem("role", {
* datasourceUid: foo.uid,
* role: "Viewer",
* permission: "Query",
* });
* const serviceAccount = new grafana.enterprise.DataSourcePermissionItem("service_account", {
* datasourceUid: foo.uid,
* user: sa.id,
* permission: "Query",
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import grafana:enterprise/dataSourcePermissionItem:DataSourcePermissionItem name "{{ datasourceUID }}:{{ type (role, team, or user) }}:{{ identifier }}"
* ```
*
* ```sh
* $ pulumi import grafana:enterprise/dataSourcePermissionItem:DataSourcePermissionItem name "{{ orgID }}:{{ datasourceUID }}:{{ type (role, team, or user) }}:{{ identifier }}"
* ```
*/
export declare class DataSourcePermissionItem extends pulumi.CustomResource {
/**
* Get an existing DataSourcePermissionItem 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?: DataSourcePermissionItemState, opts?: pulumi.CustomResourceOptions): DataSourcePermissionItem;
/**
* Returns true if the given object is an instance of DataSourcePermissionItem. 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 DataSourcePermissionItem;
/**
* The UID of the datasource.
*/
readonly datasourceUid: pulumi.Output<string>;
/**
* The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
*/
readonly orgId: pulumi.Output<string>;
/**
* the permission to be assigned
*/
readonly permission: pulumi.Output<string>;
/**
* the role onto which the permission is to be assigned
*/
readonly role: pulumi.Output<string | undefined>;
/**
* the team onto which the permission is to be assigned
*/
readonly team: pulumi.Output<string | undefined>;
/**
* the user or service account onto which the permission is to be assigned
*/
readonly user: pulumi.Output<string | undefined>;
/**
* Create a DataSourcePermissionItem 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: DataSourcePermissionItemArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DataSourcePermissionItem resources.
*/
export interface DataSourcePermissionItemState {
/**
* The UID of the datasource.
*/
datasourceUid?: pulumi.Input<string>;
/**
* The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
*/
orgId?: pulumi.Input<string>;
/**
* the permission to be assigned
*/
permission?: pulumi.Input<string>;
/**
* the role onto which the permission is to be assigned
*/
role?: pulumi.Input<string>;
/**
* the team onto which the permission is to be assigned
*/
team?: pulumi.Input<string>;
/**
* the user or service account onto which the permission is to be assigned
*/
user?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DataSourcePermissionItem resource.
*/
export interface DataSourcePermissionItemArgs {
/**
* The UID of the datasource.
*/
datasourceUid: pulumi.Input<string>;
/**
* The Organization ID. If not set, the default organization is used for basic authentication, or the one that owns your service account for token authentication.
*/
orgId?: pulumi.Input<string>;
/**
* the permission to be assigned
*/
permission: pulumi.Input<string>;
/**
* the role onto which the permission is to be assigned
*/
role?: pulumi.Input<string>;
/**
* the team onto which the permission is to be assigned
*/
team?: pulumi.Input<string>;
/**
* the user or service account onto which the permission is to be assigned
*/
user?: pulumi.Input<string>;
}