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.
Related Resources
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:
- Authentication
Type string The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- Comment string
Description about the recipient.
- Data
Recipient stringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- Ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- Name string
Name of recipient. Change forces creation of a new resource.
- string
The one-time sharing code provided by the data recipient.
- Tokens
List<Recipient
Token Args> List of Recipient Tokens.
- Authentication
Type string The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- Comment string
Description about the recipient.
- Data
Recipient stringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- Ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- Name string
Name of recipient. Change forces creation of a new resource.
- string
The one-time sharing code provided by the data recipient.
- Tokens
[]Recipient
Token Args List of Recipient Tokens.
- authentication
Type String The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment String
Description about the recipient.
- data
Recipient StringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- name String
Name of recipient. Change forces creation of a new resource.
- String
The one-time sharing code provided by the data recipient.
- tokens
List<Recipient
Token Args> List of Recipient Tokens.
- authentication
Type string The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment string
Description about the recipient.
- data
Recipient stringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- name string
Name of recipient. Change forces creation of a new resource.
- string
The one-time sharing code provided by the data recipient.
- tokens
Recipient
Token Args[] List of Recipient Tokens.
- authentication_
type str The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment str
Description about the recipient.
- data_
recipient_ strglobal_ metastore_ id Required when authentication_type is DATABRICKS.
- ip_
access_ Recipientlist Ip Access List Args The one-time sharing code provided by the data recipient.
- name str
Name of recipient. Change forces creation of a new resource.
- str
The one-time sharing code provided by the data recipient.
- tokens
Sequence[Recipient
Token Args] List of Recipient Tokens.
- authentication
Type String The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment String
Description about the recipient.
- data
Recipient StringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- ip
Access Property MapList The one-time sharing code provided by the data recipient.
- name String
Name of recipient. Change forces creation of a new resource.
- 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.
- Authentication
Type string The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- Comment string
Description about the recipient.
- Data
Recipient stringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- Ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- Name string
Name of recipient. Change forces creation of a new resource.
- Sharing
Code string The one-time sharing code provided by the data recipient.
- Tokens
List<Recipient
Token Args> List of Recipient Tokens.
- Authentication
Type string The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- Comment string
Description about the recipient.
- Data
Recipient stringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- Ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- Name string
Name of recipient. Change forces creation of a new resource.
- Sharing
Code string The one-time sharing code provided by the data recipient.
- Tokens
[]Recipient
Token Args List of Recipient Tokens.
- authentication
Type String The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment String
Description about the recipient.
- data
Recipient StringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- name String
Name of recipient. Change forces creation of a new resource.
- sharing
Code String The one-time sharing code provided by the data recipient.
- tokens
List<Recipient
Token Args> List of Recipient Tokens.
- authentication
Type string The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment string
Description about the recipient.
- data
Recipient stringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- ip
Access RecipientList Ip Access List Args The one-time sharing code provided by the data recipient.
- name string
Name of recipient. Change forces creation of a new resource.
- sharing
Code string The one-time sharing code provided by the data recipient.
- tokens
Recipient
Token Args[] List of Recipient Tokens.
- authentication_
type str The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment str
Description about the recipient.
- data_
recipient_ strglobal_ metastore_ id Required when authentication_type is DATABRICKS.
- ip_
access_ Recipientlist Ip Access List Args 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[Recipient
Token Args] List of Recipient Tokens.
- authentication
Type String The delta sharing authentication type. Valid values are
TOKEN
andDATABRICKS
.- comment String
Description about the recipient.
- data
Recipient StringGlobal Metastore Id Required when authentication_type is DATABRICKS.
- ip
Access Property MapList The one-time sharing code provided by the data recipient.
- name String
Name of recipient. Change forces creation of a new resource.
- sharing
Code String The one-time sharing code provided by the data recipient.
- tokens List<Property Map>
List of Recipient Tokens.
Supporting Types
RecipientIpAccessList
- Allowed
Ip List<string>Addresses Allowed IP Addresses in CIDR notation. Limit of 100.
- Allowed
Ip []stringAddresses Allowed IP Addresses in CIDR notation. Limit of 100.
- allowed
Ip List<String>Addresses Allowed IP Addresses in CIDR notation. Limit of 100.
- allowed
Ip string[]Addresses Allowed IP Addresses in CIDR notation. Limit of 100.
- allowed_
ip_ Sequence[str]addresses Allowed IP Addresses in CIDR notation. Limit of 100.
- allowed
Ip List<String>Addresses Allowed IP Addresses in CIDR notation. Limit of 100.
RecipientToken
- Activation
Url string - Created
At int - Created
By string - Expiration
Time int - Id string
- Updated
At int - Updated
By string
- Activation
Url string - Created
At int - Created
By string - Expiration
Time int - Id string
- Updated
At int - Updated
By string
- activation
Url String - created
At Integer - created
By String - expiration
Time Integer - id String
- updated
At Integer - updated
By String
- activation
Url string - created
At number - created
By string - expiration
Time number - id string
- updated
At number - updated
By string
- activation_
url str - created_
at int - created_
by str - expiration_
time int - id str
- updated_
at int - updated_
by str
- activation
Url String - created
At Number - created
By String - expiration
Time Number - id String
- updated
At Number - updated
By String
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
databricks
Terraform Provider.