From 7e2c9a790216fd5fbfb4407016cab50337a996cf Mon Sep 17 00:00:00 2001 From: Stephen Lewis Date: Wed, 13 Nov 2024 14:37:35 -0800 Subject: [PATCH 1/2] Made traffic_split field use default_from_api --- mmv1/products/vertexai/Endpoint.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mmv1/products/vertexai/Endpoint.yaml b/mmv1/products/vertexai/Endpoint.yaml index aaf985fced27..966d74035442 100644 --- a/mmv1/products/vertexai/Endpoint.yaml +++ b/mmv1/products/vertexai/Endpoint.yaml @@ -367,15 +367,15 @@ properties: output: true - name: 'trafficSplit' type: String + default_from_api: true 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, use `"{}"`. Leaving unset or setting to `""` will persist the last value returned from the API. state_func: 'func(v interface{}) string { s, _ := structure.NormalizeJsonString(v); return s }' custom_flatten: 'templates/terraform/custom_flatten/json_schema.tmpl' custom_expand: 'templates/terraform/custom_expand/json_schema.tmpl' From e23d3b97885578f02ba3a57267a4bce0d3206dfb Mon Sep 17 00:00:00 2001 From: Stephen Lewis Date: Wed, 13 Nov 2024 15:48:47 -0800 Subject: [PATCH 2/2] Corrected docs --- mmv1/products/vertexai/Endpoint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmv1/products/vertexai/Endpoint.yaml b/mmv1/products/vertexai/Endpoint.yaml index 966d74035442..4a6bc362f498 100644 --- a/mmv1/products/vertexai/Endpoint.yaml +++ b/mmv1/products/vertexai/Endpoint.yaml @@ -375,7 +375,7 @@ properties: 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 more information. - ~> **Note:** To set the map to empty, use `"{}"`. Leaving unset or setting to `""` will persist the last value returned from the API. + ~> **Note:** To set the map to empty, set `"{}"`, apply, and then remove the field from your config. state_func: 'func(v interface{}) string { s, _ := structure.NormalizeJsonString(v); return s }' custom_flatten: 'templates/terraform/custom_flatten/json_schema.tmpl' custom_expand: 'templates/terraform/custom_expand/json_schema.tmpl'