diff --git a/docs/data-sources/system_get_snowflake_platform_info.md b/docs/data-sources/system_get_snowflake_platform_info.md new file mode 100644 index 0000000000..48d099ef9a --- /dev/null +++ b/docs/data-sources/system_get_snowflake_platform_info.md @@ -0,0 +1,27 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "snowflake_system_get_snowflake_platform_info Data Source - terraform-provider-snowflake" +subcategory: "" +description: |- + +--- + +# snowflake_system_get_snowflake_platform_info (Data Source) + + + + + + +## Schema + +### Optional + +- **id** (String) The ID of this resource. + +### Read-Only + +- **aws_vpc_ids** (List of String) Snowflake AWS Virtual Private Cloud IDs +- **azure_vnet_subnet_ids** (List of String) Snowflake Azure Virtual Network Subnet IDs + + diff --git a/docs/resources/warehouse.md b/docs/resources/warehouse.md index 56ca19b58e..213c8b1bfe 100644 --- a/docs/resources/warehouse.md +++ b/docs/resources/warehouse.md @@ -35,9 +35,11 @@ resource snowflake_warehouse w { - **id** (String) The ID of this resource. - **initially_suspended** (Boolean) Specifies whether the warehouse is created initially in the ‘Suspended’ state. - **max_cluster_count** (Number) Specifies the maximum number of server clusters for the warehouse. +- **max_concurrency_level** (Number) Object parameter that specifies the concurrency level for SQL statements (i.e. queries and DML) executed by a warehouse. - **min_cluster_count** (Number) Specifies the minimum number of server clusters for the warehouse (only applies to multi-cluster warehouses). - **resource_monitor** (String) Specifies the name of a resource monitor that is explicitly assigned to the warehouse. - **scaling_policy** (String) Specifies the policy for automatically starting and shutting down clusters in a multi-cluster warehouse running in Auto-scale mode. +- **statement_queued_timeout_in_seconds** (Number) Object parameter that specifies the time, in seconds, a SQL statement (query, DDL, DML, etc.) can be queued on a warehouse before it is canceled by the system. - **statement_timeout_in_seconds** (Number) Specifies the time, in seconds, after which a running SQL statement (query, DDL, DML, etc.) is canceled by the system - **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) diff --git a/pkg/resources/warehouse.go b/pkg/resources/warehouse.go index 548297a43d..f799cf3d46 100644 --- a/pkg/resources/warehouse.go +++ b/pkg/resources/warehouse.go @@ -11,12 +11,13 @@ import ( ) // warehouseCreateProperties are only available via the CREATE statement -var warehouseCreateProperties = []string{"initially_suspended", "wait_for_provisioning", "statement_timeout_in_seconds"} +var warehouseCreateProperties = []string{"initially_suspended", "wait_for_provisioning"} var warehouseProperties = []string{ "comment", "warehouse_size", "max_cluster_count", "min_cluster_count", "scaling_policy", "auto_suspend", "auto_resume", - "resource_monitor", + "resource_monitor", "max_concurrency_level", "statement_queued_timeout_in_seconds", + "statement_timeout_in_seconds", } var warehouseSchema = map[string]*schema.Schema{ @@ -84,6 +85,7 @@ var warehouseSchema = map[string]*schema.Schema{ Type: schema.TypeBool, Description: "Specifies whether the warehouse is created initially in the ‘Suspended’ state.", Optional: true, + ForceNew: true, }, "resource_monitor": { Type: schema.TypeString, @@ -95,14 +97,26 @@ var warehouseSchema = map[string]*schema.Schema{ Type: schema.TypeBool, Description: "Specifies whether the warehouse, after being resized, waits for all the servers to provision before executing any queued or new queries.", Optional: true, + ForceNew: true, }, "statement_timeout_in_seconds": { Type: schema.TypeInt, Optional: true, Default: 0, - ForceNew: false, Description: "Specifies the time, in seconds, after which a running SQL statement (query, DDL, DML, etc.) is canceled by the system", }, + "statement_queued_timeout_in_seconds": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "Object parameter that specifies the time, in seconds, a SQL statement (query, DDL, DML, etc.) can be queued on a warehouse before it is canceled by the system.", + }, + "max_concurrency_level": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + Description: "Object parameter that specifies the concurrency level for SQL statements (i.e. queries and DML) executed by a warehouse.", + }, } // Warehouse returns a pointer to the resource representing a warehouse @@ -175,6 +189,18 @@ func ReadWarehouse(d *schema.ResourceData, meta interface{}) error { if err != nil { return err } + err = d.Set("statement_timeout_in_seconds", w.StatementTimeoutInSeconds) + if err != nil { + return err + } + err = d.Set("statement_queued_timeout_in_seconds", w.StatementQueuedTimeoutInSeconds) + if err != nil { + return err + } + err = d.Set("max_concurrency_level", w.MaxConcurrencyLevel) + if err != nil { + return err + } err = d.Set("resource_monitor", w.ResourceMonitor) return err diff --git a/pkg/resources/warehouse_acceptance_test.go b/pkg/resources/warehouse_acceptance_test.go index 59c1e47efa..eb72a03f8d 100644 --- a/pkg/resources/warehouse_acceptance_test.go +++ b/pkg/resources/warehouse_acceptance_test.go @@ -55,7 +55,7 @@ func TestAcc_Warehouse(t *testing.T) { ResourceName: "snowflake_warehouse.w", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"initially_suspended", "wait_for_provisioning", "statement_timeout_in_seconds"}, + ImportStateVerifyIgnore: []string{"initially_suspended", "wait_for_provisioning"}, }, }, }) diff --git a/pkg/snowflake/warehouse.go b/pkg/snowflake/warehouse.go index 8ed466ab77..25b344569d 100644 --- a/pkg/snowflake/warehouse.go +++ b/pkg/snowflake/warehouse.go @@ -16,35 +16,38 @@ func Warehouse(name string) *Builder { // warehouse is a go representation of a grant that can be used in conjunction // with github.com/jmoiron/sqlx type warehouse struct { - Name string `db:"name"` - State string `db:"state"` - Type string `db:"type"` - Size string `db:"size"` - MinClusterCount int64 `db:"min_cluster_count"` - MaxClusterCount int64 `db:"max_cluster_count"` - StartedClusters int64 `db:"started_clusters"` - Running int64 `db:"running"` - Queued int64 `db:"queued"` - IsDefault string `db:"is_default"` - IsCurrent string `db:"is_current"` - AutoSuspend int64 `db:"auto_suspend"` - AutoResume bool `db:"auto_resume"` - Available string `db:"available"` - Provisioning string `db:"provisioning"` - Quiescing string `db:"quiescing"` - Other string `db:"other"` - CreatedOn time.Time `db:"created_on"` - ResumedOn time.Time `db:"resumed_on"` - UpdatedOn time.Time `db:"updated_on"` - Owner string `db:"owner"` - Comment string `db:"comment"` - ResourceMonitor string `db:"resource_monitor"` - Actives int64 `db:"actives"` - Pendings int64 `db:"pendings"` - Failed int64 `db:"failed"` - Suspended int64 `db:"suspended"` - UUID string `db:"uuid"` - ScalingPolicy string `db:"scaling_policy"` + Name string `db:"name"` + State string `db:"state"` + Type string `db:"type"` + Size string `db:"size"` + MinClusterCount int64 `db:"min_cluster_count"` + MaxClusterCount int64 `db:"max_cluster_count"` + StartedClusters int64 `db:"started_clusters"` + Running int64 `db:"running"` + Queued int64 `db:"queued"` + IsDefault string `db:"is_default"` + IsCurrent string `db:"is_current"` + AutoSuspend int64 `db:"auto_suspend"` + AutoResume bool `db:"auto_resume"` + Available string `db:"available"` + Provisioning string `db:"provisioning"` + Quiescing string `db:"quiescing"` + Other string `db:"other"` + CreatedOn time.Time `db:"created_on"` + ResumedOn time.Time `db:"resumed_on"` + UpdatedOn time.Time `db:"updated_on"` + Owner string `db:"owner"` + Comment string `db:"comment"` + ResourceMonitor string `db:"resource_monitor"` + StatementTimeoutInSeconds int64 `db:"statement_timeout_in_seconds"` + StatementQueuedTimeoutInSeconds int64 `db:"statement_queued_timeout_in_seconds"` + MaxConcurrencyLevel int64 `db:"max_concurrency_level"` + Actives int64 `db:"actives"` + Pendings int64 `db:"pendings"` + Failed int64 `db:"failed"` + Suspended int64 `db:"suspended"` + UUID string `db:"uuid"` + ScalingPolicy string `db:"scaling_policy"` } func ScanWarehouse(row *sqlx.Row) (*warehouse, error) {