1. Registry
  2. Packages
  3. DataRobot
  4. API Docs
  5. DeploymentSharedRole
Viewing docs for DataRobot v0.12.4
published on Wednesday, Sep 23, 2026 by DataRobot, Inc.
datarobot logo
Viewing docs for DataRobot v0.12.4
published on Wednesday, Sep 23, 2026 by DataRobot, Inc.

    Grants a directory group a role on a deployment, addressing the group by name rather than by ID.

    Pipelines know a group by the name it has in the identity provider, but the sharing API needs the internal group ID. This resource resolves the one to the other, so no group ID has to be hardcoded.

    Destroying the resource revokes the grant. Changing groupName revokes the previous group before granting the new one.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datarobot from "@datarobot/pulumi-datarobot";
    
    // Share a deployment with a group, addressing the group by the name it has in
    // the identity provider rather than by its DataRobot ID. The name can come from
    // a variable or the environment, so no ID is hardcoded in the stack.
    const financeConsumer = new datarobot.DeploymentSharedRole("finance_consumer", {
        deploymentId: example.id,
        groupName: "FinanceTeam",
        role: "CONSUMER",
    });
    
    import pulumi
    import pulumi_datarobot as datarobot
    
    # Share a deployment with a group, addressing the group by the name it has in
    # the identity provider rather than by its DataRobot ID. The name can come from
    # a variable or the environment, so no ID is hardcoded in the stack.
    finance_consumer = datarobot.DeploymentSharedRole("finance_consumer",
        deployment_id=example["id"],
        group_name="FinanceTeam",
        role="CONSUMER")
    
    package main
    
    import (
    	"github.com/datarobot-community/pulumi-datarobot/sdk/go/datarobot"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Share a deployment with a group, addressing the group by the name it has in
    		// the identity provider rather than by its DataRobot ID. The name can come from
    		// a variable or the environment, so no ID is hardcoded in the stack.
    		_, err := datarobot.NewDeploymentSharedRole(ctx, "finance_consumer", &datarobot.DeploymentSharedRoleArgs{
    			DeploymentId: pulumi.Any(example.Id),
    			GroupName:    pulumi.String("FinanceTeam"),
    			Role:         pulumi.String("CONSUMER"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datarobot = DataRobotPulumi.Datarobot;
    
    return await Deployment.RunAsync(() => 
    {
        // Share a deployment with a group, addressing the group by the name it has in
        // the identity provider rather than by its DataRobot ID. The name can come from
        // a variable or the environment, so no ID is hardcoded in the stack.
        var financeConsumer = new Datarobot.DeploymentSharedRole("finance_consumer", new()
        {
            DeploymentId = example.Id,
            GroupName = "FinanceTeam",
            Role = "CONSUMER",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datarobot.DeploymentSharedRole;
    import com.pulumi.datarobot.DeploymentSharedRoleArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            // Share a deployment with a group, addressing the group by the name it has in
            // the identity provider rather than by its DataRobot ID. The name can come from
            // a variable or the environment, so no ID is hardcoded in the stack.
            var financeConsumer = new DeploymentSharedRole("financeConsumer", DeploymentSharedRoleArgs.builder()
                .deploymentId(example.id())
                .groupName("FinanceTeam")
                .role("CONSUMER")
                .build());
    
        }
    }
    
    resources:
      # Share a deployment with a group, addressing the group by the name it has in
      # the identity provider rather than by its DataRobot ID. The name can come from
      # a variable or the environment, so no ID is hardcoded in the stack.
      financeConsumer:
        type: datarobot:DeploymentSharedRole
        name: finance_consumer
        properties:
          deploymentId: ${example.id}
          groupName: FinanceTeam
          role: CONSUMER
    
    pulumi {
      required_providers {
        datarobot = {
          source = "pulumi/datarobot"
        }
      }
    }
    
    # Share a deployment with a group, addressing the group by the name it has in
    # the identity provider rather than by its DataRobot ID. The name can come from
    # a variable or the environment, so no ID is hardcoded in the stack.
    resource "datarobot_deploymentsharedrole" "finance_consumer" {
      deployment_id = example.id
      group_name    = "FinanceTeam"
      role          = "CONSUMER"
    }
    

    Create DeploymentSharedRole Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new DeploymentSharedRole(name: string, args: DeploymentSharedRoleArgs, opts?: CustomResourceOptions);
    @overload
    def DeploymentSharedRole(resource_name: str,
                             args: DeploymentSharedRoleArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def DeploymentSharedRole(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             deployment_id: Optional[str] = None,
                             group_name: Optional[str] = None,
                             role: Optional[str] = None)
    func NewDeploymentSharedRole(ctx *Context, name string, args DeploymentSharedRoleArgs, opts ...ResourceOption) (*DeploymentSharedRole, error)
    public DeploymentSharedRole(string name, DeploymentSharedRoleArgs args, CustomResourceOptions? opts = null)
    public DeploymentSharedRole(String name, DeploymentSharedRoleArgs args)
    public DeploymentSharedRole(String name, DeploymentSharedRoleArgs args, CustomResourceOptions options)
    
    type: datarobot:DeploymentSharedRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "datarobot_deployment_shared_role" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args DeploymentSharedRoleArgs
    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 DeploymentSharedRoleArgs
    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 DeploymentSharedRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DeploymentSharedRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DeploymentSharedRoleArgs
    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 deploymentSharedRoleResource = new Datarobot.DeploymentSharedRole("deploymentSharedRoleResource", new()
    {
        DeploymentId = "string",
        GroupName = "string",
        Role = "string",
    });
    
    example, err := datarobot.NewDeploymentSharedRole(ctx, "deploymentSharedRoleResource", &datarobot.DeploymentSharedRoleArgs{
    	DeploymentId: pulumi.String("string"),
    	GroupName:    pulumi.String("string"),
    	Role:         pulumi.String("string"),
    })
    
    resource "datarobot_deployment_shared_role" "deploymentSharedRoleResource" {
      lifecycle {
        create_before_destroy = true
      }
      deployment_id = "string"
      group_name    = "string"
      role          = "string"
    }
    
    var deploymentSharedRoleResource = new DeploymentSharedRole("deploymentSharedRoleResource", DeploymentSharedRoleArgs.builder()
        .deploymentId("string")
        .groupName("string")
        .role("string")
        .build());
    
    deployment_shared_role_resource = datarobot.DeploymentSharedRole("deploymentSharedRoleResource",
        deployment_id="string",
        group_name="string",
        role="string")
    
    const deploymentSharedRoleResource = new datarobot.DeploymentSharedRole("deploymentSharedRoleResource", {
        deploymentId: "string",
        groupName: "string",
        role: "string",
    });
    
    type: datarobot:DeploymentSharedRole
    properties:
        deploymentId: string
        groupName: string
        role: string
    

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

    DeploymentId string
    The ID of the deployment to share.
    GroupName string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    Role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    DeploymentId string
    The ID of the deployment to share.
    GroupName string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    Role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deployment_id string
    The ID of the deployment to share.
    group_name string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deploymentId String
    The ID of the deployment to share.
    groupName String
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role String
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deploymentId string
    The ID of the deployment to share.
    groupName string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deployment_id str
    The ID of the deployment to share.
    group_name str
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role str
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deploymentId String
    The ID of the deployment to share.
    groupName String
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role String
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the DeploymentSharedRole resource produces the following output properties:

    GroupId string
    The ID the group name resolved to.
    Id string
    The provider-assigned unique ID for this managed resource.
    GroupId string
    The ID the group name resolved to.
    Id string
    The provider-assigned unique ID for this managed resource.
    group_id string
    The ID the group name resolved to.
    id string
    The provider-assigned unique ID for this managed resource.
    groupId String
    The ID the group name resolved to.
    id String
    The provider-assigned unique ID for this managed resource.
    groupId string
    The ID the group name resolved to.
    id string
    The provider-assigned unique ID for this managed resource.
    group_id str
    The ID the group name resolved to.
    id str
    The provider-assigned unique ID for this managed resource.
    groupId String
    The ID the group name resolved to.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DeploymentSharedRole Resource

    Get an existing DeploymentSharedRole 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?: DeploymentSharedRoleState, opts?: CustomResourceOptions): DeploymentSharedRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            deployment_id: Optional[str] = None,
            group_id: Optional[str] = None,
            group_name: Optional[str] = None,
            role: Optional[str] = None) -> DeploymentSharedRole
    func GetDeploymentSharedRole(ctx *Context, name string, id IDInput, state *DeploymentSharedRoleState, opts ...ResourceOption) (*DeploymentSharedRole, error)
    public static DeploymentSharedRole Get(string name, Input<string> id, DeploymentSharedRoleState? state, CustomResourceOptions? opts = null)
    public static DeploymentSharedRole get(String name, Output<String> id, DeploymentSharedRoleState state, CustomResourceOptions options)
    resources:  _:    type: datarobot:DeploymentSharedRole    get:      id: ${id}
    import {
      to = datarobot_deployment_shared_role.example
      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.
    The following state arguments are supported:
    DeploymentId string
    The ID of the deployment to share.
    GroupId string
    The ID the group name resolved to.
    GroupName string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    Role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    DeploymentId string
    The ID of the deployment to share.
    GroupId string
    The ID the group name resolved to.
    GroupName string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    Role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deployment_id string
    The ID of the deployment to share.
    group_id string
    The ID the group name resolved to.
    group_name string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deploymentId String
    The ID of the deployment to share.
    groupId String
    The ID the group name resolved to.
    groupName String
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role String
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deploymentId string
    The ID of the deployment to share.
    groupId string
    The ID the group name resolved to.
    groupName string
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role string
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deployment_id str
    The ID of the deployment to share.
    group_id str
    The ID the group name resolved to.
    group_name str
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role str
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.
    deploymentId String
    The ID of the deployment to share.
    groupId String
    The ID the group name resolved to.
    groupName String
    The name of the group to grant the role to, matched in full and case sensitively. Changing this replaces the resource, so the previous group's grant is revoked before the new one is created.
    role String
    The role to grant. One of OWNER, USER or CONSUMER. Defaults to CONSUMER, which allows predictions but does not make the deployment visible; use USER if the group needs to see it.

    Package Details

    Repository
    datarobot datarobot-community/pulumi-datarobot
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datarobot Terraform Provider.
    datarobot logo
    Viewing docs for DataRobot v0.12.4
    published on Wednesday, Sep 23, 2026 by DataRobot, Inc.

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial