The databricks.RestrictWorkspaceAdminsSetting resource lets you control the capabilities of workspace admins.
This resource can only be used with a workspace-level provider!
With the status set to ALLOW_ALL, workspace admins can:
- Create service principal personal access tokens on behalf of any service principal in their workspace.
- Change a job owner to any user in the workspace.
- Change the job run_as 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:
- Only create personal access tokens on behalf of service principals on which they have the Service Principal User role.
- Only change a job owner to themselves.
- Only change the job run_as 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
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 pulumi
import pulumi_databricks as databricks
this = databricks.RestrictWorkspaceAdminsSetting("this", restrict_workspace_admins={
"status": "RESTRICT_TOKENS_AND_JOB_RUN_AS",
})
package main
import (
"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := databricks.NewRestrictWorkspaceAdminsSetting(ctx, "this", &databricks.RestrictWorkspaceAdminsSettingArgs{
RestrictWorkspaceAdmins: &databricks.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs{
Status: pulumi.String("RESTRICT_TOKENS_AND_JOB_RUN_AS"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var @this = new Databricks.RestrictWorkspaceAdminsSetting("this", new()
{
RestrictWorkspaceAdmins = new Databricks.Inputs.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs
{
Status = "RESTRICT_TOKENS_AND_JOB_RUN_AS",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.RestrictWorkspaceAdminsSetting;
import com.pulumi.databricks.RestrictWorkspaceAdminsSettingArgs;
import com.pulumi.databricks.inputs.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var this_ = new RestrictWorkspaceAdminsSetting("this", RestrictWorkspaceAdminsSettingArgs.builder()
.restrictWorkspaceAdmins(RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs.builder()
.status("RESTRICT_TOKENS_AND_JOB_RUN_AS")
.build())
.build());
}
}
resources:
this:
type: databricks:RestrictWorkspaceAdminsSetting
properties:
restrictWorkspaceAdmins:
status: RESTRICT_TOKENS_AND_JOB_RUN_AS
Create RestrictWorkspaceAdminsSetting Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RestrictWorkspaceAdminsSetting(name: string, args: RestrictWorkspaceAdminsSettingArgs, opts?: CustomResourceOptions);@overload
def RestrictWorkspaceAdminsSetting(resource_name: str,
args: RestrictWorkspaceAdminsSettingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RestrictWorkspaceAdminsSetting(resource_name: str,
opts: Optional[ResourceOptions] = None,
restrict_workspace_admins: Optional[RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs] = None,
etag: Optional[str] = None,
provider_config: Optional[RestrictWorkspaceAdminsSettingProviderConfigArgs] = None,
setting_name: Optional[str] = None)func NewRestrictWorkspaceAdminsSetting(ctx *Context, name string, args RestrictWorkspaceAdminsSettingArgs, opts ...ResourceOption) (*RestrictWorkspaceAdminsSetting, error)public RestrictWorkspaceAdminsSetting(string name, RestrictWorkspaceAdminsSettingArgs args, CustomResourceOptions? opts = null)
public RestrictWorkspaceAdminsSetting(String name, RestrictWorkspaceAdminsSettingArgs args)
public RestrictWorkspaceAdminsSetting(String name, RestrictWorkspaceAdminsSettingArgs args, CustomResourceOptions options)
type: databricks:RestrictWorkspaceAdminsSetting
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RestrictWorkspaceAdminsSettingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RestrictWorkspaceAdminsSettingArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RestrictWorkspaceAdminsSettingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RestrictWorkspaceAdminsSettingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RestrictWorkspaceAdminsSettingArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var restrictWorkspaceAdminsSettingResource = new Databricks.RestrictWorkspaceAdminsSetting("restrictWorkspaceAdminsSettingResource", new()
{
RestrictWorkspaceAdmins = new Databricks.Inputs.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs
{
Status = "string",
},
Etag = "string",
ProviderConfig = new Databricks.Inputs.RestrictWorkspaceAdminsSettingProviderConfigArgs
{
WorkspaceId = "string",
},
SettingName = "string",
});
example, err := databricks.NewRestrictWorkspaceAdminsSetting(ctx, "restrictWorkspaceAdminsSettingResource", &databricks.RestrictWorkspaceAdminsSettingArgs{
RestrictWorkspaceAdmins: &databricks.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs{
Status: pulumi.String("string"),
},
Etag: pulumi.String("string"),
ProviderConfig: &databricks.RestrictWorkspaceAdminsSettingProviderConfigArgs{
WorkspaceId: pulumi.String("string"),
},
SettingName: pulumi.String("string"),
})
var restrictWorkspaceAdminsSettingResource = new RestrictWorkspaceAdminsSetting("restrictWorkspaceAdminsSettingResource", RestrictWorkspaceAdminsSettingArgs.builder()
.restrictWorkspaceAdmins(RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs.builder()
.status("string")
.build())
.etag("string")
.providerConfig(RestrictWorkspaceAdminsSettingProviderConfigArgs.builder()
.workspaceId("string")
.build())
.settingName("string")
.build());
restrict_workspace_admins_setting_resource = databricks.RestrictWorkspaceAdminsSetting("restrictWorkspaceAdminsSettingResource",
restrict_workspace_admins={
"status": "string",
},
etag="string",
provider_config={
"workspace_id": "string",
},
setting_name="string")
const restrictWorkspaceAdminsSettingResource = new databricks.RestrictWorkspaceAdminsSetting("restrictWorkspaceAdminsSettingResource", {
restrictWorkspaceAdmins: {
status: "string",
},
etag: "string",
providerConfig: {
workspaceId: "string",
},
settingName: "string",
});
type: databricks:RestrictWorkspaceAdminsSetting
properties:
etag: string
providerConfig:
workspaceId: string
restrictWorkspaceAdmins:
status: string
settingName: string
RestrictWorkspaceAdminsSetting Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The RestrictWorkspaceAdminsSetting resource accepts the following input properties:
- Restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins - The configuration details.
- Etag string
- Provider
Config RestrictWorkspace Admins Setting Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- Setting
Name string
- Restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins Args - The configuration details.
- Etag string
- Provider
Config RestrictWorkspace Admins Setting Provider Config Args - Configure the provider for management through account provider. This block consists of the following fields:
- Setting
Name string
- restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins - The configuration details.
- etag String
- provider
Config RestrictWorkspace Admins Setting Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- setting
Name String
- restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins - The configuration details.
- etag string
- provider
Config RestrictWorkspace Admins Setting Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- setting
Name string
- restrict_
workspace_ Restrictadmins Workspace Admins Setting Restrict Workspace Admins Args - The configuration details.
- etag str
- provider_
config RestrictWorkspace Admins Setting Provider Config Args - Configure the provider for management through account provider. This block consists of the following fields:
- setting_
name str
- restrict
Workspace Property MapAdmins - The configuration details.
- etag String
- provider
Config Property Map - Configure the provider for management through account provider. This block consists of the following fields:
- setting
Name String
Outputs
All input properties are implicitly available as output properties. Additionally, the RestrictWorkspaceAdminsSetting resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing RestrictWorkspaceAdminsSetting Resource
Get an existing RestrictWorkspaceAdminsSetting resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RestrictWorkspaceAdminsSettingState, opts?: CustomResourceOptions): RestrictWorkspaceAdminsSetting@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
etag: Optional[str] = None,
provider_config: Optional[RestrictWorkspaceAdminsSettingProviderConfigArgs] = None,
restrict_workspace_admins: Optional[RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs] = None,
setting_name: Optional[str] = None) -> RestrictWorkspaceAdminsSettingfunc GetRestrictWorkspaceAdminsSetting(ctx *Context, name string, id IDInput, state *RestrictWorkspaceAdminsSettingState, opts ...ResourceOption) (*RestrictWorkspaceAdminsSetting, error)public static RestrictWorkspaceAdminsSetting Get(string name, Input<string> id, RestrictWorkspaceAdminsSettingState? state, CustomResourceOptions? opts = null)public static RestrictWorkspaceAdminsSetting get(String name, Output<String> id, RestrictWorkspaceAdminsSettingState state, CustomResourceOptions options)resources: _: type: databricks:RestrictWorkspaceAdminsSetting get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Etag string
- Provider
Config RestrictWorkspace Admins Setting Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- Restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins - The configuration details.
- Setting
Name string
- Etag string
- Provider
Config RestrictWorkspace Admins Setting Provider Config Args - Configure the provider for management through account provider. This block consists of the following fields:
- Restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins Args - The configuration details.
- Setting
Name string
- etag String
- provider
Config RestrictWorkspace Admins Setting Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins - The configuration details.
- setting
Name String
- etag string
- provider
Config RestrictWorkspace Admins Setting Provider Config - Configure the provider for management through account provider. This block consists of the following fields:
- restrict
Workspace RestrictAdmins Workspace Admins Setting Restrict Workspace Admins - The configuration details.
- setting
Name string
- etag str
- provider_
config RestrictWorkspace Admins Setting Provider Config Args - Configure the provider for management through account provider. This block consists of the following fields:
- restrict_
workspace_ Restrictadmins Workspace Admins Setting Restrict Workspace Admins Args - The configuration details.
- setting_
name str
- etag String
- provider
Config Property Map - Configure the provider for management through account provider. This block consists of the following fields:
- restrict
Workspace Property MapAdmins - The configuration details.
- setting
Name String
Supporting Types
RestrictWorkspaceAdminsSettingProviderConfig, RestrictWorkspaceAdminsSettingProviderConfigArgs
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- Workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id string - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace_
id str - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
- workspace
Id String - Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.
RestrictWorkspaceAdminsSettingRestrictWorkspaceAdmins, RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs
- Status string
- The restrict workspace admins status for the workspace.
- Status string
- The restrict workspace admins status for the workspace.
- status String
- The restrict workspace admins status for the workspace.
- status string
- The restrict workspace admins status for the workspace.
- status str
- The restrict workspace admins status for the workspace.
- status String
- The restrict workspace admins status for the workspace.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricksTerraform Provider.
