UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

175 lines (174 loc) 5.99 kB
import * as pulumi from "@pulumi/pulumi"; /** * This resource allows uploading and downloading files in databricks_volume. * * Notes: * * * Currently the limit is 5GiB in octet-stream. * * Currently, only UC volumes are supported. The list of destinations may change. * * ## Example Usage * * In order to manage a file on Unity Catalog Volumes with Pulumi, you must specify the `source` attribute containing the full path to the file on the local filesystem. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * const sandbox = new databricks.Catalog("sandbox", { * metastoreId: thisDatabricksMetastore.id, * 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 _this = new databricks.Volume("this", { * name: "quickstart_volume", * catalogName: sandbox.name, * schemaName: things.name, * volumeType: "MANAGED", * comment: "this volume is managed by terraform", * }); * const thisFile = new databricks.File("this", { * source: "/full/path/on/local/system", * path: pulumi.interpolate`${_this.volumePath}/fileName`, * }); * ``` * * You can also inline sources through `contentBase64` attribute. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * import * as std from "@pulumi/std"; * * const initScript = new databricks.File("init_script", { * contentBase64: std.base64encode({ * input: `#!/bin/bash * echo "Hello World" * `, * }).then(invoke => invoke.result), * path: `${_this.volumePath}/fileName`, * }); * ``` * * ## Related Resources * * The following resources are often used in the same context: * * * databricks.WorkspaceFile * * End to end workspace management guide. * * databricks.Volume to manage [volumes within Unity Catalog](https://docs.databricks.com/en/connect/unity-catalog/volumes.html). * * ## Import * * The resource `databricks_file` can be imported using the path of the file: * * bash * * ```sh * $ pulumi import databricks:index/file:File this <path> * ``` */ export declare class File extends pulumi.CustomResource { /** * Get an existing File 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?: FileState, opts?: pulumi.CustomResourceOptions): File; /** * Returns true if the given object is an instance of File. 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 File; /** * Contents in base 64 format. Conflicts with `source`. */ readonly contentBase64: pulumi.Output<string | undefined>; /** * The file size of the file that is being tracked by this resource in bytes. */ readonly fileSize: pulumi.Output<number>; readonly md5: pulumi.Output<string | undefined>; /** * The last time stamp when the file was modified */ readonly modificationTime: pulumi.Output<string>; /** * The path of the file in which you wish to save. For example, `/Volumes/main/default/volume1/file.txt`. */ readonly path: pulumi.Output<string>; readonly remoteFileModified: pulumi.Output<boolean | undefined>; /** * The full absolute path to the file. Conflicts with `contentBase64`. */ readonly source: pulumi.Output<string | undefined>; /** * Create a File 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: FileArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering File resources. */ export interface FileState { /** * Contents in base 64 format. Conflicts with `source`. */ contentBase64?: pulumi.Input<string>; /** * The file size of the file that is being tracked by this resource in bytes. */ fileSize?: pulumi.Input<number>; md5?: pulumi.Input<string>; /** * The last time stamp when the file was modified */ modificationTime?: pulumi.Input<string>; /** * The path of the file in which you wish to save. For example, `/Volumes/main/default/volume1/file.txt`. */ path?: pulumi.Input<string>; remoteFileModified?: pulumi.Input<boolean>; /** * The full absolute path to the file. Conflicts with `contentBase64`. */ source?: pulumi.Input<string>; } /** * The set of arguments for constructing a File resource. */ export interface FileArgs { /** * Contents in base 64 format. Conflicts with `source`. */ contentBase64?: pulumi.Input<string>; md5?: pulumi.Input<string>; /** * The path of the file in which you wish to save. For example, `/Volumes/main/default/volume1/file.txt`. */ path: pulumi.Input<string>; remoteFileModified?: pulumi.Input<boolean>; /** * The full absolute path to the file. Conflicts with `contentBase64`. */ source?: pulumi.Input<string>; }