UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

96 lines 4.5 kB
"use strict"; // *** 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.RestrictWorkspaceAdminsSetting = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * > This resource can only be used with a workspace-level provider! * * The `databricks.RestrictWorkspaceAdminsSetting` resource lets you control the capabilities of workspace admins. * * With the status set to `ALLOW_ALL`, workspace admins can: * * 1. Create service principal personal access tokens on behalf of any service principal in their workspace. * 2. Change a job owner to any user in the workspace. * 3. Change the job runAs setting to any user in their workspace or a service principal on which they have the Service Principal User role. * * With the status set to `RESTRICT_TOKENS_AND_JOB_RUN_AS`, workspace admins can: * * 1. Only create personal access tokens on behalf of service principals on which they have the Service Principal User role. * 2. Only change a job owner to themselves. * 3. Only change the job runAs setting to themselves a service principal on which they have the Service Principal User role. * * > Only account admins can update the setting. And the account admin must be part of the workspace to change the setting status. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const _this = new databricks.RestrictWorkspaceAdminsSetting("this", {restrictWorkspaceAdmins: { * status: "RESTRICT_TOKENS_AND_JOB_RUN_AS", * }}); * ``` * * ## Import * * This resource can be imported by predefined name `global`: * * bash * * ```sh * $ pulumi import databricks:index/restrictWorkspaceAdminsSetting:RestrictWorkspaceAdminsSetting this global * ``` */ class RestrictWorkspaceAdminsSetting extends pulumi.CustomResource { /** * Get an existing RestrictWorkspaceAdminsSetting 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 RestrictWorkspaceAdminsSetting(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RestrictWorkspaceAdminsSetting. 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'] === RestrictWorkspaceAdminsSetting.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["etag"] = state ? state.etag : undefined; resourceInputs["restrictWorkspaceAdmins"] = state ? state.restrictWorkspaceAdmins : undefined; resourceInputs["settingName"] = state ? state.settingName : undefined; } else { const args = argsOrState; if ((!args || args.restrictWorkspaceAdmins === undefined) && !opts.urn) { throw new Error("Missing required property 'restrictWorkspaceAdmins'"); } resourceInputs["etag"] = args ? args.etag : undefined; resourceInputs["restrictWorkspaceAdmins"] = args ? args.restrictWorkspaceAdmins : undefined; resourceInputs["settingName"] = args ? args.settingName : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RestrictWorkspaceAdminsSetting.__pulumiType, name, resourceInputs, opts); } } exports.RestrictWorkspaceAdminsSetting = RestrictWorkspaceAdminsSetting; /** @internal */ RestrictWorkspaceAdminsSetting.__pulumiType = 'databricks:index/restrictWorkspaceAdminsSetting:RestrictWorkspaceAdminsSetting'; //# sourceMappingURL=restrictWorkspaceAdminsSetting.js.map