@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
153 lines • 7.1 kB
JavaScript
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Volume = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > 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>
* ```
*/
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, id, state, opts) {
return new Volume(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Volume.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["catalogName"] = state ? state.catalogName : undefined;
resourceInputs["comment"] = state ? state.comment : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["owner"] = state ? state.owner : undefined;
resourceInputs["schemaName"] = state ? state.schemaName : undefined;
resourceInputs["storageLocation"] = state ? state.storageLocation : undefined;
resourceInputs["volumePath"] = state ? state.volumePath : undefined;
resourceInputs["volumeType"] = state ? state.volumeType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.catalogName === undefined) && !opts.urn) {
throw new Error("Missing required property 'catalogName'");
}
if ((!args || args.schemaName === undefined) && !opts.urn) {
throw new Error("Missing required property 'schemaName'");
}
if ((!args || args.volumeType === undefined) && !opts.urn) {
throw new Error("Missing required property 'volumeType'");
}
resourceInputs["catalogName"] = args ? args.catalogName : undefined;
resourceInputs["comment"] = args ? args.comment : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["owner"] = args ? args.owner : undefined;
resourceInputs["schemaName"] = args ? args.schemaName : undefined;
resourceInputs["storageLocation"] = args ? args.storageLocation : undefined;
resourceInputs["volumeType"] = args ? args.volumeType : undefined;
resourceInputs["volumePath"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Volume.__pulumiType, name, resourceInputs, opts);
}
}
exports.Volume = Volume;
/** @internal */
Volume.__pulumiType = 'databricks:index/volume:Volume';
//# sourceMappingURL=volume.js.map
;