databricks logo
Databricks v1.14.0, May 23 23

databricks.GroupRole

Explore with Pulumi AI

This resource allows you to attach a role to databricks_group. This role could be a pre-defined role such as account admin, or an instance profile ARN.

The following resources are often used in the same context:

  • End to end workspace management guide.
  • databricks.getAwsBucketPolicy data to configure a simple access policy for AWS S3 buckets, so that Databricks can access data in it.
  • databricks.ClusterPolicy to create a databricks.Cluster policy, which limits the ability to create clusters based on a set of rules.
  • 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.InstancePool to manage instance pools to reduce cluster start and auto-scaling times by maintaining a set of idle, ready-to-use instances.
  • databricks.InstanceProfile to manage AWS EC2 instance profiles that users can launch databricks.Cluster and access data, like databricks_mount.
  • databricks.UserInstanceProfile to attach databricks.InstanceProfile (AWS) to databricks_user.

Example Usage

Attach an instance profile to a group

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var instanceProfile = new Databricks.InstanceProfile("instanceProfile", new()
    {
        InstanceProfileArn = "my_instance_profile_arn",
    });

    var myGroup = new Databricks.Group("myGroup");

    var myGroupInstanceProfile = new Databricks.GroupRole("myGroupInstanceProfile", new()
    {
        GroupId = myGroup.Id,
        Role = instanceProfile.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 {
		instanceProfile, err := databricks.NewInstanceProfile(ctx, "instanceProfile", &databricks.InstanceProfileArgs{
			InstanceProfileArn: pulumi.String("my_instance_profile_arn"),
		})
		if err != nil {
			return err
		}
		myGroup, err := databricks.NewGroup(ctx, "myGroup", nil)
		if err != nil {
			return err
		}
		_, err = databricks.NewGroupRole(ctx, "myGroupInstanceProfile", &databricks.GroupRoleArgs{
			GroupId: myGroup.ID(),
			Role:    instanceProfile.ID(),
		})
		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.InstanceProfile;
import com.pulumi.databricks.InstanceProfileArgs;
import com.pulumi.databricks.Group;
import com.pulumi.databricks.GroupRole;
import com.pulumi.databricks.GroupRoleArgs;
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 instanceProfile = new InstanceProfile("instanceProfile", InstanceProfileArgs.builder()        
            .instanceProfileArn("my_instance_profile_arn")
            .build());

        var myGroup = new Group("myGroup");

        var myGroupInstanceProfile = new GroupRole("myGroupInstanceProfile", GroupRoleArgs.builder()        
            .groupId(myGroup.id())
            .role(instanceProfile.id())
            .build());

    }
}
import pulumi
import pulumi_databricks as databricks

instance_profile = databricks.InstanceProfile("instanceProfile", instance_profile_arn="my_instance_profile_arn")
my_group = databricks.Group("myGroup")
my_group_instance_profile = databricks.GroupRole("myGroupInstanceProfile",
    group_id=my_group.id,
    role=instance_profile.id)
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const instanceProfile = new databricks.InstanceProfile("instanceProfile", {instanceProfileArn: "my_instance_profile_arn"});
const myGroup = new databricks.Group("myGroup", {});
const myGroupInstanceProfile = new databricks.GroupRole("myGroupInstanceProfile", {
    groupId: myGroup.id,
    role: instanceProfile.id,
});
resources:
  instanceProfile:
    type: databricks:InstanceProfile
    properties:
      instanceProfileArn: my_instance_profile_arn
  myGroup:
    type: databricks:Group
  myGroupInstanceProfile:
    type: databricks:GroupRole
    properties:
      groupId: ${myGroup.id}
      role: ${instanceProfile.id}

Attach account admin role to an account-level group

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var myGroup = new Databricks.Group("myGroup");

    var myGroupAccountAdmin = new Databricks.GroupRole("myGroupAccountAdmin", new()
    {
        GroupId = myGroup.Id,
        Role = "account_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 {
		myGroup, err := databricks.NewGroup(ctx, "myGroup", nil)
		if err != nil {
			return err
		}
		_, err = databricks.NewGroupRole(ctx, "myGroupAccountAdmin", &databricks.GroupRoleArgs{
			GroupId: myGroup.ID(),
			Role:    pulumi.String("account_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.GroupRole;
import com.pulumi.databricks.GroupRoleArgs;
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 myGroup = new Group("myGroup");

        var myGroupAccountAdmin = new GroupRole("myGroupAccountAdmin", GroupRoleArgs.builder()        
            .groupId(myGroup.id())
            .role("account_admin")
            .build());

    }
}
import pulumi
import pulumi_databricks as databricks

my_group = databricks.Group("myGroup")
my_group_account_admin = databricks.GroupRole("myGroupAccountAdmin",
    group_id=my_group.id,
    role="account_admin")
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const myGroup = new databricks.Group("myGroup", {});
const myGroupAccountAdmin = new databricks.GroupRole("myGroupAccountAdmin", {
    groupId: myGroup.id,
    role: "account_admin",
});
resources:
  myGroup:
    type: databricks:Group
  myGroupAccountAdmin:
    type: databricks:GroupRole
    properties:
      groupId: ${myGroup.id}
      role: account_admin

Create GroupRole Resource

new GroupRole(name: string, args: GroupRoleArgs, opts?: CustomResourceOptions);
@overload
def GroupRole(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              group_id: Optional[str] = None,
              role: Optional[str] = None)
@overload
def GroupRole(resource_name: str,
              args: GroupRoleArgs,
              opts: Optional[ResourceOptions] = None)
func NewGroupRole(ctx *Context, name string, args GroupRoleArgs, opts ...ResourceOption) (*GroupRole, error)
public GroupRole(string name, GroupRoleArgs args, CustomResourceOptions? opts = null)
public GroupRole(String name, GroupRoleArgs args)
public GroupRole(String name, GroupRoleArgs args, CustomResourceOptions options)
type: databricks:GroupRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args GroupRoleArgs
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 GroupRoleArgs
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 GroupRoleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GroupRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args GroupRoleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

GroupRole 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 GroupRole resource accepts the following input properties:

GroupId string

This is the id of the group resource.

Role string

Either a role name or the ARN/ID of the instance profile resource.

GroupId string

This is the id of the group resource.

Role string

Either a role name or the ARN/ID of the instance profile resource.

groupId String

This is the id of the group resource.

role String

Either a role name or the ARN/ID of the instance profile resource.

groupId string

This is the id of the group resource.

role string

Either a role name or the ARN/ID of the instance profile resource.

group_id str

This is the id of the group resource.

role str

Either a role name or the ARN/ID of the instance profile resource.

groupId String

This is the id of the group resource.

role String

Either a role name or the ARN/ID of the instance profile resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the GroupRole 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 GroupRole Resource

Get an existing GroupRole 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?: GroupRoleState, opts?: CustomResourceOptions): GroupRole
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        group_id: Optional[str] = None,
        role: Optional[str] = None) -> GroupRole
func GetGroupRole(ctx *Context, name string, id IDInput, state *GroupRoleState, opts ...ResourceOption) (*GroupRole, error)
public static GroupRole Get(string name, Input<string> id, GroupRoleState? state, CustomResourceOptions? opts = null)
public static GroupRole get(String name, Output<String> id, GroupRoleState 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.
The following state arguments are supported:
GroupId string

This is the id of the group resource.

Role string

Either a role name or the ARN/ID of the instance profile resource.

GroupId string

This is the id of the group resource.

Role string

Either a role name or the ARN/ID of the instance profile resource.

groupId String

This is the id of the group resource.

role String

Either a role name or the ARN/ID of the instance profile resource.

groupId string

This is the id of the group resource.

role string

Either a role name or the ARN/ID of the instance profile resource.

group_id str

This is the id of the group resource.

role str

Either a role name or the ARN/ID of the instance profile resource.

groupId String

This is the id of the group resource.

role String

Either a role name or the ARN/ID of the instance profile resource.

Import

-> Note Importing this resource is not currently supported.

Package Details

Repository
databricks pulumi/pulumi-databricks
License
Apache-2.0
Notes

This Pulumi package is based on the databricks Terraform Provider.