databricks.GroupMember
Explore with Pulumi AI
This resource allows you to attach users, service_principal, and groups as group members.
To attach members to groups in the Databricks account, the provider must be configured with host = "https://accounts.cloud.databricks.com"
on AWS deployments or host = "https://accounts.azuredatabricks.net"
and authenticate using AAD tokens on Azure deployments
Example Usage
After the following example, Bradley would have direct membership in group B and transitive membership in group A.
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const a = new databricks.Group("a", {displayName: "A"});
const b = new databricks.Group("b", {displayName: "B"});
const ab = new databricks.GroupMember("ab", {
groupId: a.id,
memberId: b.id,
});
const bradley = new databricks.User("bradley", {userName: "bradley@example.com"});
const bb = new databricks.GroupMember("bb", {
groupId: b.id,
memberId: bradley.id,
});
import pulumi
import pulumi_databricks as databricks
a = databricks.Group("a", display_name="A")
b = databricks.Group("b", display_name="B")
ab = databricks.GroupMember("ab",
group_id=a.id,
member_id=b.id)
bradley = databricks.User("bradley", user_name="bradley@example.com")
bb = databricks.GroupMember("bb",
group_id=b.id,
member_id=bradley.id)
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 {
a, err := databricks.NewGroup(ctx, "a", &databricks.GroupArgs{
DisplayName: pulumi.String("A"),
})
if err != nil {
return err
}
b, err := databricks.NewGroup(ctx, "b", &databricks.GroupArgs{
DisplayName: pulumi.String("B"),
})
if err != nil {
return err
}
_, err = databricks.NewGroupMember(ctx, "ab", &databricks.GroupMemberArgs{
GroupId: a.ID(),
MemberId: b.ID(),
})
if err != nil {
return err
}
bradley, err := databricks.NewUser(ctx, "bradley", &databricks.UserArgs{
UserName: pulumi.String("bradley@example.com"),
})
if err != nil {
return err
}
_, err = databricks.NewGroupMember(ctx, "bb", &databricks.GroupMemberArgs{
GroupId: b.ID(),
MemberId: bradley.ID(),
})
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 a = new Databricks.Group("a", new()
{
DisplayName = "A",
});
var b = new Databricks.Group("b", new()
{
DisplayName = "B",
});
var ab = new Databricks.GroupMember("ab", new()
{
GroupId = a.Id,
MemberId = b.Id,
});
var bradley = new Databricks.User("bradley", new()
{
UserName = "bradley@example.com",
});
var bb = new Databricks.GroupMember("bb", new()
{
GroupId = b.Id,
MemberId = bradley.Id,
});
});
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.GroupArgs;
import com.pulumi.databricks.GroupMember;
import com.pulumi.databricks.GroupMemberArgs;
import com.pulumi.databricks.User;
import com.pulumi.databricks.UserArgs;
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 a = new Group("a", GroupArgs.builder()
.displayName("A")
.build());
var b = new Group("b", GroupArgs.builder()
.displayName("B")
.build());
var ab = new GroupMember("ab", GroupMemberArgs.builder()
.groupId(a.id())
.memberId(b.id())
.build());
var bradley = new User("bradley", UserArgs.builder()
.userName("bradley@example.com")
.build());
var bb = new GroupMember("bb", GroupMemberArgs.builder()
.groupId(b.id())
.memberId(bradley.id())
.build());
}
}
resources:
a:
type: databricks:Group
properties:
displayName: A
b:
type: databricks:Group
properties:
displayName: B
ab:
type: databricks:GroupMember
properties:
groupId: ${a.id}
memberId: ${b.id}
bradley:
type: databricks:User
properties:
userName: bradley@example.com
bb:
type: databricks:GroupMember
properties:
groupId: ${b.id}
memberId: ${bradley.id}
Related Resources
The following resources are often used in the same context:
- End to end workspace management guide.
- 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.GroupInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_group.
- databricks.IpAccessList to allow access from predefined IP ranges.
- databricks.ServicePrincipal to grant access to a workspace to an automation tool or application.
- databricks.User to manage users, that could be added to databricks.Group within the workspace.
- databricks.User data to retrieve information about databricks_user.
- databricks.UserInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_user.
Create GroupMember Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GroupMember(name: string, args: GroupMemberArgs, opts?: CustomResourceOptions);
@overload
def GroupMember(resource_name: str,
args: GroupMemberArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GroupMember(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
member_id: Optional[str] = None)
func NewGroupMember(ctx *Context, name string, args GroupMemberArgs, opts ...ResourceOption) (*GroupMember, error)
public GroupMember(string name, GroupMemberArgs args, CustomResourceOptions? opts = null)
public GroupMember(String name, GroupMemberArgs args)
public GroupMember(String name, GroupMemberArgs args, CustomResourceOptions options)
type: databricks:GroupMember
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 GroupMemberArgs
- 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 GroupMemberArgs
- 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 GroupMemberArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GroupMemberArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GroupMemberArgs
- 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 groupMemberResource = new Databricks.GroupMember("groupMemberResource", new()
{
GroupId = "string",
MemberId = "string",
});
example, err := databricks.NewGroupMember(ctx, "groupMemberResource", &databricks.GroupMemberArgs{
GroupId: pulumi.String("string"),
MemberId: pulumi.String("string"),
})
var groupMemberResource = new GroupMember("groupMemberResource", GroupMemberArgs.builder()
.groupId("string")
.memberId("string")
.build());
group_member_resource = databricks.GroupMember("groupMemberResource",
group_id="string",
member_id="string")
const groupMemberResource = new databricks.GroupMember("groupMemberResource", {
groupId: "string",
memberId: "string",
});
type: databricks:GroupMember
properties:
groupId: string
memberId: string
GroupMember 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 GroupMember resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the GroupMember 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 GroupMember Resource
Get an existing GroupMember 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?: GroupMemberState, opts?: CustomResourceOptions): GroupMember
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
member_id: Optional[str] = None) -> GroupMember
func GetGroupMember(ctx *Context, name string, id IDInput, state *GroupMemberState, opts ...ResourceOption) (*GroupMember, error)
public static GroupMember Get(string name, Input<string> id, GroupMemberState? state, CustomResourceOptions? opts = null)
public static GroupMember get(String name, Output<String> id, GroupMemberState 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.
Import
You can import a databricks_group_member
resource with name my_group_member
like the following:
bash
$ pulumi import databricks:index/groupMember:GroupMember my_group_member "<group_id>|<member_id>"
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.