UNPKG

@pulumi/databricks

Version:

A Pulumi package for creating and managing databricks cloud resources.

190 lines 9.4 kB
"use strict"; // *** 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.QualityMonitor = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * This resource allows you to manage [Lakehouse Monitors](https://docs.databricks.com/en/lakehouse-monitoring/index.html) in Databricks. * * A `databricks.QualityMonitor` is attached to a databricks.SqlTable and can be of type timeseries, snapshot or inference. * * ## Plugin Framework Migration * * The quality monitor resource has been migrated from sdkv2 to plugin framework。 If you encounter any problem with this resource and suspect it is due to the migration, you can fallback to sdkv2 by setting the environment variable in the following way `export USE_SDK_V2_RESOURCES="databricks.QualityMonitor"`. * * ## 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.QualityMonitor("testTimeseriesMonitor", { * tableName: pulumi.interpolate`${sandbox.name}.${things.name}.${myTestTable.name}`, * assetsDir: pulumi.interpolate`/Shared/provider-test/databricks_quality_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.QualityMonitor("testMonitorInference", { * tableName: `${sandbox.name}.${things.name}.${myTestTable.name}`, * assetsDir: `/Shared/provider-test/databricks_quality_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.QualityMonitor("testMonitorInference", { * tableName: `${sandbox.name}.${things.name}.${myTestTable.name}`, * assetsDir: `/Shared/provider-test/databricks_quality_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 QualityMonitor extends pulumi.CustomResource { /** * Get an existing QualityMonitor 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 QualityMonitor(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of QualityMonitor. 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'] === QualityMonitor.__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["monitorId"] = state ? state.monitorId : 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["monitorId"] = args ? args.monitorId : 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(QualityMonitor.__pulumiType, name, resourceInputs, opts); } } exports.QualityMonitor = QualityMonitor; /** @internal */ QualityMonitor.__pulumiType = 'databricks:index/qualityMonitor:QualityMonitor'; //# sourceMappingURL=qualityMonitor.js.map