From 741d37dee5203fe3b9c6a75036ca33db934ddbb9 Mon Sep 17 00:00:00 2001 From: Shotaro Kohama Date: Sat, 2 Sep 2023 12:46:17 -0700 Subject: [PATCH] feat: make it possible to create a public vertex ai index endpoint --- mmv1/products/vertexai/IndexEndpoint.yaml | 14 ++++++++++++++ ...x_ai_index_endpoint_with_public_endpoint.tf.erb | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.erb diff --git a/mmv1/products/vertexai/IndexEndpoint.yaml b/mmv1/products/vertexai/IndexEndpoint.yaml index 029746f160c9..465147a362ed 100644 --- a/mmv1/products/vertexai/IndexEndpoint.yaml +++ b/mmv1/products/vertexai/IndexEndpoint.yaml @@ -53,6 +53,11 @@ examples: network_name: "network-name" test_vars_overrides: network_name: 'acctest.BootstrapSharedTestNetwork(t, "vertex-ai-index-endpoint")' + - !ruby/object:Provider::Terraform::Examples + name: "vertex_ai_index_endpoint_with_public_endpoint" + primary_resource_id: "index_endpoint" + test_vars_overrides: + network_name: 'acctest.BootstrapSharedTestNetwork(t, "vertex-ai-index-endpoint")' parameters: - !ruby/object:Api::Type::String name: region @@ -97,3 +102,12 @@ properties: [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): `projects/{project}/global/networks/{network}`. Where `{project}` is a project number, as in `12345`, and `{network}` is network name. immutable: true + - !ruby/object:Api::Type::Boolean + name: publicEndpointEnabled + immutable: true + ignore_read: true + description: If true, the deployed index will be accessible through public endpoint. + - !ruby/object:Api::Type::String + name: publicEndpointDomainName + output: true + description: If publicEndpointEnabled is true, this field will be populated with the domain name to use for this index endpoint. diff --git a/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.erb b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.erb new file mode 100644 index 000000000000..df17d058cb9e --- /dev/null +++ b/mmv1/templates/terraform/examples/vertex_ai_index_endpoint_with_public_endpoint.tf.erb @@ -0,0 +1,11 @@ +resource "google_vertex_ai_index_endpoint" "<%= ctx[:primary_resource_id] %>" { + display_name = "sample-endpoint" + description = "A sample vertex endpoint with an public endpoint" + region = "us-central1" + labels = { + label-one = "value-one" + } + + public_endpoint_enabled = true +} +