gcp logo
Google Cloud Classic v6.57.0, May 30 23

gcp.ml.EngineModel

Explore with Pulumi AI

Represents a machine learning solution.

A model can have multiple versions, each of which is a deployed, trained model ready to receive prediction requests. The model itself is just a container.

To get more information about Model, see:

Example Usage

Ml Model Basic

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

return await Deployment.RunAsync(() => 
{
    var @default = new Gcp.ML.EngineModel("default", new()
    {
        Description = "My model",
        Regions = "us-central1",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/ml"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ml.NewEngineModel(ctx, "default", &ml.EngineModelArgs{
			Description: pulumi.String("My model"),
			Regions:     pulumi.String("us-central1"),
		})
		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.gcp.ml.EngineModel;
import com.pulumi.gcp.ml.EngineModelArgs;
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 default_ = new EngineModel("default", EngineModelArgs.builder()        
            .description("My model")
            .regions("us-central1")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

default = gcp.ml.EngineModel("default",
    description="My model",
    regions="us-central1")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const _default = new gcp.ml.EngineModel("default", {
    description: "My model",
    regions: "us-central1",
});
resources:
  default:
    type: gcp:ml:EngineModel
    properties:
      description: My model
      regions: us-central1

Ml Model Full

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

return await Deployment.RunAsync(() => 
{
    var @default = new Gcp.ML.EngineModel("default", new()
    {
        Description = "My model",
        Labels = 
        {
            { "my_model", "foo" },
        },
        OnlinePredictionConsoleLogging = true,
        OnlinePredictionLogging = true,
        Regions = "us-central1",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/ml"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ml.NewEngineModel(ctx, "default", &ml.EngineModelArgs{
			Description: pulumi.String("My model"),
			Labels: pulumi.StringMap{
				"my_model": pulumi.String("foo"),
			},
			OnlinePredictionConsoleLogging: pulumi.Bool(true),
			OnlinePredictionLogging:        pulumi.Bool(true),
			Regions:                        pulumi.String("us-central1"),
		})
		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.gcp.ml.EngineModel;
import com.pulumi.gcp.ml.EngineModelArgs;
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 default_ = new EngineModel("default", EngineModelArgs.builder()        
            .description("My model")
            .labels(Map.of("my_model", "foo"))
            .onlinePredictionConsoleLogging(true)
            .onlinePredictionLogging(true)
            .regions("us-central1")
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

default = gcp.ml.EngineModel("default",
    description="My model",
    labels={
        "my_model": "foo",
    },
    online_prediction_console_logging=True,
    online_prediction_logging=True,
    regions="us-central1")
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const _default = new gcp.ml.EngineModel("default", {
    description: "My model",
    labels: {
        my_model: "foo",
    },
    onlinePredictionConsoleLogging: true,
    onlinePredictionLogging: true,
    regions: "us-central1",
});
resources:
  default:
    type: gcp:ml:EngineModel
    properties:
      description: My model
      labels:
        my_model: foo
      onlinePredictionConsoleLogging: true
      onlinePredictionLogging: true
      regions: us-central1

Create EngineModel Resource

new EngineModel(name: string, args?: EngineModelArgs, opts?: CustomResourceOptions);
@overload
def EngineModel(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                default_version: Optional[EngineModelDefaultVersionArgs] = None,
                description: Optional[str] = None,
                labels: Optional[Mapping[str, str]] = None,
                name: Optional[str] = None,
                online_prediction_console_logging: Optional[bool] = None,
                online_prediction_logging: Optional[bool] = None,
                project: Optional[str] = None,
                regions: Optional[str] = None)
@overload
def EngineModel(resource_name: str,
                args: Optional[EngineModelArgs] = None,
                opts: Optional[ResourceOptions] = None)
func NewEngineModel(ctx *Context, name string, args *EngineModelArgs, opts ...ResourceOption) (*EngineModel, error)
public EngineModel(string name, EngineModelArgs? args = null, CustomResourceOptions? opts = null)
public EngineModel(String name, EngineModelArgs args)
public EngineModel(String name, EngineModelArgs args, CustomResourceOptions options)
type: gcp:ml:EngineModel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EngineModelArgs
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 EngineModelArgs
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 EngineModelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EngineModelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EngineModelArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

EngineModel 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 EngineModel resource accepts the following input properties:

DefaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

Description string

The description specified for the model when it was created.

Labels Dictionary<string, string>

One or more labels that you can add, to organize your models.

Name string

The name specified for the model.


OnlinePredictionConsoleLogging bool

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

OnlinePredictionLogging bool

If true, online prediction access logs are sent to StackDriver Logging.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Regions string

The list of regions where the model is going to be deployed. Currently only one region per model is supported

DefaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

Description string

The description specified for the model when it was created.

Labels map[string]string

One or more labels that you can add, to organize your models.

Name string

The name specified for the model.


OnlinePredictionConsoleLogging bool

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

OnlinePredictionLogging bool

If true, online prediction access logs are sent to StackDriver Logging.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Regions string

The list of regions where the model is going to be deployed. Currently only one region per model is supported

defaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description String

The description specified for the model when it was created.

labels Map<String,String>

One or more labels that you can add, to organize your models.

name String

The name specified for the model.


onlinePredictionConsoleLogging Boolean

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

onlinePredictionLogging Boolean

If true, online prediction access logs are sent to StackDriver Logging.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions String

The list of regions where the model is going to be deployed. Currently only one region per model is supported

defaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description string

The description specified for the model when it was created.

labels {[key: string]: string}

One or more labels that you can add, to organize your models.

name string

The name specified for the model.


onlinePredictionConsoleLogging boolean

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

onlinePredictionLogging boolean

If true, online prediction access logs are sent to StackDriver Logging.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions string

The list of regions where the model is going to be deployed. Currently only one region per model is supported

default_version EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description str

The description specified for the model when it was created.

labels Mapping[str, str]

One or more labels that you can add, to organize your models.

name str

The name specified for the model.


online_prediction_console_logging bool

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

online_prediction_logging bool

If true, online prediction access logs are sent to StackDriver Logging.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions str

The list of regions where the model is going to be deployed. Currently only one region per model is supported

defaultVersion Property Map

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description String

The description specified for the model when it was created.

labels Map<String>

One or more labels that you can add, to organize your models.

name String

The name specified for the model.


onlinePredictionConsoleLogging Boolean

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

onlinePredictionLogging Boolean

If true, online prediction access logs are sent to StackDriver Logging.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions String

The list of regions where the model is going to be deployed. Currently only one region per model is supported

Outputs

All input properties are implicitly available as output properties. Additionally, the EngineModel 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 EngineModel Resource

Get an existing EngineModel 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?: EngineModelState, opts?: CustomResourceOptions): EngineModel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        default_version: Optional[EngineModelDefaultVersionArgs] = None,
        description: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        online_prediction_console_logging: Optional[bool] = None,
        online_prediction_logging: Optional[bool] = None,
        project: Optional[str] = None,
        regions: Optional[str] = None) -> EngineModel
func GetEngineModel(ctx *Context, name string, id IDInput, state *EngineModelState, opts ...ResourceOption) (*EngineModel, error)
public static EngineModel Get(string name, Input<string> id, EngineModelState? state, CustomResourceOptions? opts = null)
public static EngineModel get(String name, Output<String> id, EngineModelState 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:
DefaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

Description string

The description specified for the model when it was created.

Labels Dictionary<string, string>

One or more labels that you can add, to organize your models.

Name string

The name specified for the model.


OnlinePredictionConsoleLogging bool

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

OnlinePredictionLogging bool

If true, online prediction access logs are sent to StackDriver Logging.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Regions string

The list of regions where the model is going to be deployed. Currently only one region per model is supported

DefaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

Description string

The description specified for the model when it was created.

Labels map[string]string

One or more labels that you can add, to organize your models.

Name string

The name specified for the model.


OnlinePredictionConsoleLogging bool

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

OnlinePredictionLogging bool

If true, online prediction access logs are sent to StackDriver Logging.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Regions string

The list of regions where the model is going to be deployed. Currently only one region per model is supported

defaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description String

The description specified for the model when it was created.

labels Map<String,String>

One or more labels that you can add, to organize your models.

name String

The name specified for the model.


onlinePredictionConsoleLogging Boolean

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

onlinePredictionLogging Boolean

If true, online prediction access logs are sent to StackDriver Logging.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions String

The list of regions where the model is going to be deployed. Currently only one region per model is supported

defaultVersion EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description string

The description specified for the model when it was created.

labels {[key: string]: string}

One or more labels that you can add, to organize your models.

name string

The name specified for the model.


onlinePredictionConsoleLogging boolean

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

onlinePredictionLogging boolean

If true, online prediction access logs are sent to StackDriver Logging.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions string

The list of regions where the model is going to be deployed. Currently only one region per model is supported

default_version EngineModelDefaultVersionArgs

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description str

The description specified for the model when it was created.

labels Mapping[str, str]

One or more labels that you can add, to organize your models.

name str

The name specified for the model.


online_prediction_console_logging bool

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

online_prediction_logging bool

If true, online prediction access logs are sent to StackDriver Logging.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions str

The list of regions where the model is going to be deployed. Currently only one region per model is supported

defaultVersion Property Map

The default version of the model. This version will be used to handle prediction requests that do not specify a version. Structure is documented below.

description String

The description specified for the model when it was created.

labels Map<String>

One or more labels that you can add, to organize your models.

name String

The name specified for the model.


onlinePredictionConsoleLogging Boolean

If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging

onlinePredictionLogging Boolean

If true, online prediction access logs are sent to StackDriver Logging.

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

regions String

The list of regions where the model is going to be deployed. Currently only one region per model is supported

Supporting Types

EngineModelDefaultVersion

Name string

The name specified for the version when it was created.

Name string

The name specified for the version when it was created.

name String

The name specified for the version when it was created.

name string

The name specified for the version when it was created.

name str

The name specified for the version when it was created.

name String

The name specified for the version when it was created.

Import

Model can be imported using any of these accepted formats

 $ pulumi import gcp:ml/engineModel:EngineModel default projects/{{project}}/models/{{name}}
 $ pulumi import gcp:ml/engineModel:EngineModel default {{project}}/{{name}}
 $ pulumi import gcp:ml/engineModel:EngineModel default {{name}}

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.