|
| 1 | +# Copyright 2025 Google Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# you may not use this file except in compliance with the License. |
| 4 | +# You may obtain a copy of the License at |
| 5 | +# |
| 6 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | + |
| 14 | +--- |
| 15 | +name: ModelGardenEnableModel |
| 16 | +api_resource_type_kind: PublisherModel |
| 17 | +description: | |
| 18 | + Enables a Model Garden publisher model for a project so that it can be |
| 19 | + deployed. This calls the synchronous |
| 20 | + `ModelGardenService.EnableModel` method, which checks that the prerequisites |
| 21 | + for the model are met (for example, a completed questionnaire and accepted |
| 22 | + consents, or an active Private Offer) before enabling it. |
| 23 | +
|
| 24 | + ~> **Note:** The underlying API does not provide a way to disable a model |
| 25 | + once it has been enabled, so destroying this resource only removes it from |
| 26 | + Terraform state and does not affect the project's enablement status. |
| 27 | +references: |
| 28 | + guides: |
| 29 | + Use models in Model Garden: https://cloud.google.com/vertex-ai/generative-ai/docs/model-garden/use-models |
| 30 | + Overview of Model Garden: https://cloud.google.com/vertex-ai/generative-ai/docs/model-garden/explore-models |
| 31 | + api: https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.publishers.models/enableModel |
| 32 | +docs: |
| 33 | +# Only available in the v1beta1 (beta) API surface. |
| 34 | +min_version: beta |
| 35 | +base_url: projects/{{project}}/{{publisher_model_name}}:enableModel |
| 36 | +create_url: projects/{{project}}/{{publisher_model_name}}:enableModel |
| 37 | +self_link: projects/{{project}}/{{publisher_model_name}} |
| 38 | +id_format: projects/{{project}}/{{publisher_model_name}} |
| 39 | +immutable: true |
| 40 | +# EnableModel is a synchronous action-only method with no Read, Delete, or |
| 41 | +# Import support, so the lifecycle is create-only. |
| 42 | +exclude_read: true |
| 43 | +exclude_delete: true |
| 44 | +exclude_import: true |
| 45 | +exclude_sweeper: true |
| 46 | +timeouts: |
| 47 | + insert_minutes: 20 |
| 48 | +custom_code: |
| 49 | + post_create: templates/terraform/post_create/resource_vertexai_model_garden_enable_model.go.tmpl |
| 50 | +examples: |
| 51 | + - name: vertex_ai_model_garden_enable_model_basic |
| 52 | + min_version: beta |
| 53 | + primary_resource_id: enable |
| 54 | + # Handwritten test required since the resource does not support read, |
| 55 | + # delete, or import. |
| 56 | + exclude_test: true |
| 57 | + vars: |
| 58 | + publisher_model_name: publishers/google/models/paligemma@paligemma-224-float32 |
| 59 | +parameters: |
| 60 | + - name: publisherModelName |
| 61 | + type: String |
| 62 | + description: |- |
| 63 | + The resource name of the Model Garden publisher model to enable. |
| 64 | + Format: `publishers/{publisher}/models/{publisher_model}`, optionally |
| 65 | + with a version suffix, for example |
| 66 | + `publishers/google/models/paligemma@paligemma-224-float32`. |
| 67 | + min_version: beta |
| 68 | + immutable: true |
| 69 | + url_param_only: true |
| 70 | + required: true |
| 71 | +properties: |
| 72 | + - name: publisherEndpoint |
| 73 | + type: String |
| 74 | + description: | |
| 75 | + Output only. The publisher endpoint that the project is enabled for. |
| 76 | + Format: |
| 77 | + `projects/{project}/locations/{location}/publishers/{publisher}/models/{publisher_model}`. |
| 78 | + min_version: beta |
| 79 | + output: true |
| 80 | + - name: enablementState |
| 81 | + type: Enum |
| 82 | + description: | |
| 83 | + Output only. The result of the model enablement. |
| 84 | + min_version: beta |
| 85 | + output: true |
| 86 | + enum_values: |
| 87 | + - ENABLEMENT_STATE_UNSPECIFIED |
| 88 | + - ENABLEMENT_STATE_SUCCEEDED |
| 89 | + - ENABLEMENT_STATE_FAILED |
0 commit comments