@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
141 lines • 6.62 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Group = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to manage both [account groups and workspace-local groups](https://docs.databricks.com/administration-guide/users-groups/groups.html). You can use the databricks.GroupMember resource to assign Databricks users, service principals as well as other groups as members of the group. This is useful if you are using an application to sync users & groups with SCIM API.
*
* > To assign an account level group to a workspace use databricks_mws_permission_assignment.
*
* > Entitlements, like, `allowClusterCreate`, `allowInstancePoolCreate`, `databricksSqlAccess`, `workspaceAccess` applicable only for workspace-level groups. Use databricks.Entitlements resource to assign entitlements inside a workspace to account-level groups.
*
* To create account groups in the Databricks account, the provider must be configured accordingly. On AWS deployment with `host = "https://accounts.cloud.databricks.com"` and `accountId = "00000000-0000-0000-0000-000000000000"`. On Azure deployments `host = "https://accounts.azuredatabricks.net"`, `accountId = "00000000-0000-0000-0000-000000000000"` and using AAD tokens as authentication.
*
* Recommended to use along with Identity Provider SCIM provisioning to populate users into those groups:
*
* * [Azure Active Directory](https://docs.microsoft.com/en-us/azure/databricks/administration-guide/users-groups/scim/aad)
* * [Okta](https://docs.databricks.com/administration-guide/users-groups/scim/okta.html)
* * [OneLogin](https://docs.databricks.com/administration-guide/users-groups/scim/onelogin.html)
*
* ## Example Usage
*
* Creating some group
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.Group("this", {
* displayName: "Some Group",
* allowClusterCreate: true,
* allowInstancePoolCreate: true,
* });
* ```
*
* Adding databricks.User as databricks.GroupMember of some group
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.Group("this", {
* displayName: "Some Group",
* allowClusterCreate: true,
* allowInstancePoolCreate: true,
* });
* const thisUser = new databricks.User("this", {userName: "someone@example.com"});
* const vipMember = new databricks.GroupMember("vip_member", {
* groupId: _this.id,
* memberId: thisUser.id,
* });
* ```
*
* Creating group in AWS Databricks account:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.Group("this", {displayName: "Some Group"});
* ```
*
* Creating group in Azure Databricks account:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.Group("this", {displayName: "Some Group"});
* ```
*
* ## Import
*
* You can import a `databricks_group` resource with the name `my_group` like the following:
*
* bash
*
* ```sh
* $ pulumi import databricks:index/group:Group my_group <group_id>
* ```
*/
class Group extends pulumi.CustomResource {
/**
* Get an existing Group 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, id, state, opts) {
return new Group(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Group. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Group.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["aclPrincipalId"] = state ? state.aclPrincipalId : undefined;
resourceInputs["allowClusterCreate"] = state ? state.allowClusterCreate : undefined;
resourceInputs["allowInstancePoolCreate"] = state ? state.allowInstancePoolCreate : undefined;
resourceInputs["databricksSqlAccess"] = state ? state.databricksSqlAccess : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["externalId"] = state ? state.externalId : undefined;
resourceInputs["force"] = state ? state.force : undefined;
resourceInputs["url"] = state ? state.url : undefined;
resourceInputs["workspaceAccess"] = state ? state.workspaceAccess : undefined;
}
else {
const args = argsOrState;
resourceInputs["aclPrincipalId"] = args ? args.aclPrincipalId : undefined;
resourceInputs["allowClusterCreate"] = args ? args.allowClusterCreate : undefined;
resourceInputs["allowInstancePoolCreate"] = args ? args.allowInstancePoolCreate : undefined;
resourceInputs["databricksSqlAccess"] = args ? args.databricksSqlAccess : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["externalId"] = args ? args.externalId : undefined;
resourceInputs["force"] = args ? args.force : undefined;
resourceInputs["url"] = args ? args.url : undefined;
resourceInputs["workspaceAccess"] = args ? args.workspaceAccess : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Group.__pulumiType, name, resourceInputs, opts);
}
}
exports.Group = Group;
/** @internal */
Group.__pulumiType = 'databricks:index/group:Group';
//# sourceMappingURL=group.js.map
;