Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the vertex endpoint resource. #6661

Merged
merged 9 commits into from
Oct 21, 2022
5 changes: 2 additions & 3 deletions mmv1/products/vertexai/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ objects:
- !ruby/object:Api::Resource
name: Endpoint
base_url: projects/{{project}}/locations/{{location}}/endpoints
create_url: projects/{{project}}/locations/{{location}}/endpoints
create_url: projects/{{project}}/locations/{{location}}/endpoints?endpointId={{name}}
self_link: 'projects/{{project}}/locations/{{location}}/endpoints/{{name}}'
update_verb: :PATCH
update_mask: true
Expand Down Expand Up @@ -151,8 +151,7 @@ objects:
properties:
- !ruby/object:Api::Type::String
name: name
description: Output only. The resource name of the Endpoint.
output: true
description: The resource name of the Endpoint.
trodge marked this conversation as resolved.
Show resolved Hide resolved
trodge marked this conversation as resolved.
Show resolved Hide resolved
- !ruby/object:Api::Type::String
name: displayName
description: Required. The display name of the Endpoint. The name can be up to 128 characters long and can consist of any UTF-8 characters.
Expand Down
1 change: 1 addition & 0 deletions mmv1/products/vertexai/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
vars:
name: "vertex_ai_endpoint"
project: "vertex-ai"
endpoint_name: "endpoint-name"
address_name: "address-name"
kms_key_name: "kms-name"
network_name: "network-name"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
resource "google_vertex_ai_endpoint" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['endpoint_name'] %>"
display_name = "sample-endpoint"
description = "A sample vertex endpoint"
location = "us-central1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestAccVertexAIEndpoint_vertexAiEndpointNetwork(t *testing.T) {
t.Parallel()

context := map[string]interface{}{
"endpoint_name": fmt.Sprint(randInt(t) % 9999999999),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is endpoint_name strictly an integer? We try to prefix all names with tf-test- so that sweepers can clean them up if they get left around accidentally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, endpoint name must be numeric and at most 10 digits.

"kms_key_name": BootstrapKMSKeyInLocation(t, "us-central1").CryptoKey.Name,
"network_name": BootstrapSharedTestNetwork(t, "vertex"),
"random_suffix": randString(t, 10),
Expand Down Expand Up @@ -62,6 +63,7 @@ func TestAccVertexAIEndpoint_vertexAiEndpointNetwork(t *testing.T) {
func testAccVertexAIEndpoint_vertexAiEndpointNetwork(context map[string]interface{}) string {
return Nprintf(`
resource "google_vertex_ai_endpoint" "endpoint" {
name = "%{endpoint_name}"
display_name = "sample-endpoint"
description = "A sample vertex endpoint"
location = "us-central1"
Expand Down Expand Up @@ -108,6 +110,7 @@ data "google_project" "project" {}
func testAccVertexAIEndpoint_vertexAiEndpointNetworkUpdate(context map[string]interface{}) string {
return Nprintf(`
resource "google_vertex_ai_endpoint" "endpoint" {
name = "%{endpoint_name}"
display_name = "new-sample-endpoint"
description = "An updated sample vertex endpoint"
location = "us-central1"
Expand Down