UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

137 lines (136 loc) 6.19 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Retrieves information about multiple databricks.User resources. * * > This data source works with both the account-level and workspace-level provider. * * ## Example Usage * * Adding a subset of users to a group * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const companyUsers = await databricks.getUsers({ * filter: "userName co \"@domain.org\"", * }); * const dataUsersGroup = new databricks.Group("data_users_group", {displayName: "Data Users"}); * const addUsersToGroup: databricks.GroupMember[] = []; * for (const range of Object.entries(.reduce((__obj, user) => ({ ...__obj, [user.id]: user }))).map(([k, v]) => ({key: k, value: v}))) { * addUsersToGroup.push(new databricks.GroupMember(`add_users_to_group-${range.key}`, { * groupId: dataUsersGroup.id, * memberId: range.value.id, * })); * } * } * ``` * * ## Related Resources * * The following resources are used in the same context: * * - **databricks_user**: Resource to manage individual users in Databricks. * - **databricks_group**: Resource to manage groups in Databricks. * - **databricks_group_member**: Resource to manage group memberships by adding users to groups. * - **databricks_permissions**: Resource to manage access control in the Databricks workspace. * - **databricks_current_user**: Data source to retrieve information about the user or service principal that is calling the Databricks REST API. */ export declare function getUsers(args?: GetUsersArgs, opts?: pulumi.InvokeOptions): Promise<GetUsersResult>; /** * A collection of arguments for invoking getUsers. */ export interface GetUsersArgs { /** * A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: `id`, `userName`, `displayName`, and `externalId`. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the [API reference](https://docs.databricks.com/api/workspace/users/list). */ extraAttributes?: string; /** * Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (`eq`), contains (`co`), starts with (`sw`), and not equals (`ne`). Additionally, simple expressions can be formed using logical operators `and` and `or`. * * **Examples:** * - User whose `displayName` equals "john": */ filter?: string; /** * A list of users matching the specified criteria. Each user has the following attributes: */ users?: inputs.GetUsersUser[]; } /** * A collection of values returned by getUsers. */ export interface GetUsersResult { readonly extraAttributes?: string; readonly filter?: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * A list of users matching the specified criteria. Each user has the following attributes: */ readonly users: outputs.GetUsersUser[]; } /** * Retrieves information about multiple databricks.User resources. * * > This data source works with both the account-level and workspace-level provider. * * ## Example Usage * * Adding a subset of users to a group * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const companyUsers = await databricks.getUsers({ * filter: "userName co \"@domain.org\"", * }); * const dataUsersGroup = new databricks.Group("data_users_group", {displayName: "Data Users"}); * const addUsersToGroup: databricks.GroupMember[] = []; * for (const range of Object.entries(.reduce((__obj, user) => ({ ...__obj, [user.id]: user }))).map(([k, v]) => ({key: k, value: v}))) { * addUsersToGroup.push(new databricks.GroupMember(`add_users_to_group-${range.key}`, { * groupId: dataUsersGroup.id, * memberId: range.value.id, * })); * } * } * ``` * * ## Related Resources * * The following resources are used in the same context: * * - **databricks_user**: Resource to manage individual users in Databricks. * - **databricks_group**: Resource to manage groups in Databricks. * - **databricks_group_member**: Resource to manage group memberships by adding users to groups. * - **databricks_permissions**: Resource to manage access control in the Databricks workspace. * - **databricks_current_user**: Data source to retrieve information about the user or service principal that is calling the Databricks REST API. */ export declare function getUsersOutput(args?: GetUsersOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetUsersResult>; /** * A collection of arguments for invoking getUsers. */ export interface GetUsersOutputArgs { /** * A comma-separated list of additional user attributes to include in the results. By default, the data source returns the following attributes: `id`, `userName`, `displayName`, and `externalId`. Use this argument to request additional attributes as needed. The list of all available attributes can be found in the [API reference](https://docs.databricks.com/api/workspace/users/list). */ extraAttributes?: pulumi.Input<string>; /** * Query by which the results have to be filtered. If not specified, all users will be returned. Supported operators are equals (`eq`), contains (`co`), starts with (`sw`), and not equals (`ne`). Additionally, simple expressions can be formed using logical operators `and` and `or`. * * **Examples:** * - User whose `displayName` equals "john": */ filter?: pulumi.Input<string>; /** * A list of users matching the specified criteria. Each user has the following attributes: */ users?: pulumi.Input<pulumi.Input<inputs.GetUsersUserArgs>[]>; }