UNPKG

@lbrlabs/pulumi-grafana

Version:

A Pulumi package for creating and managing grafana.

125 lines (124 loc) 4.56 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * * [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/datasource_permissions/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@lbrlabs/pulumi-grafana"; * * const team = new grafana.Team("team", {}); * const foo = new grafana.DataSource("foo", { * type: "cloudwatch", * jsonDataEncoded: JSON.stringify({ * defaultRegion: "us-east-1", * authType: "keys", * }), * secureJsonDataEncoded: JSON.stringify({ * accessKey: "123", * secretKey: "456", * }), * }); * const user = new grafana.User("user", { * email: "test-ds-permissions@example.com", * login: "test-ds-permissions", * password: "hunter2", * }); * const sa = new grafana.ServiceAccount("sa", {role: "Viewer"}); * const fooPermissions = new grafana.DataSourcePermission("fooPermissions", { * datasourceId: foo.id, * permissions: [ * { * teamId: team.id, * permission: "Query", * }, * { * userId: user.id, * permission: "Edit", * }, * { * builtInRole: "Viewer", * permission: "Query", * }, * { * userId: sa.id, * permission: "Query", * }, * ], * }); * ``` */ export declare class DataSourcePermission extends pulumi.CustomResource { /** * Get an existing DataSourcePermission 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?: DataSourcePermissionState, opts?: pulumi.CustomResourceOptions): DataSourcePermission; /** * Returns true if the given object is an instance of DataSourcePermission. 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 DataSourcePermission; /** * ID of the datasource to apply permissions to. */ readonly datasourceId: 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.DataSourcePermissionPermission[]>; /** * Create a DataSourcePermission 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: DataSourcePermissionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DataSourcePermission resources. */ export interface DataSourcePermissionState { /** * ID of the datasource to apply permissions to. */ datasourceId?: 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.DataSourcePermissionPermission>[]>; } /** * The set of arguments for constructing a DataSourcePermission resource. */ export interface DataSourcePermissionArgs { /** * ID of the datasource to apply permissions to. */ datasourceId: 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.DataSourcePermissionPermission>[]>; }