databricks.MlflowModel
Explore with Pulumi AI
This resource allows you to create MLflow models in Databricks.
Note This documentation covers the Workspace Model Registry. Databricks recommends using Models in Unity Catalog. Models in Unity Catalog provides centralized model governance, cross-workspace access, lineage, and deployment.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";
const test = new databricks.MlflowModel("test", {
name: "My MLflow Model",
description: "My MLflow model description",
tags: [
{
key: "key1",
value: "value1",
},
{
key: "key2",
value: "value2",
},
],
});
import pulumi
import pulumi_databricks as databricks
test = databricks.MlflowModel("test",
name="My MLflow Model",
description="My MLflow model description",
tags=[
{
"key": "key1",
"value": "value1",
},
{
"key": "key2",
"value": "value2",
},
])
package main
import (
"github.com/pulumi/pulumi-databricks/sdk/go/databricks"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := databricks.NewMlflowModel(ctx, "test", &databricks.MlflowModelArgs{
Name: pulumi.String("My MLflow Model"),
Description: pulumi.String("My MLflow model description"),
Tags: databricks.MlflowModelTagArray{
&databricks.MlflowModelTagArgs{
Key: pulumi.String("key1"),
Value: pulumi.String("value1"),
},
&databricks.MlflowModelTagArgs{
Key: pulumi.String("key2"),
Value: pulumi.String("value2"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;
return await Deployment.RunAsync(() =>
{
var test = new Databricks.MlflowModel("test", new()
{
Name = "My MLflow Model",
Description = "My MLflow model description",
Tags = new[]
{
new Databricks.Inputs.MlflowModelTagArgs
{
Key = "key1",
Value = "value1",
},
new Databricks.Inputs.MlflowModelTagArgs
{
Key = "key2",
Value = "value2",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.databricks.MlflowModel;
import com.pulumi.databricks.MlflowModelArgs;
import com.pulumi.databricks.inputs.MlflowModelTagArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new MlflowModel("test", MlflowModelArgs.builder()
.name("My MLflow Model")
.description("My MLflow model description")
.tags(
MlflowModelTagArgs.builder()
.key("key1")
.value("value1")
.build(),
MlflowModelTagArgs.builder()
.key("key2")
.value("value2")
.build())
.build());
}
}
resources:
test:
type: databricks:MlflowModel
properties:
name: My MLflow Model
description: My MLflow model description
tags:
- key: key1
value: value1
- key: key2
value: value2
Access Control
- databricks.Permissions can control which groups or individual users can Read, Edit, Manage Staging Versions, Manage Production Versions, and Manage individual models.
Related Resources
The following resources are often used in the same context:
- databricks.RegisteredModel to create Models in Unity Catalog in Databricks.
- End to end workspace management guide.
- databricks.ModelServing to serve this model on a Databricks serving endpoint.
- databricks.Directory to manage directories in Databricks Workspace.
- databricks.MlflowExperiment to manage MLflow experiments in Databricks.
- databricks.Notebook to manage Databricks Notebooks.
- databricks.Notebook data to export a notebook from Databricks Workspace.
- databricks.Repo to manage Databricks Repos.
Create MlflowModel Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MlflowModel(name: string, args?: MlflowModelArgs, opts?: CustomResourceOptions);
@overload
def MlflowModel(resource_name: str,
args: Optional[MlflowModelArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def MlflowModel(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Sequence[MlflowModelTagArgs]] = None)
func NewMlflowModel(ctx *Context, name string, args *MlflowModelArgs, opts ...ResourceOption) (*MlflowModel, error)
public MlflowModel(string name, MlflowModelArgs? args = null, CustomResourceOptions? opts = null)
public MlflowModel(String name, MlflowModelArgs args)
public MlflowModel(String name, MlflowModelArgs args, CustomResourceOptions options)
type: databricks:MlflowModel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args MlflowModelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args MlflowModelArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args MlflowModelArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MlflowModelArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MlflowModelArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var mlflowModelResource = new Databricks.MlflowModel("mlflowModelResource", new()
{
Description = "string",
Name = "string",
Tags = new[]
{
new Databricks.Inputs.MlflowModelTagArgs
{
Key = "string",
Value = "string",
},
},
});
example, err := databricks.NewMlflowModel(ctx, "mlflowModelResource", &databricks.MlflowModelArgs{
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: databricks.MlflowModelTagArray{
&databricks.MlflowModelTagArgs{
Key: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
})
var mlflowModelResource = new MlflowModel("mlflowModelResource", MlflowModelArgs.builder()
.description("string")
.name("string")
.tags(MlflowModelTagArgs.builder()
.key("string")
.value("string")
.build())
.build());
mlflow_model_resource = databricks.MlflowModel("mlflowModelResource",
description="string",
name="string",
tags=[databricks.MlflowModelTagArgs(
key="string",
value="string",
)])
const mlflowModelResource = new databricks.MlflowModel("mlflowModelResource", {
description: "string",
name: "string",
tags: [{
key: "string",
value: "string",
}],
});
type: databricks:MlflowModel
properties:
description: string
name: string
tags:
- key: string
value: string
MlflowModel Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The MlflowModel resource accepts the following input properties:
- Description string
- The description of the MLflow model.
- Name string
- Name of MLflow model. Change of name triggers new resource.
- List<Mlflow
Model Tag> - Tags for the MLflow model.
- Description string
- The description of the MLflow model.
- Name string
- Name of MLflow model. Change of name triggers new resource.
- []Mlflow
Model Tag Args - Tags for the MLflow model.
- description String
- The description of the MLflow model.
- name String
- Name of MLflow model. Change of name triggers new resource.
- List<Mlflow
Model Tag> - Tags for the MLflow model.
- description string
- The description of the MLflow model.
- name string
- Name of MLflow model. Change of name triggers new resource.
- Mlflow
Model Tag[] - Tags for the MLflow model.
- description str
- The description of the MLflow model.
- name str
- Name of MLflow model. Change of name triggers new resource.
- Sequence[Mlflow
Model Tag Args] - Tags for the MLflow model.
- description String
- The description of the MLflow model.
- name String
- Name of MLflow model. Change of name triggers new resource.
- List<Property Map>
- Tags for the MLflow model.
Outputs
All input properties are implicitly available as output properties. Additionally, the MlflowModel resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Registered
Model stringId
- Id string
- The provider-assigned unique ID for this managed resource.
- Registered
Model stringId
- id String
- The provider-assigned unique ID for this managed resource.
- registered
Model StringId
- id string
- The provider-assigned unique ID for this managed resource.
- registered
Model stringId
- id str
- The provider-assigned unique ID for this managed resource.
- registered_
model_ strid
- id String
- The provider-assigned unique ID for this managed resource.
- registered
Model StringId
Look up Existing MlflowModel Resource
Get an existing MlflowModel resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: MlflowModelState, opts?: CustomResourceOptions): MlflowModel
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
name: Optional[str] = None,
registered_model_id: Optional[str] = None,
tags: Optional[Sequence[MlflowModelTagArgs]] = None) -> MlflowModel
func GetMlflowModel(ctx *Context, name string, id IDInput, state *MlflowModelState, opts ...ResourceOption) (*MlflowModel, error)
public static MlflowModel Get(string name, Input<string> id, MlflowModelState? state, CustomResourceOptions? opts = null)
public static MlflowModel get(String name, Output<String> id, MlflowModelState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Description string
- The description of the MLflow model.
- Name string
- Name of MLflow model. Change of name triggers new resource.
- Registered
Model stringId - List<Mlflow
Model Tag> - Tags for the MLflow model.
- Description string
- The description of the MLflow model.
- Name string
- Name of MLflow model. Change of name triggers new resource.
- Registered
Model stringId - []Mlflow
Model Tag Args - Tags for the MLflow model.
- description String
- The description of the MLflow model.
- name String
- Name of MLflow model. Change of name triggers new resource.
- registered
Model StringId - List<Mlflow
Model Tag> - Tags for the MLflow model.
- description string
- The description of the MLflow model.
- name string
- Name of MLflow model. Change of name triggers new resource.
- registered
Model stringId - Mlflow
Model Tag[] - Tags for the MLflow model.
- description str
- The description of the MLflow model.
- name str
- Name of MLflow model. Change of name triggers new resource.
- registered_
model_ strid - Sequence[Mlflow
Model Tag Args] - Tags for the MLflow model.
- description String
- The description of the MLflow model.
- name String
- Name of MLflow model. Change of name triggers new resource.
- registered
Model StringId - List<Property Map>
- Tags for the MLflow model.
Supporting Types
MlflowModelTag, MlflowModelTagArgs
Import
The model resource can be imported using the name
bash
$ pulumi import databricks:index/mlflowModel:MlflowModel this <name>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- databricks pulumi/pulumi-databricks
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
databricks
Terraform Provider.