databricks logo
Databricks v1.14.0, May 23 23

databricks.MlflowModel

Explore with Pulumi AI

This resource allows you to create MLflow models in Databricks.

Access Control

  • databricks.Permissions can control which groups or individual users can Read, Edit, Manage Staging Versions, Manage Production Versions, and Manage individual models.

The following resources are often used in the same context:

  • 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.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Databricks = Pulumi.Databricks;

return await Deployment.RunAsync(() => 
{
    var test = new Databricks.MlflowModel("test", new()
    {
        Description = "My MLflow model description",
        Tags = new[]
        {
            new Databricks.Inputs.MlflowModelTagArgs
            {
                Key = "key1",
                Value = "value1",
            },
            new Databricks.Inputs.MlflowModelTagArgs
            {
                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{
			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
	})
}
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()        
            .description("My MLflow model description")
            .tags(            
                MlflowModelTagArgs.builder()
                    .key("key1")
                    .value("value1")
                    .build(),
                MlflowModelTagArgs.builder()
                    .key("key2")
                    .value("value2")
                    .build())
            .build());

    }
}
import pulumi
import pulumi_databricks as databricks

test = databricks.MlflowModel("test",
    description="My MLflow model description",
    tags=[
        databricks.MlflowModelTagArgs(
            key="key1",
            value="value1",
        ),
        databricks.MlflowModelTagArgs(
            key="key2",
            value="value2",
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as databricks from "@pulumi/databricks";

const test = new databricks.MlflowModel("test", {
    description: "My MLflow model description",
    tags: [
        {
            key: "key1",
            value: "value1",
        },
        {
            key: "key2",
            value: "value2",
        },
    ],
});
resources:
  test:
    type: databricks:MlflowModel
    properties:
      description: My MLflow model description
      tags:
        - key: key1
          value: value1
        - key: key2
          value: value2

Create MlflowModel Resource

new MlflowModel(name: string, args?: MlflowModelArgs, opts?: CustomResourceOptions);
@overload
def MlflowModel(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                creation_timestamp: Optional[int] = None,
                description: Optional[str] = None,
                last_updated_timestamp: Optional[int] = None,
                name: Optional[str] = None,
                registered_model_id: Optional[str] = None,
                tags: Optional[Sequence[MlflowModelTagArgs]] = None,
                user_id: Optional[str] = None)
@overload
def MlflowModel(resource_name: str,
                args: Optional[MlflowModelArgs] = None,
                opts: Optional[ResourceOptions] = 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.

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.

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:

CreationTimestamp int
Description string

The description of the MLflow model.

LastUpdatedTimestamp int
Name string

Name of MLflow model. Change of name triggers new resource.

RegisteredModelId string
Tags List<MlflowModelTagArgs>

Tags for the MLflow model.

UserId string
CreationTimestamp int
Description string

The description of the MLflow model.

LastUpdatedTimestamp int
Name string

Name of MLflow model. Change of name triggers new resource.

RegisteredModelId string
Tags []MlflowModelTagArgs

Tags for the MLflow model.

UserId string
creationTimestamp Integer
description String

The description of the MLflow model.

lastUpdatedTimestamp Integer
name String

Name of MLflow model. Change of name triggers new resource.

registeredModelId String
tags List<MlflowModelTagArgs>

Tags for the MLflow model.

userId String
creationTimestamp number
description string

The description of the MLflow model.

lastUpdatedTimestamp number
name string

Name of MLflow model. Change of name triggers new resource.

registeredModelId string
tags MlflowModelTagArgs[]

Tags for the MLflow model.

userId string
creation_timestamp int
description str

The description of the MLflow model.

last_updated_timestamp int
name str

Name of MLflow model. Change of name triggers new resource.

registered_model_id str
tags Sequence[MlflowModelTagArgs]

Tags for the MLflow model.

user_id str
creationTimestamp Number
description String

The description of the MLflow model.

lastUpdatedTimestamp Number
name String

Name of MLflow model. Change of name triggers new resource.

registeredModelId String
tags List<Property Map>

Tags for the MLflow model.

userId String

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.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

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,
        creation_timestamp: Optional[int] = None,
        description: Optional[str] = None,
        last_updated_timestamp: Optional[int] = None,
        name: Optional[str] = None,
        registered_model_id: Optional[str] = None,
        tags: Optional[Sequence[MlflowModelTagArgs]] = None,
        user_id: Optional[str] = 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.
The following state arguments are supported:
CreationTimestamp int
Description string

The description of the MLflow model.

LastUpdatedTimestamp int
Name string

Name of MLflow model. Change of name triggers new resource.

RegisteredModelId string
Tags List<MlflowModelTagArgs>

Tags for the MLflow model.

UserId string
CreationTimestamp int
Description string

The description of the MLflow model.

LastUpdatedTimestamp int
Name string

Name of MLflow model. Change of name triggers new resource.

RegisteredModelId string
Tags []MlflowModelTagArgs

Tags for the MLflow model.

UserId string
creationTimestamp Integer
description String

The description of the MLflow model.

lastUpdatedTimestamp Integer
name String

Name of MLflow model. Change of name triggers new resource.

registeredModelId String
tags List<MlflowModelTagArgs>

Tags for the MLflow model.

userId String
creationTimestamp number
description string

The description of the MLflow model.

lastUpdatedTimestamp number
name string

Name of MLflow model. Change of name triggers new resource.

registeredModelId string
tags MlflowModelTagArgs[]

Tags for the MLflow model.

userId string
creation_timestamp int
description str

The description of the MLflow model.

last_updated_timestamp int
name str

Name of MLflow model. Change of name triggers new resource.

registered_model_id str
tags Sequence[MlflowModelTagArgs]

Tags for the MLflow model.

user_id str
creationTimestamp Number
description String

The description of the MLflow model.

lastUpdatedTimestamp Number
name String

Name of MLflow model. Change of name triggers new resource.

registeredModelId String
tags List<Property Map>

Tags for the MLflow model.

userId String

Supporting Types

MlflowModelTag

Key string
Value string
Key string
Value string
key String
value String
key string
value string
key str
value str
key String
value String

Import

The model resource can be imported using the name bash

 $ pulumi import databricks:index/mlflowModel:MlflowModel this <name>

Package Details

Repository
databricks pulumi/pulumi-databricks
License
Apache-2.0
Notes

This Pulumi package is based on the databricks Terraform Provider.