@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
135 lines (134 loc) • 4.55 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* > **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 view full names in Unity Catalog, that were created by Pulumi or manually. Use databricks.getTables for retrieving a list of tables.
*
* ## Example Usage
*
* Granting `SELECT` and `MODIFY` to `sensitive` group on all views in 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.getViews({
* 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 getViews(args: GetViewsArgs, opts?: pulumi.InvokeOptions): Promise<GetViewsResult>;
/**
* A collection of arguments for invoking getViews.
*/
export interface GetViewsArgs {
/**
* Name of databricks_catalog
*/
catalogName: string;
/**
* set of databricksView full names: *`catalog`.`schema`.`view`*
*/
ids?: string[];
/**
* Name of databricks_schema
*/
schemaName: string;
}
/**
* A collection of values returned by getViews.
*/
export interface GetViewsResult {
readonly catalogName: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
/**
* set of databricksView full names: *`catalog`.`schema`.`view`*
*/
readonly ids: string[];
readonly schemaName: string;
}
/**
* > **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 view full names in Unity Catalog, that were created by Pulumi or manually. Use databricks.getTables for retrieving a list of tables.
*
* ## Example Usage
*
* Granting `SELECT` and `MODIFY` to `sensitive` group on all views in 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.getViews({
* 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 getViewsOutput(args: GetViewsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetViewsResult>;
/**
* A collection of arguments for invoking getViews.
*/
export interface GetViewsOutputArgs {
/**
* Name of databricks_catalog
*/
catalogName: pulumi.Input<string>;
/**
* set of databricksView full names: *`catalog`.`schema`.`view`*
*/
ids?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Name of databricks_schema
*/
schemaName: pulumi.Input<string>;
}