databricks logo
Databricks v1.14.0, May 23 23

databricks.Recipient

Explore with Pulumi AI

Within a metastore, Unity Catalog provides the ability to create a recipient to attach delta shares to.

A databricks.Recipient is contained within databricks.Metastore and can have permissions to SELECT from a list of shares.

The following resources are often used in the same context:

  • databricks.Share to create Delta Sharing shares.
  • databricks.Grants to manage Delta Sharing permissions.
  • databricks.getShares to read existing Delta Sharing shares.

Example Usage

Databricks Sharing with non databricks recipient

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

return await Deployment.RunAsync(() => 
{
    var db2opensharecode = new Random.RandomPassword("db2opensharecode", new()
    {
        Length = 16,
        Special = true,
    });

    var current = Databricks.GetCurrentUser.Invoke();

    var db2open = new Databricks.Recipient("db2open", new()
    {
        Comment = "made by terraform",
        AuthenticationType = "TOKEN",
        SharingCode = db2opensharecode.Result,
        IpAccessList = new Databricks.Inputs.RecipientIpAccessListArgs
        {
            AllowedIpAddresses = new[] {},
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		db2opensharecode, err := random.NewRandomPassword(ctx, "db2opensharecode", &random.RandomPasswordArgs{
			Length:  pulumi.Int(16),
			Special: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = databricks.GetCurrentUser(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = databricks.NewRecipient(ctx, "db2open", &databricks.RecipientArgs{
			Comment:            pulumi.String("made by terraform"),
			AuthenticationType: pulumi.String("TOKEN"),
			SharingCode:        db2opensharecode.Result,
			IpAccessList: &databricks.RecipientIpAccessListArgs{
				AllowedIpAddresses: pulumi.StringArray{},
			},
		})
		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.random.RandomPassword;
import com.pulumi.random.RandomPasswordArgs;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.Recipient;
import com.pulumi.databricks.RecipientArgs;
import com.pulumi.databricks.inputs.RecipientIpAccessListArgs;
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 db2opensharecode = new RandomPassword("db2opensharecode", RandomPasswordArgs.builder()        
            .length(16)
            .special(true)
            .build());

        final var current = DatabricksFunctions.getCurrentUser();

        var db2open = new Recipient("db2open", RecipientArgs.builder()        
            .comment("made by terraform")
            .authenticationType("TOKEN")
            .sharingCode(db2opensharecode.result())
            .ipAccessList(RecipientIpAccessListArgs.builder()
                .allowedIpAddresses()
                .build())
            .build());

    }
}
import pulumi
import pulumi_databricks as databricks
import pulumi_random as random

db2opensharecode = random.RandomPassword("db2opensharecode",
    length=16,
    special=True)
current = databricks.get_current_user()
db2open = databricks.Recipient("db2open",
    comment="made by terraform",
    authentication_type="TOKEN",
    sharing_code=db2opensharecode.result,
    ip_access_list=databricks.RecipientIpAccessListArgs(
        allowed_ip_addresses=[],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
import * as random from "@pulumi/random";

const db2opensharecode = new random.RandomPassword("db2opensharecode", {
    length: 16,
    special: true,
});
const current = databricks.getCurrentUser({});
const db2open = new databricks.Recipient("db2open", {
    comment: "made by terraform",
    authenticationType: "TOKEN",
    sharingCode: db2opensharecode.result,
    ipAccessList: {
        allowedIpAddresses: [],
    },
});
resources:
  db2opensharecode:
    type: random:RandomPassword
    properties:
      length: 16
      special: true
  db2open:
    type: databricks:Recipient
    properties:
      comment: made by terraform
      authenticationType: TOKEN
      sharingCode: ${db2opensharecode.result}
      ipAccessList:
        allowedIpAddresses: []
variables:
  current:
    fn::invoke:
      Function: databricks:getCurrentUser
      Arguments: {}

Create Recipient Resource

new Recipient(name: string, args: RecipientArgs, opts?: CustomResourceOptions);
@overload
def Recipient(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              authentication_type: Optional[str] = None,
              comment: Optional[str] = None,
              data_recipient_global_metastore_id: Optional[str] = None,
              ip_access_list: Optional[RecipientIpAccessListArgs] = None,
              name: Optional[str] = None,
              sharing_code: Optional[str] = None,
              tokens: Optional[Sequence[RecipientTokenArgs]] = None)
@overload
def Recipient(resource_name: str,
              args: RecipientArgs,
              opts: Optional[ResourceOptions] = None)
func NewRecipient(ctx *Context, name string, args RecipientArgs, opts ...ResourceOption) (*Recipient, error)
public Recipient(string name, RecipientArgs args, CustomResourceOptions? opts = null)
public Recipient(String name, RecipientArgs args)
public Recipient(String name, RecipientArgs args, CustomResourceOptions options)
type: databricks:Recipient
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

AuthenticationType string

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

Comment string

Description about the recipient.

DataRecipientGlobalMetastoreId string

Required when authentication_type is DATABRICKS.

IpAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

Name string

Name of recipient. Change forces creation of a new resource.

SharingCode string

The one-time sharing code provided by the data recipient.

Tokens List<RecipientTokenArgs>

List of Recipient Tokens.

AuthenticationType string

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

Comment string

Description about the recipient.

DataRecipientGlobalMetastoreId string

Required when authentication_type is DATABRICKS.

IpAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

Name string

Name of recipient. Change forces creation of a new resource.

SharingCode string

The one-time sharing code provided by the data recipient.

Tokens []RecipientTokenArgs

List of Recipient Tokens.

authenticationType String

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment String

Description about the recipient.

dataRecipientGlobalMetastoreId String

Required when authentication_type is DATABRICKS.

ipAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

name String

Name of recipient. Change forces creation of a new resource.

sharingCode String

The one-time sharing code provided by the data recipient.

tokens List<RecipientTokenArgs>

List of Recipient Tokens.

authenticationType string

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment string

Description about the recipient.

dataRecipientGlobalMetastoreId string

Required when authentication_type is DATABRICKS.

ipAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

name string

Name of recipient. Change forces creation of a new resource.

sharingCode string

The one-time sharing code provided by the data recipient.

tokens RecipientTokenArgs[]

List of Recipient Tokens.

authentication_type str

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment str

Description about the recipient.

data_recipient_global_metastore_id str

Required when authentication_type is DATABRICKS.

ip_access_list RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

name str

Name of recipient. Change forces creation of a new resource.

sharing_code str

The one-time sharing code provided by the data recipient.

tokens Sequence[RecipientTokenArgs]

List of Recipient Tokens.

authenticationType String

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment String

Description about the recipient.

dataRecipientGlobalMetastoreId String

Required when authentication_type is DATABRICKS.

ipAccessList Property Map

The one-time sharing code provided by the data recipient.

name String

Name of recipient. Change forces creation of a new resource.

sharingCode String

The one-time sharing code provided by the data recipient.

tokens List<Property Map>

List of Recipient Tokens.

Outputs

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

Get an existing Recipient 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?: RecipientState, opts?: CustomResourceOptions): Recipient
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        authentication_type: Optional[str] = None,
        comment: Optional[str] = None,
        data_recipient_global_metastore_id: Optional[str] = None,
        ip_access_list: Optional[RecipientIpAccessListArgs] = None,
        name: Optional[str] = None,
        sharing_code: Optional[str] = None,
        tokens: Optional[Sequence[RecipientTokenArgs]] = None) -> Recipient
func GetRecipient(ctx *Context, name string, id IDInput, state *RecipientState, opts ...ResourceOption) (*Recipient, error)
public static Recipient Get(string name, Input<string> id, RecipientState? state, CustomResourceOptions? opts = null)
public static Recipient get(String name, Output<String> id, RecipientState 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:
AuthenticationType string

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

Comment string

Description about the recipient.

DataRecipientGlobalMetastoreId string

Required when authentication_type is DATABRICKS.

IpAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

Name string

Name of recipient. Change forces creation of a new resource.

SharingCode string

The one-time sharing code provided by the data recipient.

Tokens List<RecipientTokenArgs>

List of Recipient Tokens.

AuthenticationType string

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

Comment string

Description about the recipient.

DataRecipientGlobalMetastoreId string

Required when authentication_type is DATABRICKS.

IpAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

Name string

Name of recipient. Change forces creation of a new resource.

SharingCode string

The one-time sharing code provided by the data recipient.

Tokens []RecipientTokenArgs

List of Recipient Tokens.

authenticationType String

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment String

Description about the recipient.

dataRecipientGlobalMetastoreId String

Required when authentication_type is DATABRICKS.

ipAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

name String

Name of recipient. Change forces creation of a new resource.

sharingCode String

The one-time sharing code provided by the data recipient.

tokens List<RecipientTokenArgs>

List of Recipient Tokens.

authenticationType string

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment string

Description about the recipient.

dataRecipientGlobalMetastoreId string

Required when authentication_type is DATABRICKS.

ipAccessList RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

name string

Name of recipient. Change forces creation of a new resource.

sharingCode string

The one-time sharing code provided by the data recipient.

tokens RecipientTokenArgs[]

List of Recipient Tokens.

authentication_type str

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment str

Description about the recipient.

data_recipient_global_metastore_id str

Required when authentication_type is DATABRICKS.

ip_access_list RecipientIpAccessListArgs

The one-time sharing code provided by the data recipient.

name str

Name of recipient. Change forces creation of a new resource.

sharing_code str

The one-time sharing code provided by the data recipient.

tokens Sequence[RecipientTokenArgs]

List of Recipient Tokens.

authenticationType String

The delta sharing authentication type. Valid values are TOKEN and DATABRICKS.

comment String

Description about the recipient.

dataRecipientGlobalMetastoreId String

Required when authentication_type is DATABRICKS.

ipAccessList Property Map

The one-time sharing code provided by the data recipient.

name String

Name of recipient. Change forces creation of a new resource.

sharingCode String

The one-time sharing code provided by the data recipient.

tokens List<Property Map>

List of Recipient Tokens.

Supporting Types

RecipientIpAccessList

AllowedIpAddresses List<string>

Allowed IP Addresses in CIDR notation. Limit of 100.

AllowedIpAddresses []string

Allowed IP Addresses in CIDR notation. Limit of 100.

allowedIpAddresses List<String>

Allowed IP Addresses in CIDR notation. Limit of 100.

allowedIpAddresses string[]

Allowed IP Addresses in CIDR notation. Limit of 100.

allowed_ip_addresses Sequence[str]

Allowed IP Addresses in CIDR notation. Limit of 100.

allowedIpAddresses List<String>

Allowed IP Addresses in CIDR notation. Limit of 100.

RecipientToken

activationUrl String
createdAt Integer
createdBy String
expirationTime Integer
id String
updatedAt Integer
updatedBy String
activationUrl string
createdAt number
createdBy string
expirationTime number
id string
updatedAt number
updatedBy string
activationUrl String
createdAt Number
createdBy String
expirationTime Number
id String
updatedAt Number
updatedBy String

Package Details

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

This Pulumi package is based on the databricks Terraform Provider.