Skip to content

Commit

Permalink
Made traffic_split field use default_from_api (#12323) (#8708)
Browse files Browse the repository at this point in the history
[upstream:ab80e5eff2c6c9f9515622b93cdade13a4719e5c]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and NickElliot committed Nov 15, 2024
1 parent 72b4d6e commit cfe8097
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .changelog/12323.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
vertexai: fixed issue with google_vertex_ai_endpoint where upgrading to 6.11.0 would delete all traffic splits that were set outside Terraform (which was previously a required step for all meaningful use of this resource).
```
10 changes: 5 additions & 5 deletions google-beta/services/vertexai/resource_vertex_ai_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,17 @@ Please refer to the field 'effective_labels' for all of the labels present on th
},
"traffic_split": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ValidateFunc: validation.StringIsJSON,
StateFunc: func(v interface{}) string { s, _ := structure.NormalizeJsonString(v); return s },
Description: `A map from a DeployedModel's id to the percentage of this Endpoint's traffic that should be forwarded to that DeployedModel.
If a DeployedModel's id is not listed in this map, then it receives no traffic.
The traffic percentage values must add up to 100, or map must be empty if the Endpoint is to not accept any traffic at a moment.
~> **Note:** The 'traffic_split' setting only applies after a model has been deployed to the endpoint. Re-applying a 'google_vertex_ai_endpoint'
resource without updating the 'traffic_split' post-deployment may lead to your deployed 'traffic_split' being lost; see
The traffic percentage values must add up to 100, or map must be empty if the Endpoint is to not accept any traffic at a moment. See
the 'deployModel' [example](https://cloud.google.com/vertex-ai/docs/general/deployment#deploy_a_model_to_an_endpoint) and
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for details.`,
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for more information.
~> **Note:** To set the map to empty, set '"{}"', apply, and then remove the field from your config.`,
},
"create_time": {
Type: schema.TypeString,
Expand Down
7 changes: 3 additions & 4 deletions website/docs/r/vertex_ai_endpoint.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ The following arguments are supported:
(Optional)
A map from a DeployedModel's id to the percentage of this Endpoint's traffic that should be forwarded to that DeployedModel.
If a DeployedModel's id is not listed in this map, then it receives no traffic.
The traffic percentage values must add up to 100, or map must be empty if the Endpoint is to not accept any traffic at a moment.
~> **Note:** The `traffic_split` setting only applies after a model has been deployed to the endpoint. Re-applying a `google_vertex_ai_endpoint`
resource without updating the `traffic_split` post-deployment may lead to your deployed `traffic_split` being lost; see
The traffic percentage values must add up to 100, or map must be empty if the Endpoint is to not accept any traffic at a moment. See
the `deployModel` [example](https://cloud.google.com/vertex-ai/docs/general/deployment#deploy_a_model_to_an_endpoint) and
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for details.
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for more information.
~> **Note:** To set the map to empty, set `"{}"`, apply, and then remove the field from your config.

* `labels` -
(Optional)
Expand Down

0 comments on commit cfe8097

Please sign in to comment.