@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
186 lines • 8.33 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** 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, { ...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?.assetsDir;
resourceInputs["baselineTableName"] = state?.baselineTableName;
resourceInputs["customMetrics"] = state?.customMetrics;
resourceInputs["dashboardId"] = state?.dashboardId;
resourceInputs["dataClassificationConfig"] = state?.dataClassificationConfig;
resourceInputs["driftMetricsTableName"] = state?.driftMetricsTableName;
resourceInputs["inferenceLog"] = state?.inferenceLog;
resourceInputs["latestMonitorFailureMsg"] = state?.latestMonitorFailureMsg;
resourceInputs["monitorVersion"] = state?.monitorVersion;
resourceInputs["notifications"] = state?.notifications;
resourceInputs["outputSchemaName"] = state?.outputSchemaName;
resourceInputs["profileMetricsTableName"] = state?.profileMetricsTableName;
resourceInputs["schedule"] = state?.schedule;
resourceInputs["skipBuiltinDashboard"] = state?.skipBuiltinDashboard;
resourceInputs["slicingExprs"] = state?.slicingExprs;
resourceInputs["snapshot"] = state?.snapshot;
resourceInputs["status"] = state?.status;
resourceInputs["tableName"] = state?.tableName;
resourceInputs["timeSeries"] = state?.timeSeries;
resourceInputs["warehouseId"] = state?.warehouseId;
}
else {
const args = argsOrState;
if (args?.assetsDir === undefined && !opts.urn) {
throw new Error("Missing required property 'assetsDir'");
}
if (args?.outputSchemaName === undefined && !opts.urn) {
throw new Error("Missing required property 'outputSchemaName'");
}
if (args?.tableName === undefined && !opts.urn) {
throw new Error("Missing required property 'tableName'");
}
resourceInputs["assetsDir"] = args?.assetsDir;
resourceInputs["baselineTableName"] = args?.baselineTableName;
resourceInputs["customMetrics"] = args?.customMetrics;
resourceInputs["dataClassificationConfig"] = args?.dataClassificationConfig;
resourceInputs["inferenceLog"] = args?.inferenceLog;
resourceInputs["latestMonitorFailureMsg"] = args?.latestMonitorFailureMsg;
resourceInputs["notifications"] = args?.notifications;
resourceInputs["outputSchemaName"] = args?.outputSchemaName;
resourceInputs["schedule"] = args?.schedule;
resourceInputs["skipBuiltinDashboard"] = args?.skipBuiltinDashboard;
resourceInputs["slicingExprs"] = args?.slicingExprs;
resourceInputs["snapshot"] = args?.snapshot;
resourceInputs["tableName"] = args?.tableName;
resourceInputs["timeSeries"] = args?.timeSeries;
resourceInputs["warehouseId"] = args?.warehouseId;
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