diff --git a/mmv1/products/vertexai/Index.yaml b/mmv1/products/vertexai/Index.yaml index 26268f40f38b..071c87f84095 100644 --- a/mmv1/products/vertexai/Index.yaml +++ b/mmv1/products/vertexai/Index.yaml @@ -37,6 +37,8 @@ async: resource_inside_response: true custom_code: custom_update: 'templates/terraform/custom_update/vertex_ai_index.go.tmpl' +sweeper: + identifier_field: 'displayName' examples: - name: 'vertex_ai_index' min_version: beta diff --git a/mmv1/products/vertexai/IndexEndpoint.yaml b/mmv1/products/vertexai/IndexEndpoint.yaml index fdb8b70164e4..d87d9c1fa8f2 100644 --- a/mmv1/products/vertexai/IndexEndpoint.yaml +++ b/mmv1/products/vertexai/IndexEndpoint.yaml @@ -35,8 +35,8 @@ async: base_url: '{{op_id}}' result: resource_inside_response: true -custom_code: - test_constants: 'templates/terraform/test_constants/import_tpgcompute.go.tmpl' +sweeper: + identifier_field: 'displayName' examples: - name: 'vertex_ai_index_endpoint' primary_resource_id: 'index_endpoint' @@ -49,6 +49,7 @@ examples: vars: network_name: 'network-name' kms_key_name: 'kms-name' + index_endpoint_display_name: 'sample-endpoint' test_vars_overrides: 'network_name': 'acctest.BootstrapSharedServiceNetworkingConnection(t, "vpc-network-1")' 'kms_key_name': 'acctest.BootstrapKMSKeyInLocation(t, "us-central1").CryptoKey.Name' @@ -56,15 +57,19 @@ examples: min_version: beta - name: 'vertex_ai_index_endpoint_with_psc' primary_resource_id: 'index_endpoint' + vars: + index_endpoint_display_name: 'sample-endpoint' - name: 'vertex_ai_index_endpoint_with_false_psc' primary_resource_id: 'index_endpoint' # It's not distinguishable if the psc is false or not set, so we need to skip the test. exclude_import_test: true exclude_docs: true + vars: + index_endpoint_display_name: 'sample-endpoint' - name: 'vertex_ai_index_endpoint_with_public_endpoint' primary_resource_id: 'index_endpoint' - test_vars_overrides: - 'network_name': 'tpgcompute.BootstrapSharedTestNetwork(t, "vertex-ai-index-endpoint")' + vars: + index_endpoint_display_name: 'sample-endpoint' parameters: - name: 'region' type: String diff --git a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_test.tf.tmpl b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_test.tf.tmpl index a44626ef8b25..2d4f33970025 100644 --- a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_test.tf.tmpl +++ b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_test.tf.tmpl @@ -12,7 +12,7 @@ resource "google_kms_crypto_key_iam_member" "vertexai_encrypterdecrypter" { resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" { provider = google-beta - display_name = "sample-endpoint" + display_name = "{{index $.Vars "index_endpoint_display_name"}}" description = "A sample vertex endpoint" region = "us-central1" labels = { diff --git a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_false_psc.tf.tmpl b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_false_psc.tf.tmpl index 6174a390c2cd..7f8cddb5b4c0 100644 --- a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_false_psc.tf.tmpl +++ b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_false_psc.tf.tmpl @@ -1,5 +1,5 @@ resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" { - display_name = "sample-endpoint" + display_name = "{{index $.Vars "index_endpoint_display_name"}}" description = "A sample vertex endpoint" region = "us-central1" labels = { diff --git a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_psc.tf.tmpl b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_psc.tf.tmpl index 37e8995870bf..8e31cbfcfca8 100644 --- a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_psc.tf.tmpl +++ b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_psc.tf.tmpl @@ -1,5 +1,5 @@ resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" { - display_name = "sample-endpoint" + display_name = "{{index $.Vars "index_endpoint_display_name"}}" description = "A sample vertex endpoint" region = "us-central1" labels = { diff --git a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.tmpl b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.tmpl index 76b33617fb93..b04d5e9d7988 100644 --- a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.tmpl +++ b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.tmpl @@ -1,5 +1,5 @@ resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" { - display_name = "sample-endpoint" + display_name = "{{index $.Vars "index_endpoint_display_name"}}" description = "A sample vertex endpoint with an public endpoint" region = "us-central1" labels = {