Skip to content

Commit 1617350

Browse files
mgyuchtalexott
andauthored
Ensure workload_size is marked as non-computed for databricks_model_serving (#5111)
## Changes `workload_size` is currently marked as `optional` and `computed`. As a result, if a user sets a model serving endpoint using `workload_size` initially, then removes it in favor of `min_provisioned_concurrency`/`max_provisioned_concurrency`, `workload_size` remains in the state. As a result, it is also included in the request sent to the REST API, which is invalid. By marking this field as non-computed, it should be removed from the plan when a user removes it from their config. This means it won't be sent to the REST API. ## Tests - [ ] Manual test: created a model serving endpoint with `workload_size` set, then removed it and set min/max provisioned concurrency fields, and the apply succeeded. --------- Co-authored-by: Alex Ott <[email protected]>
1 parent 5636588 commit 1617350

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Bug Fixes
1212

13+
* Mark `workload_size` as not computed in `databricks_model_serving` ([#5111](https://github.com/databricks/terraform-provider-databricks/pull/5111))
1314
* Fix Inconsistent Plan Errors in Permissions Resource ([#5091](https://github.com/databricks/terraform-provider-databricks/pull/5091))
1415

1516
### Documentation

serving/resource_model_serving.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,14 @@ func ResourceModelServing() common.Resource {
154154

155155
common.CustomizeSchemaPath(m, "config", "served_models", "name").SetComputed()
156156
common.CustomizeSchemaPath(m, "config", "served_models", "workload_type").SetComputed()
157+
common.CustomizeSchemaPath(m, "config", "served_models", "workload_size").SetSuppressDiff()
157158
common.CustomizeSchemaPath(m, "config", "served_models", "scale_to_zero_enabled").SetOptional().SetDefault(true)
158159
common.CustomizeSchemaPath(m, "config", "served_models").SetDeprecated("Please use 'config.served_entities' instead of 'config.served_models'.")
159160
common.CustomizeSchemaPath(m, "rate_limits").SetDeprecated("Please use AI Gateway to manage rate limits.")
160161

161162
common.CustomizeSchemaPath(m, "config", "served_entities", "name").SetComputed()
162-
common.CustomizeSchemaPath(m, "config", "served_entities", "workload_size").SetComputed()
163163
common.CustomizeSchemaPath(m, "config", "served_entities", "workload_type").SetComputed()
164+
common.CustomizeSchemaPath(m, "config", "served_entities", "workload_size").SetSuppressDiff()
164165

165166
// Apply custom suppress diff to traffic config routes for served_model_name and served_entity_name
166167
common.CustomizeSchemaPath(m, "config", "traffic_config", "routes", "served_model_name").SetCustomSuppressDiff(suppressRouteModelEntityNameDiff)

0 commit comments

Comments
 (0)