1. Packages
  2. Databricks
  3. API Docs
  4. RestrictWorkspaceAdminsSetting
Databricks v1.50.2 published on Tuesday, Sep 24, 2024 by Pulumi

databricks.RestrictWorkspaceAdminsSetting

Explore with Pulumi AI

databricks logo
Databricks v1.50.2 published on Tuesday, Sep 24, 2024 by Pulumi

    Note 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 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:

    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 run_as setting to themselves a service principal on which they have the Service Principal User role.

    Note 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,
                                       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",
        SettingName = "string",
    });
    
    example, err := databricks.NewRestrictWorkspaceAdminsSetting(ctx, "restrictWorkspaceAdminsSettingResource", &databricks.RestrictWorkspaceAdminsSettingArgs{
    	RestrictWorkspaceAdmins: &databricks.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs{
    		Status: pulumi.String("string"),
    	},
    	Etag:        pulumi.String("string"),
    	SettingName: pulumi.String("string"),
    })
    
    var restrictWorkspaceAdminsSettingResource = new RestrictWorkspaceAdminsSetting("restrictWorkspaceAdminsSettingResource", RestrictWorkspaceAdminsSettingArgs.builder()
        .restrictWorkspaceAdmins(RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs.builder()
            .status("string")
            .build())
        .etag("string")
        .settingName("string")
        .build());
    
    restrict_workspace_admins_setting_resource = databricks.RestrictWorkspaceAdminsSetting("restrictWorkspaceAdminsSettingResource",
        restrict_workspace_admins=databricks.RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs(
            status="string",
        ),
        etag="string",
        setting_name="string")
    
    const restrictWorkspaceAdminsSettingResource = new databricks.RestrictWorkspaceAdminsSetting("restrictWorkspaceAdminsSettingResource", {
        restrictWorkspaceAdmins: {
            status: "string",
        },
        etag: "string",
        settingName: "string",
    });
    
    type: databricks:RestrictWorkspaceAdminsSetting
    properties:
        etag: 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

    The RestrictWorkspaceAdminsSetting resource accepts the following input properties:

    restrictWorkspaceAdmins Property Map
    The configuration details.
    etag String
    settingName 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,
            restrict_workspace_admins: Optional[RestrictWorkspaceAdminsSettingRestrictWorkspaceAdminsArgs] = None,
            setting_name: Optional[str] = None) -> RestrictWorkspaceAdminsSetting
    func 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)
    Resource lookup is not supported in YAML
    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.

    Supporting Types

    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.

    Import

    This resource can be imported by predefined name global:

    bash

    $ pulumi import databricks:index/restrictWorkspaceAdminsSetting:RestrictWorkspaceAdminsSetting this global
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    databricks pulumi/pulumi-databricks
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the databricks Terraform Provider.
    databricks logo
    Databricks v1.50.2 published on Tuesday, Sep 24, 2024 by Pulumi