You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow search SQL Warehouses by name in databricks_sql_warehouse data source (#2458)
* Allow search SQL Warehouses by name in `databricks_sql_warehouse` data source
Right now it's possible to search only by the warehouse ID, but it's not always convenient
although it's possible by using `databricks_sql_warehouses` data source + explicit
filtering. This PR adds a capability to search by either SQL warehouse name or ID.
This fixes#2443
* Update docs/data-sources/sql_warehouse.md
Co-authored-by: Miles Yucht <[email protected]>
* Address review comments
also change documentation a bit to better match the data source - it was copied from the
resource as-is.
* More fixes from review
* code review comments
---------
Co-authored-by: Miles Yucht <[email protected]>
Copy file name to clipboardExpand all lines: docs/data-sources/sql_warehouse.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Retrieves information about a [databricks_sql_warehouse](../resources/sql_wareho
9
9
10
10
## Example usage
11
11
12
-
Retrieve attributes of each SQL warehouses in a workspace
12
+
*Retrieve attributes of each SQL warehouses in a workspace:
13
13
14
14
```hcl
15
15
data "databricks_sql_warehouses" "all" {
@@ -19,32 +19,41 @@ data "databricks_sql_warehouse" "all" {
19
19
for_each = data.databricks_sql.warehouses.ids
20
20
id = each.value
21
21
}
22
+
```
23
+
24
+
* Search for a specific SQL Warehouse by name:
22
25
26
+
```hcl
27
+
data "databricks_sql_warehouse" "all" {
28
+
name = "Starter Warehouse"
29
+
}
23
30
```
24
31
25
32
## Argument reference
26
33
27
-
*`id` - (Required) The ID of the SQL warehouse
34
+
*`id` - (Required, if `name` isn't specified) The ID of the SQL warehouse.
35
+
*`name` - (Required, if `id` isn't specified) Name of the SQL warehouse to search (case-sensitive).
28
36
29
37
## Attribute reference
30
38
31
39
This data source exports the following attributes:
32
40
33
-
*`name` - Name of the SQL warehouse. Must be unique.
41
+
*`id` - The ID of the SQL warehouse.
42
+
*`name` - Name of the SQL warehouse.
34
43
*`cluster_size` - The size of the clusters allocated to the warehouse: "2X-Small", "X-Small", "Small", "Medium", "Large", "X-Large", "2X-Large", "3X-Large", "4X-Large".
35
44
*`min_num_clusters` - Minimum number of clusters available when a SQL warehouse is running.
36
45
*`max_num_clusters` - Maximum number of clusters available when a SQL warehouse is running.
37
46
*`auto_stop_mins` - Time in minutes until an idle SQL warehouse terminates all clusters and stops.
38
-
*`tags` - Databricks tags all warehouse resources with these tags.
47
+
*`tags` - tags used for SQL warehouse resources.
39
48
*`spot_instance_policy` - The spot policy to use for allocating instances to clusters: `COST_OPTIMIZED` or `RELIABILITY_OPTIMIZED`.
40
-
*`enable_photon` - Whether to enable [Photon](https://databricks.com/product/delta-engine).
41
-
*`enable_serverless_compute` - Whether this SQL warehouse is a serverless SQL warehouse. If this value is `true`, `warehouse_type` must be `PRO`.
49
+
*`enable_photon` - Whether [Photon](https://databricks.com/product/delta-engine) is enabled.
50
+
*`enable_serverless_compute` - Whether this SQL warehouse is a serverless SQL warehouse.
42
51
43
52
-**For AWS**: If your account needs updated [terms of use](https://docs.databricks.com/sql/admin/serverless.html#accept-terms), workspace admins are prompted in the Databricks SQL UI. A workspace must meet the [requirements](https://docs.databricks.com/sql/admin/serverless.html#requirements) and might require an update its instance profile role to [add a trust relationship](https://docs.databricks.com/sql/admin/serverless.html#aws-instance-profile-setup).
44
53
45
54
-**For Azure**, you must [enable your workspace for serverless SQL warehouse](https://learn.microsoft.com/azure/databricks/sql/admin/serverless).
46
55
47
-
*`warehouse_type` - SQL warehouse type. See for [AWS](https://docs.databricks.com/sql/index.html#warehouse-types) or [Azure](https://learn.microsoft.com/azure/databricks/sql/#warehouse-types). Set to `PRO` or `CLASSIC`. If the field `enable_serverless_compute` has the value `true`, this needs to be set to `PRO`.
56
+
*`warehouse_type` - SQL warehouse type. See for [AWS](https://docs.databricks.com/sql/index.html#warehouse-types) or [Azure](https://learn.microsoft.com/azure/databricks/sql/#warehouse-types).
48
57
*`channel` block, consisting of following fields:
49
58
*`name` - Name of the Databricks SQL release channel. Possible values are: `CHANNEL_NAME_PREVIEW` and `CHANNEL_NAME_CURRENT`. Default is `CHANNEL_NAME_CURRENT`.
0 commit comments