Skip to content

Commit

Permalink
Add optional region field (#7770) (#5514)
Browse files Browse the repository at this point in the history
* Add optional region field

* Add field to example and test

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Apr 19, 2023
1 parent 944a050 commit 92469b3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .changelog/7770.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
vertexai: added `region` field to `google_vertex_ai_endpoint`
```
6 changes: 6 additions & 0 deletions google-beta/resource_vertex_ai_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ func ResourceVertexAIEndpoint() *schema.Resource {
ForceNew: true,
Description: `The full name of the Google Compute Engine [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) to which the Endpoint should be peered. Private services access must already be configured for the network. If left unspecified, the Endpoint is not peered with any network. Only one of the fields, network or enable_private_service_connect, can be set. [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.`,
},
"region": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Description: `The region for the resource`,
},
"create_time": {
Type: schema.TypeString,
Computed: true,
Expand Down
6 changes: 4 additions & 2 deletions google-beta/resource_vertex_ai_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestAccVertexAIEndpoint_vertexAiEndpointNetwork(t *testing.T) {
ResourceName: "google_vertex_ai_endpoint.endpoint",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"etag", "location"},
ImportStateVerifyIgnore: []string{"etag", "location", "region"},
},
{
Config: testAccVertexAIEndpoint_vertexAiEndpointNetworkUpdate(context),
Expand All @@ -54,7 +54,7 @@ func TestAccVertexAIEndpoint_vertexAiEndpointNetwork(t *testing.T) {
ResourceName: "google_vertex_ai_endpoint.endpoint",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"etag", "location"},
ImportStateVerifyIgnore: []string{"etag", "location", "region"},
},
},
})
Expand All @@ -67,6 +67,7 @@ resource "google_vertex_ai_endpoint" "endpoint" {
display_name = "sample-endpoint"
description = "A sample vertex endpoint"
location = "us-central1"
region = "us-central1"
labels = {
label-one = "value-one"
}
Expand Down Expand Up @@ -114,6 +115,7 @@ resource "google_vertex_ai_endpoint" "endpoint" {
display_name = "new-sample-endpoint"
description = "An updated sample vertex endpoint"
location = "us-central1"
region = "us-central1"
labels = {
label-two = "value-two"
}
Expand Down
5 changes: 5 additions & 0 deletions website/docs/r/vertex_ai_endpoint.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ resource "google_vertex_ai_endpoint" "endpoint" {
display_name = "sample-endpoint"
description = "A sample vertex endpoint"
location = "us-central1"
region = "us-central1"
labels = {
label-one = "value-one"
}
Expand Down Expand Up @@ -114,6 +115,10 @@ The following arguments are supported:
(Optional)
The full name of the Google Compute Engine [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks) to which the Endpoint should be peered. Private services access must already be configured for the network. If left unspecified, the Endpoint is not peered with any network. Only one of the fields, network or enable_private_service_connect, can be set. [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.

* `region` -
(Optional)
The region for the resource

* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.

Expand Down

0 comments on commit 92469b3

Please sign in to comment.