@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
186 lines • 9.06 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.LakehouseMonitor = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* NOTE: This resource has been deprecated and will be removed soon. Please use the databricks.QualityMonitor resource instead.
*
* This resource allows you to manage [Lakehouse Monitors](https://docs.databricks.com/en/lakehouse-monitoring/index.html) in Databricks.
*
* A `databricks.LakehouseMonitor` is attached to a databricks.SqlTable and can be of type timeseries, snapshot or inference.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const sandbox = new databricks.Catalog("sandbox", {
* name: "sandbox",
* comment: "this catalog is managed by terraform",
* properties: {
* purpose: "testing",
* },
* });
* const things = new databricks.Schema("things", {
* catalogName: sandbox.id,
* name: "things",
* comment: "this database is managed by terraform",
* properties: {
* kind: "various",
* },
* });
* const myTestTable = new databricks.SqlTable("myTestTable", {
* catalogName: "main",
* schemaName: things.name,
* name: "bar",
* tableType: "MANAGED",
* dataSourceFormat: "DELTA",
* columns: [{
* name: "timestamp",
* type: "int",
* }],
* });
* const testTimeseriesMonitor = new databricks.LakehouseMonitor("testTimeseriesMonitor", {
* tableName: pulumi.interpolate`${sandbox.name}.${things.name}.${myTestTable.name}`,
* assetsDir: pulumi.interpolate`/Shared/provider-test/databricks_lakehouse_monitoring/${myTestTable.name}`,
* outputSchemaName: pulumi.interpolate`${sandbox.name}.${things.name}`,
* timeSeries: {
* granularities: ["1 hour"],
* timestampCol: "timestamp",
* },
* });
* ```
*
* ### Inference Monitor
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const testMonitorInference = new databricks.LakehouseMonitor("testMonitorInference", {
* tableName: `${sandbox.name}.${things.name}.${myTestTable.name}`,
* assetsDir: `/Shared/provider-test/databricks_lakehouse_monitoring/${myTestTable.name}`,
* outputSchemaName: `${sandbox.name}.${things.name}`,
* inferenceLog: {
* granularities: ["1 hour"],
* timestampCol: "timestamp",
* predictionCol: "prediction",
* modelIdCol: "model_id",
* problemType: "PROBLEM_TYPE_REGRESSION",
* },
* });
* ```
* ### Snapshot Monitor
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const testMonitorInference = new databricks.LakehouseMonitor("testMonitorInference", {
* tableName: `${sandbox.name}.${things.name}.${myTestTable.name}`,
* assetsDir: `/Shared/provider-test/databricks_lakehouse_monitoring/${myTestTable.name}`,
* outputSchemaName: `${sandbox.name}.${things.name}`,
* snapshot: {},
* });
* ```
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * databricks.Catalog
* * databricks.Schema
* * databricks.SqlTable
*/
class LakehouseMonitor extends pulumi.CustomResource {
/**
* Get an existing LakehouseMonitor 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, id, state, opts) {
return new LakehouseMonitor(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of LakehouseMonitor. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === LakehouseMonitor.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["assetsDir"] = state ? state.assetsDir : undefined;
resourceInputs["baselineTableName"] = state ? state.baselineTableName : undefined;
resourceInputs["customMetrics"] = state ? state.customMetrics : undefined;
resourceInputs["dashboardId"] = state ? state.dashboardId : undefined;
resourceInputs["dataClassificationConfig"] = state ? state.dataClassificationConfig : undefined;
resourceInputs["driftMetricsTableName"] = state ? state.driftMetricsTableName : undefined;
resourceInputs["inferenceLog"] = state ? state.inferenceLog : undefined;
resourceInputs["latestMonitorFailureMsg"] = state ? state.latestMonitorFailureMsg : undefined;
resourceInputs["monitorVersion"] = state ? state.monitorVersion : undefined;
resourceInputs["notifications"] = state ? state.notifications : undefined;
resourceInputs["outputSchemaName"] = state ? state.outputSchemaName : undefined;
resourceInputs["profileMetricsTableName"] = state ? state.profileMetricsTableName : undefined;
resourceInputs["schedule"] = state ? state.schedule : undefined;
resourceInputs["skipBuiltinDashboard"] = state ? state.skipBuiltinDashboard : undefined;
resourceInputs["slicingExprs"] = state ? state.slicingExprs : undefined;
resourceInputs["snapshot"] = state ? state.snapshot : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["tableName"] = state ? state.tableName : undefined;
resourceInputs["timeSeries"] = state ? state.timeSeries : undefined;
resourceInputs["warehouseId"] = state ? state.warehouseId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.assetsDir === undefined) && !opts.urn) {
throw new Error("Missing required property 'assetsDir'");
}
if ((!args || args.outputSchemaName === undefined) && !opts.urn) {
throw new Error("Missing required property 'outputSchemaName'");
}
if ((!args || args.tableName === undefined) && !opts.urn) {
throw new Error("Missing required property 'tableName'");
}
resourceInputs["assetsDir"] = args ? args.assetsDir : undefined;
resourceInputs["baselineTableName"] = args ? args.baselineTableName : undefined;
resourceInputs["customMetrics"] = args ? args.customMetrics : undefined;
resourceInputs["dataClassificationConfig"] = args ? args.dataClassificationConfig : undefined;
resourceInputs["inferenceLog"] = args ? args.inferenceLog : undefined;
resourceInputs["latestMonitorFailureMsg"] = args ? args.latestMonitorFailureMsg : undefined;
resourceInputs["notifications"] = args ? args.notifications : undefined;
resourceInputs["outputSchemaName"] = args ? args.outputSchemaName : undefined;
resourceInputs["schedule"] = args ? args.schedule : undefined;
resourceInputs["skipBuiltinDashboard"] = args ? args.skipBuiltinDashboard : undefined;
resourceInputs["slicingExprs"] = args ? args.slicingExprs : undefined;
resourceInputs["snapshot"] = args ? args.snapshot : undefined;
resourceInputs["tableName"] = args ? args.tableName : undefined;
resourceInputs["timeSeries"] = args ? args.timeSeries : undefined;
resourceInputs["warehouseId"] = args ? args.warehouseId : undefined;
resourceInputs["dashboardId"] = undefined /*out*/;
resourceInputs["driftMetricsTableName"] = undefined /*out*/;
resourceInputs["monitorVersion"] = undefined /*out*/;
resourceInputs["profileMetricsTableName"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(LakehouseMonitor.__pulumiType, name, resourceInputs, opts);
}
}
exports.LakehouseMonitor = LakehouseMonitor;
/** @internal */
LakehouseMonitor.__pulumiType = 'databricks:index/lakehouseMonitor:LakehouseMonitor';
//# sourceMappingURL=lakehouseMonitor.js.map
;