@pulumi/databricks
Version:
A Pulumi package for creating and managing databricks cloud resources.
135 lines • 5.99 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.ModelServing = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource allows you to manage [Model Serving](https://docs.databricks.com/machine-learning/model-serving/index.html) endpoints in Databricks.
*
* > If you replace `servedModels` with `servedEntities` in an existing serving endpoint, the serving endpoint will briefly go into an update state (~30 seconds) and increment the config version.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as databricks from "@pulumi/databricks";
*
* const _this = new databricks.ModelServing("this", {
* name: "ads-serving-endpoint",
* config: {
* servedEntities: [
* {
* name: "prod_model",
* entityName: "ads-model",
* entityVersion: "2",
* workloadSize: "Small",
* scaleToZeroEnabled: true,
* },
* {
* name: "candidate_model",
* entityName: "ads-model",
* entityVersion: "4",
* workloadSize: "Small",
* scaleToZeroEnabled: false,
* },
* ],
* trafficConfig: {
* routes: [
* {
* servedModelName: "prod_model",
* trafficPercentage: 90,
* },
* {
* servedModelName: "candidate_model",
* trafficPercentage: 10,
* },
* ],
* },
* },
* });
* ```
*
* ## Access Control
*
* * databricks.Permissions can control which groups or individual users can *Manage*, *Query* or *View* individual serving endpoints.
*
* ## Related Resources
*
* The following resources are often used in the same context:
*
* * databricks.RegisteredModel to create [Models in Unity Catalog](https://docs.databricks.com/en/mlflow/models-in-uc.html) in Databricks.
* * End to end workspace management guide.
* * databricks.Directory to manage directories in [Databricks Workspace](https://docs.databricks.com/workspace/workspace-objects.html).
* * databricks.MlflowModel to create models in the [workspace model registry](https://docs.databricks.com/en/mlflow/model-registry.html) in Databricks.
* * databricks.Notebook to manage [Databricks Notebooks](https://docs.databricks.com/notebooks/index.html).
* * databricks.Notebook data to export a notebook from Databricks Workspace.
* * databricks.Repo to manage [Databricks Repos](https://docs.databricks.com/repos.html).
*
* ## Import
*
* The model serving resource can be imported using the name of the endpoint.
*
* bash
*
* ```sh
* $ pulumi import databricks:index/modelServing:ModelServing this <model-serving-endpoint-name>
* ```
*/
class ModelServing extends pulumi.CustomResource {
/**
* Get an existing ModelServing 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 ModelServing(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ModelServing. 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'] === ModelServing.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["aiGateway"] = state ? state.aiGateway : undefined;
resourceInputs["budgetPolicyId"] = state ? state.budgetPolicyId : undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["rateLimits"] = state ? state.rateLimits : undefined;
resourceInputs["routeOptimized"] = state ? state.routeOptimized : undefined;
resourceInputs["servingEndpointId"] = state ? state.servingEndpointId : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
}
else {
const args = argsOrState;
resourceInputs["aiGateway"] = args ? args.aiGateway : undefined;
resourceInputs["budgetPolicyId"] = args ? args.budgetPolicyId : undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["rateLimits"] = args ? args.rateLimits : undefined;
resourceInputs["routeOptimized"] = args ? args.routeOptimized : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["servingEndpointId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ModelServing.__pulumiType, name, resourceInputs, opts);
}
}
exports.ModelServing = ModelServing;
/** @internal */
ModelServing.__pulumiType = 'databricks:index/modelServing:ModelServing';
//# sourceMappingURL=modelServing.js.map
;