@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
104 lines • 4.33 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUsersOutput = exports.getUsers = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* 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.
*/
function getUsers(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("databricks:index/getUsers:getUsers", {
"extraAttributes": args.extraAttributes,
"filter": args.filter,
"users": args.users,
}, opts);
}
exports.getUsers = getUsers;
/**
* 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.
*/
function getUsersOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("databricks:index/getUsers:getUsers", {
"extraAttributes": args.extraAttributes,
"filter": args.filter,
"users": args.users,
}, opts);
}
exports.getUsersOutput = getUsersOutput;
//# sourceMappingURL=getUsers.js.map