databricks.Share
Explore with Pulumi AI
Within a metastore, Unity Catalog provides the ability to create a share, which is a named object that contains a collection of tables in a metastore that you want to share as a group. A share can contain tables from only a single metastore. You can add or remove tables from a share at any time.
A databricks.Share
is contained within databricks.Metastore and can contain a list of tables.
Related Resources
The following resources are often used in the same context:
- databricks.Recipient to create Delta Sharing recipients.
- databricks.Grants to manage Delta Sharing permissions.
- databricks.getShares to read existing Delta Sharing shares.
Example Usage
Creating a Delta Sharing share and add some existing tables to it
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.DatabricksFunctions;
import com.pulumi.databricks.inputs.GetTablesArgs;
import com.pulumi.databricks.Share;
import com.pulumi.databricks.ShareArgs;
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) {
final var things = DatabricksFunctions.getTables(GetTablesArgs.builder()
.catalogName("sandbox")
.schemaName("things")
.build());
var some = new Share("some", ShareArgs.builder()
.dynamic(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build());
}
}
Coming soon!
Coming soon!
resources:
some:
type: databricks:Share
properties:
dynamic:
- forEach: ${things.ids}
content:
- name: ${object.value}
dataObjectType: TABLE
variables:
things:
fn::invoke:
Function: databricks:getTables
Arguments:
catalogName: sandbox
schemaName: things
Creating a Delta Sharing share and share a table with partitions spec and history
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.Share;
import com.pulumi.databricks.ShareArgs;
import com.pulumi.databricks.inputs.ShareObjectArgs;
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 some = new Share("some", ShareArgs.builder()
.objects(ShareObjectArgs.builder()
.dataObjectType("TABLE")
.historyDataSharingStatus("ENABLED")
.name("my_catalog.my_schema.my_table")
.partitions(
ShareObjectPartitionArgs.builder()
.value(
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build(),
ShareObjectPartitionArgs.builder()
.value(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build())
.build())
.build());
}
}
Coming soon!
Coming soon!
resources:
some:
type: databricks:Share
properties:
objects:
- dataObjectType: TABLE
historyDataSharingStatus: ENABLED
name: my_catalog.my_schema.my_table
partitions:
- value:
- name: year
op: EQUAL
value: '2009'
- name: month
op: EQUAL
value: '12'
- value:
- name: year
op: EQUAL
value: '2010'
Create Share Resource
new Share(name: string, args?: ShareArgs, opts?: CustomResourceOptions);
@overload
def Share(resource_name: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[int] = None,
created_by: Optional[str] = None,
name: Optional[str] = None,
objects: Optional[Sequence[ShareObjectArgs]] = None)
@overload
def Share(resource_name: str,
args: Optional[ShareArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewShare(ctx *Context, name string, args *ShareArgs, opts ...ResourceOption) (*Share, error)
public Share(string name, ShareArgs? args = null, CustomResourceOptions? opts = null)
type: databricks:Share
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ShareArgs
- 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 ShareArgs
- 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 ShareArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ShareArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ShareArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Share 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 Share resource accepts the following input properties:
- Created
At int Time when the share was created.
- Created
By string The principal that created the share.
- Name string
Name of share. Change forces creation of a new resource.
- Objects
List<Share
Object Args>
- Created
At int Time when the share was created.
- Created
By string The principal that created the share.
- Name string
Name of share. Change forces creation of a new resource.
- Objects
[]Share
Object Args
- created
At Integer Time when the share was created.
- created
By String The principal that created the share.
- name String
Name of share. Change forces creation of a new resource.
- objects
List<Share
Object Args>
- created
At number Time when the share was created.
- created
By string The principal that created the share.
- name string
Name of share. Change forces creation of a new resource.
- objects
Share
Object Args[]
- created_
at int Time when the share was created.
- created_
by str The principal that created the share.
- name str
Name of share. Change forces creation of a new resource.
- objects
Sequence[Share
Object Args]
- created
At Number Time when the share was created.
- created
By String The principal that created the share.
- name String
Name of share. Change forces creation of a new resource.
- objects List<Property Map>
Outputs
All input properties are implicitly available as output properties. Additionally, the Share 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 Share Resource
Get an existing Share 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?: ShareState, opts?: CustomResourceOptions): Share
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[int] = None,
created_by: Optional[str] = None,
name: Optional[str] = None,
objects: Optional[Sequence[ShareObjectArgs]] = None) -> Share
func GetShare(ctx *Context, name string, id IDInput, state *ShareState, opts ...ResourceOption) (*Share, error)
public static Share Get(string name, Input<string> id, ShareState? state, CustomResourceOptions? opts = null)
public static Share get(String name, Output<String> id, ShareState 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.
- Created
At int Time when the share was created.
- Created
By string The principal that created the share.
- Name string
Name of share. Change forces creation of a new resource.
- Objects
List<Share
Object Args>
- Created
At int Time when the share was created.
- Created
By string The principal that created the share.
- Name string
Name of share. Change forces creation of a new resource.
- Objects
[]Share
Object Args
- created
At Integer Time when the share was created.
- created
By String The principal that created the share.
- name String
Name of share. Change forces creation of a new resource.
- objects
List<Share
Object Args>
- created
At number Time when the share was created.
- created
By string The principal that created the share.
- name string
Name of share. Change forces creation of a new resource.
- objects
Share
Object Args[]
- created_
at int Time when the share was created.
- created_
by str The principal that created the share.
- name str
Name of share. Change forces creation of a new resource.
- objects
Sequence[Share
Object Args]
- created
At Number Time when the share was created.
- created
By String The principal that created the share.
- name String
Name of share. Change forces creation of a new resource.
- objects List<Property Map>
Supporting Types
ShareObject
- Data
Object stringType Type of the object, currently only
TABLE
is allowed.- Name string
Full name of the object, e.g.
catalog.schema.name
for a table.- Added
At int - Added
By string - Cdf
Enabled bool Whether to enable Change Data Feed (cdf) on the shared object. When this field is set, field
history_data_sharing_status
can not be set.- Comment string
Description about the object.
- History
Data stringSharing Status Whether to enable history sharing, one of:
ENABLED
,DISABLED
. When a table has history sharing enabled, recipients can query table data by version, starting from the current table version. If not specified, clients can only query starting from the version of the object at the time it was added to the share. NOTE: The start_version should be less than or equal the current version of the object. When this field is set, fieldcdf_enabled
can not be set.To share only part of a table when you add the table to a share, you can provide partition specifications. This is specified by a number of
partition
blocks. Each entry inpartition
block takes a list ofvalue
blocks. The field is documented below.- Partitions
List<Share
Object Partition> - string
A user-provided new name for the data object within the share. If this new name is not provided, the object's original name will be used as the
shared_as
name. Theshared_as
name must be unique within a Share.- Start
Version int The start version associated with the object for cdf. This allows data providers to control the lowest object version that is accessible by clients.
- Status string
Status of the object, one of:
ACTIVE
,PERMISSION_DENIED
.
- Data
Object stringType Type of the object, currently only
TABLE
is allowed.- Name string
Full name of the object, e.g.
catalog.schema.name
for a table.- Added
At int - Added
By string - Cdf
Enabled bool Whether to enable Change Data Feed (cdf) on the shared object. When this field is set, field
history_data_sharing_status
can not be set.- Comment string
Description about the object.
- History
Data stringSharing Status Whether to enable history sharing, one of:
ENABLED
,DISABLED
. When a table has history sharing enabled, recipients can query table data by version, starting from the current table version. If not specified, clients can only query starting from the version of the object at the time it was added to the share. NOTE: The start_version should be less than or equal the current version of the object. When this field is set, fieldcdf_enabled
can not be set.To share only part of a table when you add the table to a share, you can provide partition specifications. This is specified by a number of
partition
blocks. Each entry inpartition
block takes a list ofvalue
blocks. The field is documented below.- Partitions
[]Share
Object Partition - string
A user-provided new name for the data object within the share. If this new name is not provided, the object's original name will be used as the
shared_as
name. Theshared_as
name must be unique within a Share.- Start
Version int The start version associated with the object for cdf. This allows data providers to control the lowest object version that is accessible by clients.
- Status string
Status of the object, one of:
ACTIVE
,PERMISSION_DENIED
.
- data
Object StringType Type of the object, currently only
TABLE
is allowed.- name String
Full name of the object, e.g.
catalog.schema.name
for a table.- added
At Integer - added
By String - cdf
Enabled Boolean Whether to enable Change Data Feed (cdf) on the shared object. When this field is set, field
history_data_sharing_status
can not be set.- comment String
Description about the object.
- history
Data StringSharing Status Whether to enable history sharing, one of:
ENABLED
,DISABLED
. When a table has history sharing enabled, recipients can query table data by version, starting from the current table version. If not specified, clients can only query starting from the version of the object at the time it was added to the share. NOTE: The start_version should be less than or equal the current version of the object. When this field is set, fieldcdf_enabled
can not be set.To share only part of a table when you add the table to a share, you can provide partition specifications. This is specified by a number of
partition
blocks. Each entry inpartition
block takes a list ofvalue
blocks. The field is documented below.- partitions
List<Share
Object Partition> - String
A user-provided new name for the data object within the share. If this new name is not provided, the object's original name will be used as the
shared_as
name. Theshared_as
name must be unique within a Share.- start
Version Integer The start version associated with the object for cdf. This allows data providers to control the lowest object version that is accessible by clients.
- status String
Status of the object, one of:
ACTIVE
,PERMISSION_DENIED
.
- data
Object stringType Type of the object, currently only
TABLE
is allowed.- name string
Full name of the object, e.g.
catalog.schema.name
for a table.- added
At number - added
By string - cdf
Enabled boolean Whether to enable Change Data Feed (cdf) on the shared object. When this field is set, field
history_data_sharing_status
can not be set.- comment string
Description about the object.
- history
Data stringSharing Status Whether to enable history sharing, one of:
ENABLED
,DISABLED
. When a table has history sharing enabled, recipients can query table data by version, starting from the current table version. If not specified, clients can only query starting from the version of the object at the time it was added to the share. NOTE: The start_version should be less than or equal the current version of the object. When this field is set, fieldcdf_enabled
can not be set.To share only part of a table when you add the table to a share, you can provide partition specifications. This is specified by a number of
partition
blocks. Each entry inpartition
block takes a list ofvalue
blocks. The field is documented below.- partitions
Share
Object Partition[] - string
A user-provided new name for the data object within the share. If this new name is not provided, the object's original name will be used as the
shared_as
name. Theshared_as
name must be unique within a Share.- start
Version number The start version associated with the object for cdf. This allows data providers to control the lowest object version that is accessible by clients.
- status string
Status of the object, one of:
ACTIVE
,PERMISSION_DENIED
.
- data_
object_ strtype Type of the object, currently only
TABLE
is allowed.- name str
Full name of the object, e.g.
catalog.schema.name
for a table.- added_
at int - added_
by str - cdf_
enabled bool Whether to enable Change Data Feed (cdf) on the shared object. When this field is set, field
history_data_sharing_status
can not be set.- comment str
Description about the object.
- history_
data_ strsharing_ status Whether to enable history sharing, one of:
ENABLED
,DISABLED
. When a table has history sharing enabled, recipients can query table data by version, starting from the current table version. If not specified, clients can only query starting from the version of the object at the time it was added to the share. NOTE: The start_version should be less than or equal the current version of the object. When this field is set, fieldcdf_enabled
can not be set.To share only part of a table when you add the table to a share, you can provide partition specifications. This is specified by a number of
partition
blocks. Each entry inpartition
block takes a list ofvalue
blocks. The field is documented below.- partitions
Sequence[Share
Object Partition] - str
A user-provided new name for the data object within the share. If this new name is not provided, the object's original name will be used as the
shared_as
name. Theshared_as
name must be unique within a Share.- start_
version int The start version associated with the object for cdf. This allows data providers to control the lowest object version that is accessible by clients.
- status str
Status of the object, one of:
ACTIVE
,PERMISSION_DENIED
.
- data
Object StringType Type of the object, currently only
TABLE
is allowed.- name String
Full name of the object, e.g.
catalog.schema.name
for a table.- added
At Number - added
By String - cdf
Enabled Boolean Whether to enable Change Data Feed (cdf) on the shared object. When this field is set, field
history_data_sharing_status
can not be set.- comment String
Description about the object.
- history
Data StringSharing Status Whether to enable history sharing, one of:
ENABLED
,DISABLED
. When a table has history sharing enabled, recipients can query table data by version, starting from the current table version. If not specified, clients can only query starting from the version of the object at the time it was added to the share. NOTE: The start_version should be less than or equal the current version of the object. When this field is set, fieldcdf_enabled
can not be set.To share only part of a table when you add the table to a share, you can provide partition specifications. This is specified by a number of
partition
blocks. Each entry inpartition
block takes a list ofvalue
blocks. The field is documented below.- partitions List<Property Map>
- String
A user-provided new name for the data object within the share. If this new name is not provided, the object's original name will be used as the
shared_as
name. Theshared_as
name must be unique within a Share.- start
Version Number The start version associated with the object for cdf. This allows data providers to control the lowest object version that is accessible by clients.
- status String
Status of the object, one of:
ACTIVE
,PERMISSION_DENIED
.
ShareObjectPartition
ShareObjectPartitionValue
- Name string
The name of the partition column.
- Op string
The operator to apply for the value, one of:
EQUAL
,LIKE
- Recipient
Property stringKey The key of a Delta Sharing recipient's property. For example
databricks-account-id
. When this field is set, fieldvalue
can not be set.- Value string
The value of the partition column. When this value is not set, it means null value. When this field is set, field
recipient_property_key
can not be set.
- Name string
The name of the partition column.
- Op string
The operator to apply for the value, one of:
EQUAL
,LIKE
- Recipient
Property stringKey The key of a Delta Sharing recipient's property. For example
databricks-account-id
. When this field is set, fieldvalue
can not be set.- Value string
The value of the partition column. When this value is not set, it means null value. When this field is set, field
recipient_property_key
can not be set.
- name String
The name of the partition column.
- op String
The operator to apply for the value, one of:
EQUAL
,LIKE
- recipient
Property StringKey The key of a Delta Sharing recipient's property. For example
databricks-account-id
. When this field is set, fieldvalue
can not be set.- value String
The value of the partition column. When this value is not set, it means null value. When this field is set, field
recipient_property_key
can not be set.
- name string
The name of the partition column.
- op string
The operator to apply for the value, one of:
EQUAL
,LIKE
- recipient
Property stringKey The key of a Delta Sharing recipient's property. For example
databricks-account-id
. When this field is set, fieldvalue
can not be set.- value string
The value of the partition column. When this value is not set, it means null value. When this field is set, field
recipient_property_key
can not be set.
- name str
The name of the partition column.
- op str
The operator to apply for the value, one of:
EQUAL
,LIKE
- recipient_
property_ strkey The key of a Delta Sharing recipient's property. For example
databricks-account-id
. When this field is set, fieldvalue
can not be set.- value str
The value of the partition column. When this value is not set, it means null value. When this field is set, field
recipient_property_key
can not be set.
- name String
The name of the partition column.
- op String
The operator to apply for the value, one of:
EQUAL
,LIKE
- recipient
Property StringKey The key of a Delta Sharing recipient's property. For example
databricks-account-id
. When this field is set, fieldvalue
can not be set.- value String
The value of the partition column. When this value is not set, it means null value. When this field is set, field
recipient_property_key
can not be set.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
databricks
Terraform Provider.