@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
112 lines • 4.46 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.getTablesOutput = exports.getTables = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > **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.
*/
function getTables(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("databricks:index/getTables:getTables", {
"catalogName": args.catalogName,
"ids": args.ids,
"schemaName": args.schemaName,
}, opts);
}
exports.getTables = getTables;
/**
* > **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.
*/
function getTablesOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("databricks:index/getTables:getTables", {
"catalogName": args.catalogName,
"ids": args.ids,
"schemaName": args.schemaName,
}, opts);
}
exports.getTablesOutput = getTablesOutput;
//# sourceMappingURL=getTables.js.map
;