diff --git a/docs/resources/warehouse.md b/docs/resources/warehouse.md index 96aea0dfb5..4137481f9c 100644 --- a/docs/resources/warehouse.md +++ b/docs/resources/warehouse.md @@ -45,6 +45,7 @@ resource "snowflake_warehouse" "warehouse" { - `tag` (Block List, Deprecated) Definitions of a tag to associate with the resource. (see [below for nested schema](#nestedblock--tag)) - `wait_for_provisioning` (Boolean) Specifies whether the warehouse, after being resized, waits for all the servers to provision before executing any queued or new queries. - `warehouse_size` (String) Specifies the size of the virtual warehouse. Larger warehouse sizes 5X-Large and 6X-Large are currently in preview and only available on Amazon Web Services (AWS). +- `warehouse_type` (String) Specifies a STANDARD or SNOWPARK-OPTIMIZED warehouse ### Read-Only diff --git a/pkg/resources/warehouse.go b/pkg/resources/warehouse.go index 60902340b0..44bc2feabd 100644 --- a/pkg/resources/warehouse.go +++ b/pkg/resources/warehouse.go @@ -19,6 +19,7 @@ var warehouseProperties = []string{ "scaling_policy", "auto_suspend", "auto_resume", "resource_monitor", "max_concurrency_level", "statement_queued_timeout_in_seconds", "statement_timeout_in_seconds", "enable_query_acceleration", "query_acceleration_max_scale_factor", + "warehouse_type", } var warehouseSchema = map[string]*schema.Schema{ @@ -134,6 +135,13 @@ var warehouseSchema = map[string]*schema.Schema{ ValidateFunc: validation.IntBetween(0, 100), Description: "Specifies the maximum scale factor for leasing compute resources for query acceleration. The scale factor is used as a multiplier based on warehouse size.", }, + "warehouse_type": { + Type: schema.TypeString, + Optional: true, + Default: "STANDARD", + ValidateFunc: validation.StringInSlice([]string{"STANDARD", "SNOWPARK-OPTIMIZED"}, true), + Description: "Specifies a STANDARD or SNOWPARK-OPTIMIZED warehouse", + }, "tag": tagReferenceSchema, } @@ -228,6 +236,10 @@ func ReadWarehouse(d *schema.ResourceData, meta interface{}) error { if err != nil { return err } + err = d.Set("warehouse_type", w.WarehouseType) + if err != nil { + return err + } stmt = warehouseBuilder.ShowParameters() paramRows, err := snowflake.Query(db, stmt) diff --git a/pkg/snowflake/warehouse.go b/pkg/snowflake/warehouse.go index 0134033ea8..e9b8eefad6 100644 --- a/pkg/snowflake/warehouse.go +++ b/pkg/snowflake/warehouse.go @@ -86,6 +86,7 @@ type warehouse struct { Suspended int64 `db:"suspended"` UUID string `db:"uuid"` ScalingPolicy string `db:"scaling_policy"` + WarehouseType string `db:"warehouse_type"` } // warehouseParams struct to represent a row of parameters.