UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

208 lines (207 loc) 7.71 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * > This resource can only be used with a workspace-level provider! * * In Delta Sharing, a share is a read-only collection of tables and table partitions that a provider wants to share with one or more recipients. If your recipient uses a Unity Catalog-enabled Databricks workspace, you can also include notebook files, views (including dynamic views that restrict access at the row and column level), Unity Catalog volumes, and Unity Catalog models in a share. * * In a Unity Catalog-enabled Databricks workspace, a share is a securable object registered in Unity Catalog. A `databricks.Share` is contained within a databricks_metastore. If you remove a share from your Unity Catalog metastore, all recipients of that share lose the ability to access it. * * ## Example Usage * * > In Pulumi configuration, it is recommended to define objects in alphabetical order of their `name` arguments, so that you get consistent and readable diff. Whenever objects are added or removed, or `name` is renamed, you'll observe a change in the majority of tasks. It's related to the fact that the current version of the provider treats `object` blocks as an ordered list. Alternatively, `object` block could have been an unordered set, though end-users would see the entire block replaced upon a change in single property of the task. * * Creating a Delta Sharing share and add some existing tables to it * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const things = databricks.getTables({ * catalogName: "sandbox", * schemaName: "things", * }); * const some = new databricks.Share("some", { * objects: .map(entry => ({ * name: entry.value, * dataObjectType: "TABLE", * })), * name: "my_share", * }); * ``` * * Creating a Delta Sharing share and add a schema to it(including all current and future tables). * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const schemaShare = new databricks.Share("schema_share", { * name: "schema_share", * objects: [{ * name: "catalog_name.schema_name", * dataObjectType: "SCHEMA", * historyDataSharingStatus: "ENABLED", * }], * }); * ``` * * Creating a Delta Sharing share and share a table with partitions spec and history * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const some = new databricks.Share("some", { * name: "my_share", * objects: [{ * name: "my_catalog.my_schema.my_table", * dataObjectType: "TABLE", * historyDataSharingStatus: "ENABLED", * partitions: [ * { * values: [ * { * name: "year", * op: "EQUAL", * value: "2009", * }, * { * name: "month", * op: "EQUAL", * value: "12", * }, * ], * }, * { * values: [{ * name: "year", * op: "EQUAL", * value: "2010", * }], * }, * ], * }], * }); * ``` * * ## 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. * * ## Import * * The share resource can be imported using the name of the share. * * bash * * ```sh * $ pulumi import databricks:index/share:Share this <share_name> * ``` */ export declare class Share extends pulumi.CustomResource { /** * Get an existing Share resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ShareState, opts?: pulumi.CustomResourceOptions): Share; /** * Returns true if the given object is an instance of Share. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Share; readonly comment: pulumi.Output<string | undefined>; /** * Time when the share was created. */ readonly createdAt: pulumi.Output<number>; /** * The principal that created the share. */ readonly createdBy: pulumi.Output<string>; /** * Name of share. Change forces creation of a new resource. */ readonly name: pulumi.Output<string>; readonly objects: pulumi.Output<outputs.ShareObject[] | undefined>; /** * User name/group name/sp applicationId of the share owner. */ readonly owner: pulumi.Output<string | undefined>; readonly storageLocation: pulumi.Output<string | undefined>; readonly storageRoot: pulumi.Output<string | undefined>; readonly updatedAt: pulumi.Output<number>; readonly updatedBy: pulumi.Output<string>; /** * Create a Share resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: ShareArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Share resources. */ export interface ShareState { comment?: pulumi.Input<string>; /** * Time when the share was created. */ createdAt?: pulumi.Input<number>; /** * The principal that created the share. */ createdBy?: pulumi.Input<string>; /** * Name of share. Change forces creation of a new resource. */ name?: pulumi.Input<string>; objects?: pulumi.Input<pulumi.Input<inputs.ShareObject>[]>; /** * User name/group name/sp applicationId of the share owner. */ owner?: pulumi.Input<string>; storageLocation?: pulumi.Input<string>; storageRoot?: pulumi.Input<string>; updatedAt?: pulumi.Input<number>; updatedBy?: pulumi.Input<string>; } /** * The set of arguments for constructing a Share resource. */ export interface ShareArgs { comment?: pulumi.Input<string>; /** * Time when the share was created. */ createdAt?: pulumi.Input<number>; /** * The principal that created the share. */ createdBy?: pulumi.Input<string>; /** * Name of share. Change forces creation of a new resource. */ name?: pulumi.Input<string>; objects?: pulumi.Input<pulumi.Input<inputs.ShareObject>[]>; /** * User name/group name/sp applicationId of the share owner. */ owner?: pulumi.Input<string>; storageLocation?: pulumi.Input<string>; storageRoot?: pulumi.Input<string>; updatedAt?: pulumi.Input<number>; updatedBy?: pulumi.Input<string>; }