databricks.MwsPermissionAssignment
Explore with Pulumi AI
These resources are invoked in the account context. Permission Assignment Account API endpoints are restricted to account admins. Provider must have account_id
attribute configured. Account Id that could be found in the bottom left corner of Accounts Console
Related Resources
The following resources are used in the same context:
- databricks.Group to manage groups in Databricks Workspace or Account Console (for AWS deployments).
- databricks.Group data to retrieve information about databricks.Group members, entitlements and instance profiles.
- databricks.GroupMember to attach users and groups as group members.
- databricks.PermissionAssignment to manage permission assignment from a workspace context
Example Usage
In account context, adding account-level group to a workspace
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var dataEng = new Databricks.Group("dataEng");
var addAdminGroup = new Databricks.MwsPermissionAssignment("addAdminGroup", new()
{
WorkspaceId = databricks_mws_workspaces.This.Workspace_id,
PrincipalId = dataEng.Id,
Permissions = new[]
{
"ADMIN",
},
});
});
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 {
dataEng, err := databricks.NewGroup(ctx, "dataEng", nil)
if err != nil {
return err
}
_, err = databricks.NewMwsPermissionAssignment(ctx, "addAdminGroup", &databricks.MwsPermissionAssignmentArgs{
WorkspaceId: pulumi.Any(databricks_mws_workspaces.This.Workspace_id),
PrincipalId: dataEng.ID(),
Permissions: pulumi.StringArray{
pulumi.String("ADMIN"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.Group;
import com.pulumi.databricks.MwsPermissionAssignment;
import com.pulumi.databricks.MwsPermissionAssignmentArgs;
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 dataEng = new Group("dataEng");
var addAdminGroup = new MwsPermissionAssignment("addAdminGroup", MwsPermissionAssignmentArgs.builder()
.workspaceId(databricks_mws_workspaces.this().workspace_id())
.principalId(dataEng.id())
.permissions("ADMIN")
.build());
}
}
import pulumi
import pulumi_databricks as databricks
data_eng = databricks.Group("dataEng")
add_admin_group = databricks.MwsPermissionAssignment("addAdminGroup",
workspace_id=databricks_mws_workspaces["this"]["workspace_id"],
principal_id=data_eng.id,
permissions=["ADMIN"])
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const dataEng = new databricks.Group("dataEng", {});
const addAdminGroup = new databricks.MwsPermissionAssignment("addAdminGroup", {
workspaceId: databricks_mws_workspaces["this"].workspace_id,
principalId: dataEng.id,
permissions: ["ADMIN"],
});
resources:
dataEng:
type: databricks:Group
addAdminGroup:
type: databricks:MwsPermissionAssignment
properties:
workspaceId: ${databricks_mws_workspaces.this.workspace_id}
principalId: ${dataEng.id}
permissions:
- ADMIN
In account context, adding account-level user to a workspace
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var me = new Databricks.User("me", new()
{
UserName = "me@example.com",
});
var addUser = new Databricks.MwsPermissionAssignment("addUser", new()
{
WorkspaceId = databricks_mws_workspaces.This.Workspace_id,
PrincipalId = me.Id,
Permissions = new[]
{
"USER",
},
});
});
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 {
me, err := databricks.NewUser(ctx, "me", &databricks.UserArgs{
UserName: pulumi.String("me@example.com"),
})
if err != nil {
return err
}
_, err = databricks.NewMwsPermissionAssignment(ctx, "addUser", &databricks.MwsPermissionAssignmentArgs{
WorkspaceId: pulumi.Any(databricks_mws_workspaces.This.Workspace_id),
PrincipalId: me.ID(),
Permissions: pulumi.StringArray{
pulumi.String("USER"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.User;
import com.pulumi.databricks.UserArgs;
import com.pulumi.databricks.MwsPermissionAssignment;
import com.pulumi.databricks.MwsPermissionAssignmentArgs;
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 me = new User("me", UserArgs.builder()
.userName("me@example.com")
.build());
var addUser = new MwsPermissionAssignment("addUser", MwsPermissionAssignmentArgs.builder()
.workspaceId(databricks_mws_workspaces.this().workspace_id())
.principalId(me.id())
.permissions("USER")
.build());
}
}
import pulumi
import pulumi_databricks as databricks
me = databricks.User("me", user_name="me@example.com")
add_user = databricks.MwsPermissionAssignment("addUser",
workspace_id=databricks_mws_workspaces["this"]["workspace_id"],
principal_id=me.id,
permissions=["USER"])
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const me = new databricks.User("me", {userName: "me@example.com"});
const addUser = new databricks.MwsPermissionAssignment("addUser", {
workspaceId: databricks_mws_workspaces["this"].workspace_id,
principalId: me.id,
permissions: ["USER"],
});
resources:
me:
type: databricks:User
properties:
userName: me@example.com
addUser:
type: databricks:MwsPermissionAssignment
properties:
workspaceId: ${databricks_mws_workspaces.this.workspace_id}
principalId: ${me.id}
permissions:
- USER
In account context, adding account-level service principal to a workspace
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var sp = new Databricks.ServicePrincipal("sp", new()
{
DisplayName = "Automation-only SP",
});
var addAdminSpn = new Databricks.MwsPermissionAssignment("addAdminSpn", new()
{
WorkspaceId = databricks_mws_workspaces.This.Workspace_id,
PrincipalId = sp.Id,
Permissions = new[]
{
"ADMIN",
},
});
});
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 {
sp, err := databricks.NewServicePrincipal(ctx, "sp", &databricks.ServicePrincipalArgs{
DisplayName: pulumi.String("Automation-only SP"),
})
if err != nil {
return err
}
_, err = databricks.NewMwsPermissionAssignment(ctx, "addAdminSpn", &databricks.MwsPermissionAssignmentArgs{
WorkspaceId: pulumi.Any(databricks_mws_workspaces.This.Workspace_id),
PrincipalId: sp.ID(),
Permissions: pulumi.StringArray{
pulumi.String("ADMIN"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.ServicePrincipal;
import com.pulumi.databricks.ServicePrincipalArgs;
import com.pulumi.databricks.MwsPermissionAssignment;
import com.pulumi.databricks.MwsPermissionAssignmentArgs;
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 sp = new ServicePrincipal("sp", ServicePrincipalArgs.builder()
.displayName("Automation-only SP")
.build());
var addAdminSpn = new MwsPermissionAssignment("addAdminSpn", MwsPermissionAssignmentArgs.builder()
.workspaceId(databricks_mws_workspaces.this().workspace_id())
.principalId(sp.id())
.permissions("ADMIN")
.build());
}
}
import pulumi
import pulumi_databricks as databricks
sp = databricks.ServicePrincipal("sp", display_name="Automation-only SP")
add_admin_spn = databricks.MwsPermissionAssignment("addAdminSpn",
workspace_id=databricks_mws_workspaces["this"]["workspace_id"],
principal_id=sp.id,
permissions=["ADMIN"])
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const sp = new databricks.ServicePrincipal("sp", {displayName: "Automation-only SP"});
const addAdminSpn = new databricks.MwsPermissionAssignment("addAdminSpn", {
workspaceId: databricks_mws_workspaces["this"].workspace_id,
principalId: sp.id,
permissions: ["ADMIN"],
});
resources:
sp:
type: databricks:ServicePrincipal
properties:
displayName: Automation-only SP
addAdminSpn:
type: databricks:MwsPermissionAssignment
properties:
workspaceId: ${databricks_mws_workspaces.this.workspace_id}
principalId: ${sp.id}
permissions:
- ADMIN
Create MwsPermissionAssignment Resource
new MwsPermissionAssignment(name: string, args: MwsPermissionAssignmentArgs, opts?: CustomResourceOptions);
@overload
def MwsPermissionAssignment(resource_name: str,
opts: Optional[ResourceOptions] = None,
permissions: Optional[Sequence[str]] = None,
principal_id: Optional[int] = None,
workspace_id: Optional[int] = None)
@overload
def MwsPermissionAssignment(resource_name: str,
args: MwsPermissionAssignmentArgs,
opts: Optional[ResourceOptions] = None)
func NewMwsPermissionAssignment(ctx *Context, name string, args MwsPermissionAssignmentArgs, opts ...ResourceOption) (*MwsPermissionAssignment, error)
public MwsPermissionAssignment(string name, MwsPermissionAssignmentArgs args, CustomResourceOptions? opts = null)
public MwsPermissionAssignment(String name, MwsPermissionAssignmentArgs args)
public MwsPermissionAssignment(String name, MwsPermissionAssignmentArgs args, CustomResourceOptions options)
type: databricks:MwsPermissionAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MwsPermissionAssignmentArgs
- 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 MwsPermissionAssignmentArgs
- 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 MwsPermissionAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MwsPermissionAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MwsPermissionAssignmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
MwsPermissionAssignment 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 MwsPermissionAssignment resource accepts the following input properties:
- Permissions List<string>
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- Principal
Id int Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- Workspace
Id int Databricks workspace ID.
- Permissions []string
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- Principal
Id int Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- Workspace
Id int Databricks workspace ID.
- permissions List<String>
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal
Id Integer Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace
Id Integer Databricks workspace ID.
- permissions string[]
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal
Id number Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace
Id number Databricks workspace ID.
- permissions Sequence[str]
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal_
id int Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace_
id int Databricks workspace ID.
- permissions List<String>
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal
Id Number Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace
Id Number Databricks workspace ID.
Outputs
All input properties are implicitly available as output properties. Additionally, the MwsPermissionAssignment 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 MwsPermissionAssignment Resource
Get an existing MwsPermissionAssignment 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?: MwsPermissionAssignmentState, opts?: CustomResourceOptions): MwsPermissionAssignment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
permissions: Optional[Sequence[str]] = None,
principal_id: Optional[int] = None,
workspace_id: Optional[int] = None) -> MwsPermissionAssignment
func GetMwsPermissionAssignment(ctx *Context, name string, id IDInput, state *MwsPermissionAssignmentState, opts ...ResourceOption) (*MwsPermissionAssignment, error)
public static MwsPermissionAssignment Get(string name, Input<string> id, MwsPermissionAssignmentState? state, CustomResourceOptions? opts = null)
public static MwsPermissionAssignment get(String name, Output<String> id, MwsPermissionAssignmentState 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.
- Permissions List<string>
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- Principal
Id int Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- Workspace
Id int Databricks workspace ID.
- Permissions []string
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- Principal
Id int Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- Workspace
Id int Databricks workspace ID.
- permissions List<String>
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal
Id Integer Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace
Id Integer Databricks workspace ID.
- permissions string[]
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal
Id number Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace
Id number Databricks workspace ID.
- permissions Sequence[str]
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal_
id int Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace_
id int Databricks workspace ID.
- permissions List<String>
The list of workspace permissions to assign to the principal:
"USER"
- Can access the workspace with basic privileges."ADMIN"
- Can access the workspace and has workspace admin privileges to manage users and groups, workspace configurations, and more.
- principal
Id Number Databricks ID of the user, service principal, or group. The principal ID can be retrieved using the SCIM API, or using databricks_user, databricks.ServicePrincipal or databricks.Group data sources.
- workspace
Id Number Databricks workspace ID.
Import
The resource databricks_mws_permission_assignment
can be imported using the workspace id and principal id bash
$ pulumi import databricks:index/mwsPermissionAssignment:MwsPermissionAssignment this "workspace_id|principal_id"
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
databricks
Terraform Provider.