Add instance_pools resource type to bundles (direct engine only)#5934
Add instance_pools resource type to bundles (direct engine only)#5934radakam wants to merge 3 commits into
Conversation
Adds support for defining Databricks instance pools as a bundle resource. Instance pools are implemented as a direct-engine-only resource: they are registered in the direct engine's SupportedResources but not wired to Terraform, so ValidateDirectOnlyResources rejects them under the terraform engine. Includes the resource definition and ConfigResource implementation, the direct-engine adapter (create/read/edit/delete + RemapState), presets and bundle-permission wiring, workspace URL generation, testserver CRUD handlers, schema annotations, and unit + acceptance test coverage.
…lidation Fixes CI failures from adding the instance_pools resource: update the workspace-open supported-type lists, skip instance_pools (direct-only) in the Terraform lifecycle test, extend the statemgmt StateToBundle tests for full resource coverage, and regenerate the validation enum/required fields.
Adds an instance_pools invariant test config (with permissions) so TestInvariantConfigsCoverage passes, wires it into the invariant matrix, and excludes it from the migrate variant since instance_pools is direct-only and the migrate seed deploy uses Terraform. Also refreshes the experimental/open acceptance golden output to include instance_pools.
Integration test reportCommit: e17841b
8 interesting tests: 4 RECOVERED, 4 SKIP
Top 10 slowest tests (at least 2 minutes):
|
Approval status: pending
|
| } | ||
|
|
||
| func (r *ResourceInstancePool) DoCreate(ctx context.Context, config *compute.CreateInstancePool) (string, *compute.GetInstancePool, error) { | ||
| resp, err := r.client.InstancePools.Create(ctx, *config) |
There was a problem hiding this comment.
I believe instance pools have ACTIVE / STOPPED state? Shall we integrate lifecycle: started option here to like we do for clusters and wait for ACTIVE state if we need to?
There was a problem hiding this comment.
The states are there, but the analogy doesn't quite fit I think. Unlike clusters, InstancePools doesn't have a start/stop operation or a waiter, Create returns immediately, with no PENDING → ACTIVE transition, so there isn't really anything for a lifecycle.started flag to trigger or wait for. Or is there a use case I'm missing?
Changes
Add support for a new
instance_poolsresource type in DABs. This includes:resources.InstancePoolconfig type (wrappingcompute.CreateInstancePool) with permissions support.ResourceInstancePool) covering create/read/update/delete, state remapping, and field behaviors (ignored remote changes, recreate-on-change, backend defaults)./api/2.0/instance-pools/*endpoints.Instance pools are only supported in direct deployment mode.
Why
Users want to manage instance pools—pre-provisioned, idle cloud instances that reduce cluster start and auto-scaling times—declaratively alongside their other bundle resources, instead of provisioning them out-of-band.
Closes #5641.
Tests
acceptance/bundle/resources/instance_pools) exercising validate, summary, deploy, update, and destroy, asserting the exact create/edit/delete API requests.instance_poolscoverage to invariant acceptance suites (no-drift, migrate, continue), with the resource excluded from Terraform-mode migration since it's direct-only.