Skip to content

Commit 6c5ed49

Browse files
authored
Made vertex ai index endpoints & vertex ai index sweepable (GoogleCloudPlatform#17510)
1 parent 46d34c6 commit 6c5ed49

6 files changed

Lines changed: 15 additions & 8 deletions

mmv1/products/vertexai/Index.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ async:
3737
resource_inside_response: true
3838
custom_code:
3939
custom_update: 'templates/terraform/custom_update/vertex_ai_index.go.tmpl'
40+
sweeper:
41+
identifier_field: 'displayName'
4042
examples:
4143
- name: 'vertex_ai_index'
4244
min_version: beta

mmv1/products/vertexai/IndexEndpoint.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ async:
3535
base_url: '{{op_id}}'
3636
result:
3737
resource_inside_response: true
38-
custom_code:
39-
test_constants: 'templates/terraform/test_constants/import_tpgcompute.go.tmpl'
38+
sweeper:
39+
identifier_field: 'displayName'
4040
examples:
4141
- name: 'vertex_ai_index_endpoint'
4242
primary_resource_id: 'index_endpoint'
@@ -49,22 +49,27 @@ examples:
4949
vars:
5050
network_name: 'network-name'
5151
kms_key_name: 'kms-name'
52+
index_endpoint_display_name: 'sample-endpoint'
5253
test_vars_overrides:
5354
'network_name': 'acctest.BootstrapSharedServiceNetworkingConnection(t, "vpc-network-1")'
5455
'kms_key_name': 'acctest.BootstrapKMSKeyInLocation(t, "us-central1").CryptoKey.Name'
5556
exclude_docs: true
5657
min_version: beta
5758
- name: 'vertex_ai_index_endpoint_with_psc'
5859
primary_resource_id: 'index_endpoint'
60+
vars:
61+
index_endpoint_display_name: 'sample-endpoint'
5962
- name: 'vertex_ai_index_endpoint_with_false_psc'
6063
primary_resource_id: 'index_endpoint'
6164
# It's not distinguishable if the psc is false or not set, so we need to skip the test.
6265
exclude_import_test: true
6366
exclude_docs: true
67+
vars:
68+
index_endpoint_display_name: 'sample-endpoint'
6469
- name: 'vertex_ai_index_endpoint_with_public_endpoint'
6570
primary_resource_id: 'index_endpoint'
66-
test_vars_overrides:
67-
'network_name': 'tpgcompute.BootstrapSharedTestNetwork(t, "vertex-ai-index-endpoint")'
71+
vars:
72+
index_endpoint_display_name: 'sample-endpoint'
6873
parameters:
6974
- name: 'region'
7075
type: String

mmv1/templates/terraform/examples/vertex_ai_index_endpoint_test.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ resource "google_kms_crypto_key_iam_member" "vertexai_encrypterdecrypter" {
1212

1313
resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" {
1414
provider = google-beta
15-
display_name = "sample-endpoint"
15+
display_name = "{{index $.Vars "index_endpoint_display_name"}}"
1616
description = "A sample vertex endpoint"
1717
region = "us-central1"
1818
labels = {

mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_false_psc.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" {
2-
display_name = "sample-endpoint"
2+
display_name = "{{index $.Vars "index_endpoint_display_name"}}"
33
description = "A sample vertex endpoint"
44
region = "us-central1"
55
labels = {

mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_psc.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" {
2-
display_name = "sample-endpoint"
2+
display_name = "{{index $.Vars "index_endpoint_display_name"}}"
33
description = "A sample vertex endpoint"
44
region = "us-central1"
55
labels = {

mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "google_vertex_ai_index_endpoint" "{{$.PrimaryResourceId}}" {
2-
display_name = "sample-endpoint"
2+
display_name = "{{index $.Vars "index_endpoint_display_name"}}"
33
description = "A sample vertex endpoint with an public endpoint"
44
region = "us-central1"
55
labels = {

0 commit comments

Comments
 (0)