Skip to content

Commit 7399207

Browse files
authored
[Exporter] Improve handling of dependencies for vector search index (#4989)
## Changes <!-- Summary of your changes that are easy to understand --> ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] using Go SDK - [ ] using TF Plugin Framework - [x] has entry in `NEXT_CHANGELOG.md` file
1 parent 7465b57 commit 7399207

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@
1616

1717
### Exporter
1818

19+
* Improve handling of dependencies for vector search index ([#4989](https://github.com/databricks/terraform-provider-databricks/pull/4989)).
20+
1921
### Internal Changes

exporter/codegen.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ func (ic *importContext) generateVariables() error {
536536
for _, block := range tbody.Blocks() {
537537
typ := block.Type()
538538
labels := block.Labels()
539-
// log.Printf("[DEBUG] blockBody: %v %v\n", typ, labels)
540539
_, present := ic.variables[labels[0]]
541540
if typ == "variable" && present {
542541
log.Printf("[DEBUG] Ignoring variable '%s' that will be re-exported", labels[0])

exporter/importables.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,6 +2699,12 @@ var resourcesMap map[string]importable = map[string]importable{
26992699
ID: col.EmbeddingModelEndpointName,
27002700
})
27012701
}
2702+
if col.ModelEndpointNameForQuery != "" {
2703+
ic.Emit(&resource{
2704+
Resource: "databricks_model_serving",
2705+
ID: col.ModelEndpointNameForQuery,
2706+
})
2707+
}
27022708
}
27032709
}
27042710
if vsi.DirectAccessIndexSpec != nil {
@@ -2709,6 +2715,12 @@ var resourcesMap map[string]importable = map[string]importable{
27092715
ID: col.EmbeddingModelEndpointName,
27102716
})
27112717
}
2718+
if col.ModelEndpointNameForQuery != "" {
2719+
ic.Emit(&resource{
2720+
Resource: "databricks_model_serving",
2721+
ID: col.ModelEndpointNameForQuery,
2722+
})
2723+
}
27122724
}
27132725
}
27142726
return nil
@@ -2717,7 +2729,9 @@ var resourcesMap map[string]importable = map[string]importable{
27172729
{Path: "delta_sync_index_spec.source_table", Resource: "databricks_sql_table"},
27182730
{Path: "endpoint_name", Resource: "databricks_vector_search_endpoint"},
27192731
{Path: "delta_sync_index_spec.embedding_source_columns.embedding_model_endpoint_name", Resource: "databricks_model_serving"},
2732+
{Path: "delta_sync_index_spec.embedding_source_columns.model_endpoint_name_for_query", Resource: "databricks_model_serving"},
27202733
{Path: "direct_access_index_spec.embedding_source_columns.embedding_model_endpoint_name", Resource: "databricks_model_serving"},
2734+
{Path: "direct_access_index_spec.embedding_source_columns.model_endpoint_name_for_query", Resource: "databricks_model_serving"},
27212735
},
27222736
},
27232737
"databricks_mws_network_connectivity_config": {
@@ -2759,6 +2773,13 @@ var resourcesMap map[string]importable = map[string]importable{
27592773
Name: nc.Name + "_" + resourceId + "_" + rule.GroupId,
27602774
})
27612775
}
2776+
for _, rule := range nc.EgressConfig.TargetRules.AwsPrivateEndpointRules {
2777+
ic.Emit(&resource{
2778+
Resource: "databricks_mws_ncc_private_endpoint_rule",
2779+
ID: nc.NetworkConnectivityConfigId + "/" + rule.RuleId,
2780+
Name: nc.Name + "_" + rule.EndpointService,
2781+
})
2782+
}
27622783
}
27632784
}
27642785
return nil

0 commit comments

Comments
 (0)