UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

139 lines (138 loc) 4.78 kB
import * as pulumi from "@pulumi/pulumi"; /** * > **Note** This data source can only be used with a workspace-level provider! * * > **Note** If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add dependsOn attribute in order to prevent _default auth: cannot configure default credentials_ errors. * * Retrieves a list of managed or external table full names in Unity Catalog, that were created by Pulumi or manually. Use databricks.getViews for retrieving a list of views. * * ## Example Usage * * Granting `SELECT` and `MODIFY` to `sensitive` group on all tables a _things_ databricks.Schema from _sandbox_ databricks_catalog: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const things = await databricks.getTables({ * catalogName: "sandbox", * schemaName: "things", * }); * const thingsGrants: databricks.Grants[] = []; * for (const range of things.ids.map((v, k) => ({key: k, value: v}))) { * thingsGrants.push(new databricks.Grants(`things-${range.key}`, { * table: range.value, * grants: [{ * principal: "sensitive", * privileges: [ * "SELECT", * "MODIFY", * ], * }], * })); * } * } * ``` * * ## Related Resources * * The following resources are used in the same context: * * * databricks.Schema to manage schemas within Unity Catalog. * * databricks.Catalog to manage catalogs within Unity Catalog. */ export declare function getTables(args: GetTablesArgs, opts?: pulumi.InvokeOptions): Promise<GetTablesResult>; /** * A collection of arguments for invoking getTables. */ export interface GetTablesArgs { /** * Name of databricks_catalog */ catalogName: string; /** * set of databricks.Table full names: *`catalog`.`schema`.`table`* */ ids?: string[]; /** * Name of databricks_schema */ schemaName: string; } /** * A collection of values returned by getTables. */ export interface GetTablesResult { readonly catalogName: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * set of databricks.Table full names: *`catalog`.`schema`.`table`* */ readonly ids: string[]; readonly schemaName: string; } /** * > **Note** This data source can only be used with a workspace-level provider! * * > **Note** If you have a fully automated setup with workspaces created by databricks.MwsWorkspaces or azurerm_databricks_workspace, please make sure to add dependsOn attribute in order to prevent _default auth: cannot configure default credentials_ errors. * * Retrieves a list of managed or external table full names in Unity Catalog, that were created by Pulumi or manually. Use databricks.getViews for retrieving a list of views. * * ## Example Usage * * Granting `SELECT` and `MODIFY` to `sensitive` group on all tables a _things_ databricks.Schema from _sandbox_ databricks_catalog: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as databricks from "@pulumi/databricks"; * * export = async () => { * const things = await databricks.getTables({ * catalogName: "sandbox", * schemaName: "things", * }); * const thingsGrants: databricks.Grants[] = []; * for (const range of things.ids.map((v, k) => ({key: k, value: v}))) { * thingsGrants.push(new databricks.Grants(`things-${range.key}`, { * table: range.value, * grants: [{ * principal: "sensitive", * privileges: [ * "SELECT", * "MODIFY", * ], * }], * })); * } * } * ``` * * ## Related Resources * * The following resources are used in the same context: * * * databricks.Schema to manage schemas within Unity Catalog. * * databricks.Catalog to manage catalogs within Unity Catalog. */ export declare function getTablesOutput(args: GetTablesOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetTablesResult>; /** * A collection of arguments for invoking getTables. */ export interface GetTablesOutputArgs { /** * Name of databricks_catalog */ catalogName: pulumi.Input<string>; /** * set of databricks.Table full names: *`catalog`.`schema`.`table`* */ ids?: pulumi.Input<pulumi.Input<string>[]>; /** * Name of databricks_schema */ schemaName: pulumi.Input<string>; }