Skip to content

Commit

Permalink
Added support for X5LARGE and X6LARGE warehouses (Snowflake-Labs#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
robbruce authored and jtzero committed Aug 19, 2021
1 parent 20942da commit 4b1a581
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/resources/warehouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource snowflake_warehouse w {

### Required

- **name** (String)
- **name** (String) Identifier for the virtual warehouse; must be unique for your account.

### Optional

Expand All @@ -42,7 +42,7 @@ resource snowflake_warehouse w {
- **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)
- **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).

## Import

Expand Down
9 changes: 6 additions & 3 deletions pkg/resources/warehouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ var warehouseProperties = []string{

var warehouseSchema = map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
Description: "Identifier for the virtual warehouse; must be unique for your account.",
},
"comment": {
Type: schema.TypeString,
Expand All @@ -37,14 +38,16 @@ var warehouseSchema = map[string]*schema.Schema{
ValidateFunc: validation.StringInSlice([]string{
"XSMALL", "X-SMALL", "SMALL", "MEDIUM", "LARGE", "XLARGE",
"X-LARGE", "XXLARGE", "X2LARGE", "2X-LARGE", "XXXLARGE", "X3LARGE",
"3X-LARGE", "X4LARGE", "4X-LARGE",
"3X-LARGE", "X4LARGE", "4X-LARGE", "X5LARGE", "5X-LARGE", "X6LARGE",
"6X-LARGE",
}, true),
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
normalize := func(s string) string {
return strings.ToUpper(strings.Replace(s, "-", "", -1))
}
return normalize(old) == normalize(new)
},
Description: "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).",
},
"max_cluster_count": {
Type: schema.TypeInt,
Expand Down

0 comments on commit 4b1a581

Please sign in to comment.