@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
146 lines (145 loc) • 4.71 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* 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.
*
* > This data source can only be used with a workspace-level provider!
*
* ## 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[];
/**
* Configure the provider for management through account provider. This block consists of the following fields:
*/
providerConfig?: inputs.GetViewsProviderConfig;
/**
* 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 providerConfig?: outputs.GetViewsProviderConfig;
readonly schemaName: string;
}
/**
* 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.
*
* > This data source can only be used with a workspace-level provider!
*
* ## 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>[]>;
/**
* Configure the provider for management through account provider. This block consists of the following fields:
*/
providerConfig?: pulumi.Input<inputs.GetViewsProviderConfigArgs>;
/**
* Name of databricks_schema
*/
schemaName: pulumi.Input<string>;
}