| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "ML Engine" |
| description: |- |
| Represents a machine learning solution. |
| --- |
| |
| # google\_ml\_engine\_model |
| |
| 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: |
| |
| * [API documentation](https://cloud.google.com/ai-platform/prediction/docs/reference/rest/v1/projects.models) |
| * How-to Guides |
| * [Official Documentation](https://cloud.google.com/ai-platform/prediction/docs/deploying-models) |
| |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=ml_model_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Ml Model Basic |
| |
| |
| ```hcl |
| resource "google_ml_engine_model" "default" { |
| name = "default" |
| description = "My model" |
| regions = ["us-central1"] |
| } |
| ``` |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=ml_model_full&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Ml Model Full |
| |
| |
| ```hcl |
| resource "google_ml_engine_model" "default" { |
| name = "default" |
| description = "My model" |
| regions = ["us-central1"] |
| labels = { |
| my_model = "foo" |
| } |
| online_prediction_logging = true |
| online_prediction_console_logging = true |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `name` - |
| (Required) |
| The name specified for the model. |
| |
| |
| - - - |
| |
| |
| * `description` - |
| (Optional) |
| The description specified for the model when it was created. |
| |
| * `default_version` - |
| (Optional) |
| 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](#nested_default_version). |
| |
| * `regions` - |
| (Optional) |
| The list of regions where the model is going to be deployed. |
| Currently only one region per model is supported |
| |
| * `online_prediction_logging` - |
| (Optional) |
| If true, online prediction access logs are sent to StackDriver Logging. |
| |
| * `online_prediction_console_logging` - |
| (Optional) |
| If true, online prediction nodes send stderr and stdout streams to Stackdriver Logging |
| |
| * `labels` - |
| (Optional) |
| One or more labels that you can add, to organize your models. |
| **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. |
| Please refer to the field `effective_labels` for all of the labels present on the resource. |
| |
| * `project` - (Optional) The ID of the project in which the resource belongs. |
| If it is not provided, the provider project is used. |
| |
| |
| <a name="nested_default_version"></a>The `default_version` block supports: |
| |
| * `name` - |
| (Required) |
| The name specified for the version when it was created. |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `projects/{{project}}/models/{{name}}` |
| |
| * `terraform_labels` - |
| The combination of labels configured directly on the resource |
| and default labels configured on the provider. |
| |
| * `effective_labels` - |
| All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 20 minutes. |
| - `update` - Default is 20 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| Model can be imported using any of these accepted formats: |
| |
| * `projects/{{project}}/models/{{name}}` |
| * `{{project}}/{{name}}` |
| * `{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Model using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "projects/{{project}}/models/{{name}}" |
| to = google_ml_engine_model.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Model can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_ml_engine_model.default projects/{{project}}/models/{{name}} |
| $ terraform import google_ml_engine_model.default {{project}}/{{name}} |
| $ terraform import google_ml_engine_model.default {{name}} |
| ``` |
| |
| ## User Project Overrides |
| |
| This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override). |