|
| 1 | +// Copyright (c) HashiCorp, Inc. |
| 2 | +// SPDX-License-Identifier: MPL-2.0 |
| 3 | +// ---------------------------------------------------------------------------- |
| 4 | +// |
| 5 | +// *** AUTO GENERATED CODE *** Type: Handwritten *** |
| 6 | +// |
| 7 | +// ---------------------------------------------------------------------------- |
| 8 | +// |
| 9 | +// This code is generated by Magic Modules using the following: |
| 10 | +// |
| 11 | +// Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/vertexai/resource_vertex_ai_deploy_test.go |
| 12 | +// |
| 13 | +// DO NOT EDIT this file directly. Any changes made to this file will be |
| 14 | +// overwritten during the next generation cycle. |
| 15 | +// |
| 16 | +// ---------------------------------------------------------------------------- |
| 17 | +package vertexai_test |
| 18 | + |
| 19 | +import ( |
| 20 | + "testing" |
| 21 | + |
| 22 | + "github.com/hashicorp/terraform-plugin-testing/helper/resource" |
| 23 | + "github.com/hashicorp/terraform-provider-google-beta/google-beta/acctest" |
| 24 | +) |
| 25 | + |
| 26 | +func TestAccVertexAIEndpointWithModelGardenDeployment_basic(t *testing.T) { |
| 27 | + t.Parallel() |
| 28 | + |
| 29 | + context := map[string]interface{}{ |
| 30 | + "random_suffix": acctest.RandString(t, 10), |
| 31 | + } |
| 32 | + |
| 33 | + acctest.VcrTest(t, resource.TestCase{ |
| 34 | + PreCheck: func() { acctest.AccTestPreCheck(t) }, |
| 35 | + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), |
| 36 | + CheckDestroy: nil, // the resource does not yet support deletion |
| 37 | + Steps: []resource.TestStep{ |
| 38 | + { |
| 39 | + Config: testAccVertexAIEndpointWithModelGardenDeployment_basic(context), |
| 40 | + }, |
| 41 | + }, |
| 42 | + }) |
| 43 | +} |
| 44 | + |
| 45 | +func testAccVertexAIEndpointWithModelGardenDeployment_basic(context map[string]interface{}) string { |
| 46 | + return acctest.Nprintf(` |
| 47 | +resource "google_vertex_ai_endpoint_with_model_garden_deployment" "test" { |
| 48 | + publisher_model_name = "publishers/google/models/paligemma@paligemma-224-float32" |
| 49 | + location = "us-central1" |
| 50 | + model_config { |
| 51 | + accept_eula = true |
| 52 | + } |
| 53 | +} |
| 54 | +`, context) |
| 55 | +} |
| 56 | + |
| 57 | +func TestAccVertexAIEndpointWithModelGardenDeployment_withConfigs(t *testing.T) { |
| 58 | + t.Parallel() |
| 59 | + |
| 60 | + context := map[string]interface{}{ |
| 61 | + "random_suffix": acctest.RandString(t, 10), |
| 62 | + } |
| 63 | + |
| 64 | + acctest.VcrTest(t, resource.TestCase{ |
| 65 | + PreCheck: func() { acctest.AccTestPreCheck(t) }, |
| 66 | + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t), |
| 67 | + CheckDestroy: nil, |
| 68 | + Steps: []resource.TestStep{ |
| 69 | + { |
| 70 | + Config: testAccVertexAIEndpointWithModelGardenDeployment_withConfigs(context), |
| 71 | + }, |
| 72 | + }, |
| 73 | + }) |
| 74 | +} |
| 75 | + |
| 76 | +func testAccVertexAIEndpointWithModelGardenDeployment_withConfigs(context map[string]interface{}) string { |
| 77 | + return acctest.Nprintf(` |
| 78 | +resource "google_vertex_ai_endpoint_with_model_garden_deployment" "test_with_configs" { |
| 79 | + publisher_model_name = "publishers/google/models/paligemma@paligemma-224-float32" |
| 80 | + location = "us-central1" |
| 81 | + model_config { |
| 82 | + accept_eula = true |
| 83 | + } |
| 84 | + deploy_config { |
| 85 | + dedicated_resources { |
| 86 | + machine_spec { |
| 87 | + machine_type = "g2-standard-16" |
| 88 | + accelerator_type = "NVIDIA_L4" |
| 89 | + accelerator_count = 1 |
| 90 | + } |
| 91 | + min_replica_count = 1 |
| 92 | + } |
| 93 | + } |
| 94 | +} |
| 95 | +`, context) |
| 96 | +} |
0 commit comments