diff --git a/bundle/config/resources.go b/bundle/config/resources.go index e932dab0e6..b76f080e2c 100644 --- a/bundle/config/resources.go +++ b/bundle/config/resources.go @@ -92,6 +92,12 @@ func (r *Resources) AllResources() map[string]map[string]ConfigResource { } result["schemas"] = schemaResources + clusterResources := make(map[string]ConfigResource) + for key, schema := range r.Clusters { + clusterResources[key] = schema + } + result["clusters"] = clusterResources + return result } diff --git a/bundle/config/resources/clusters.go b/bundle/config/resources/clusters.go index 6323456669..07cc68d5ad 100644 --- a/bundle/config/resources/clusters.go +++ b/bundle/config/resources/clusters.go @@ -13,6 +13,7 @@ type Cluster struct { ID string `json:"id,omitempty" bundle:"readonly"` Permissions []Permission `json:"permissions,omitempty"` ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"` + URL string `json:"url,omitempty" bundle:"internal"` *compute.ClusterSpec } @@ -37,3 +38,18 @@ func (s *Cluster) Exists(ctx context.Context, w *databricks.WorkspaceClient, id func (s *Cluster) TerraformResourceName() string { return "databricks_cluster" } + +func (s *Cluster) InitializeURL(urlPrefix string, urlSuffix string) { + if s.ID == "" { + return + } + s.URL = urlPrefix + "compute/clusters/" + s.ID + urlSuffix +} + +func (s *Cluster) GetName() string { + return s.Name +} + +func (s *Cluster) GetURL() string { + return s.URL +}