UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

210 lines (209 loc) 7.94 kB
import * as pulumi from "@pulumi/pulumi"; /** * > This resource can only be used with a workspace-level provider! * * Volumes are Unity Catalog objects representing a logical volume of storage in a cloud object storage location. Volumes provide capabilities for accessing, storing, governing, and organizing files. While tables provide governance over tabular datasets, volumes add governance over non-tabular datasets. You can use volumes to store and access files in any format, including structured, semi-structured, and unstructured data. * * A volume resides in the third layer of Unity Catalog’s three-level namespace. Volumes are siblings to tables, views, and other objects organized under a schema in Unity Catalog. * * A volume can be **managed** or **external**. * * A **managed volume** is a Unity Catalog-governed storage volume created within the default storage location of the containing schema. Managed volumes allow the creation of governed storage for working with files without the overhead of external locations and storage credentials. You do not need to specify a location when creating a managed volume, and all file access for data in managed volumes is through paths managed by Unity Catalog. * * An **external volume** is a Unity Catalog-governed storage volume registered against a directory within an external location. * * A volume can be referenced using its identifier: ```<catalogName>.<schemaName>.<volumeName>```, where: * * * ```<catalogName>```: The name of the catalog containing the Volume. * * ```<schemaName>```: The name of the schema containing the Volume. * * ```<volumeName>```: The name of the Volume. It identifies the volume object. * * The path to access files in volumes uses the following format: * * ```/Volumes/<catalog>/<schema>/<volume>/<path>/<file_name>``` * * Databricks also supports an optional ```dbfs:/``` scheme, so the following path also works: * * ```dbfs:/Volumes/<catalog>/<schema>/<volume>/<path>/<file_name>``` * * This resource manages Volumes in Unity Catalog. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const sandbox = new databricks.Catalog("sandbox", { * name: "sandbox", * comment: "this catalog is managed by terraform", * properties: { * purpose: "testing", * }, * }); * const things = new databricks.Schema("things", { * catalogName: sandbox.name, * name: "things", * comment: "this schema is managed by terraform", * properties: { * kind: "various", * }, * }); * const external = new databricks.StorageCredential("external", { * name: "creds", * awsIamRole: { * roleArn: externalDataAccess.arn, * }, * }); * const some = new databricks.ExternalLocation("some", { * name: "external_location", * url: `s3://${externalAwsS3Bucket.id}/some`, * credentialName: external.name, * }); * const _this = new databricks.Volume("this", { * name: "quickstart_volume", * catalogName: sandbox.name, * schemaName: things.name, * volumeType: "EXTERNAL", * storageLocation: some.url, * comment: "this volume is managed by terraform", * }); * ``` * * ## Import * * This resource can be imported by `full_name` which is the 3-level Volume identifier: `<catalog>.<schema>.<name>` * * bash * * ```sh * $ pulumi import databricks:index/volume:Volume this <catalog_name>.<schema_name>.<name> * ``` */ export declare class Volume extends pulumi.CustomResource { /** * Get an existing Volume 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?: VolumeState, opts?: pulumi.CustomResourceOptions): Volume; /** * Returns true if the given object is an instance of Volume. 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 Volume; /** * Name of parent Catalog. Change forces creation of a new resource. */ readonly catalogName: pulumi.Output<string>; /** * Free-form text. */ readonly comment: pulumi.Output<string | undefined>; /** * Name of the Volume */ readonly name: pulumi.Output<string>; /** * Name of the volume owner. */ readonly owner: pulumi.Output<string>; /** * Name of parent Schema relative to parent Catalog. Change forces creation of a new resource. */ readonly schemaName: pulumi.Output<string>; /** * Path inside an External Location. Only used for `EXTERNAL` Volumes. Change forces creation of a new resource. */ readonly storageLocation: pulumi.Output<string | undefined>; /** * base file path for this Unity Catalog Volume in form of `/Volumes/<catalog>/<schema>/<name>`. */ readonly volumePath: pulumi.Output<string>; /** * Volume type. `EXTERNAL` or `MANAGED`. Change forces creation of a new resource. */ readonly volumeType: pulumi.Output<string>; /** * Create a Volume 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: VolumeArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Volume resources. */ export interface VolumeState { /** * Name of parent Catalog. Change forces creation of a new resource. */ catalogName?: pulumi.Input<string>; /** * Free-form text. */ comment?: pulumi.Input<string>; /** * Name of the Volume */ name?: pulumi.Input<string>; /** * Name of the volume owner. */ owner?: pulumi.Input<string>; /** * Name of parent Schema relative to parent Catalog. Change forces creation of a new resource. */ schemaName?: pulumi.Input<string>; /** * Path inside an External Location. Only used for `EXTERNAL` Volumes. Change forces creation of a new resource. */ storageLocation?: pulumi.Input<string>; /** * base file path for this Unity Catalog Volume in form of `/Volumes/<catalog>/<schema>/<name>`. */ volumePath?: pulumi.Input<string>; /** * Volume type. `EXTERNAL` or `MANAGED`. Change forces creation of a new resource. */ volumeType?: pulumi.Input<string>; } /** * The set of arguments for constructing a Volume resource. */ export interface VolumeArgs { /** * Name of parent Catalog. Change forces creation of a new resource. */ catalogName: pulumi.Input<string>; /** * Free-form text. */ comment?: pulumi.Input<string>; /** * Name of the Volume */ name?: pulumi.Input<string>; /** * Name of the volume owner. */ owner?: pulumi.Input<string>; /** * Name of parent Schema relative to parent Catalog. Change forces creation of a new resource. */ schemaName: pulumi.Input<string>; /** * Path inside an External Location. Only used for `EXTERNAL` Volumes. Change forces creation of a new resource. */ storageLocation?: pulumi.Input<string>; /** * Volume type. `EXTERNAL` or `MANAGED`. Change forces creation of a new resource. */ volumeType: pulumi.Input<string>; }