Skip to content

Commit 6fa83f5

Browse files
Made traffic_split field use default_from_api (#12323) (#20350)
[upstream:ab80e5eff2c6c9f9515622b93cdade13a4719e5c] Signed-off-by: Modular Magician <[email protected]>
1 parent f4d43b3 commit 6fa83f5

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.changelog/12323.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
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).
3+
```

google/services/vertexai/resource_vertex_ai_endpoint.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,17 @@ Please refer to the field 'effective_labels' for all of the labels present on th
192192
},
193193
"traffic_split": {
194194
Type: schema.TypeString,
195+
Computed: true,
195196
Optional: true,
196197
ValidateFunc: validation.StringIsJSON,
197198
StateFunc: func(v interface{}) string { s, _ := structure.NormalizeJsonString(v); return s },
198199
Description: `A map from a DeployedModel's id to the percentage of this Endpoint's traffic that should be forwarded to that DeployedModel.
199200
If a DeployedModel's id is not listed in this map, then it receives no traffic.
200-
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.
201-
202-
~> **Note:** The 'traffic_split' setting only applies after a model has been deployed to the endpoint. Re-applying a 'google_vertex_ai_endpoint'
203-
resource without updating the 'traffic_split' post-deployment may lead to your deployed 'traffic_split' being lost; see
201+
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
204202
the 'deployModel' [example](https://cloud.google.com/vertex-ai/docs/general/deployment#deploy_a_model_to_an_endpoint) and
205-
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for details.`,
203+
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for more information.
204+
205+
~> **Note:** To set the map to empty, set '"{}"', apply, and then remove the field from your config.`,
206206
},
207207
"create_time": {
208208
Type: schema.TypeString,

website/docs/r/vertex_ai_endpoint.html.markdown

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,10 @@ The following arguments are supported:
177177
(Optional)
178178
A map from a DeployedModel's id to the percentage of this Endpoint's traffic that should be forwarded to that DeployedModel.
179179
If a DeployedModel's id is not listed in this map, then it receives no traffic.
180-
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.
181-
~> **Note:** The `traffic_split` setting only applies after a model has been deployed to the endpoint. Re-applying a `google_vertex_ai_endpoint`
182-
resource without updating the `traffic_split` post-deployment may lead to your deployed `traffic_split` being lost; see
180+
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
183181
the `deployModel` [example](https://cloud.google.com/vertex-ai/docs/general/deployment#deploy_a_model_to_an_endpoint) and
184-
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for details.
182+
[documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/projects.locations.endpoints/deployModel) for more information.
183+
~> **Note:** To set the map to empty, set `"{}"`, apply, and then remove the field from your config.
185184

186185
* `labels` -
187186
(Optional)

0 commit comments

Comments
 (0)