createWarehouse
Creates a new Snowflake warehouse with comprehensive configuration options including warehouse type, size, auto-scaling, query acceleration, resource management, and tags.
Important: CREATE WAREHOUSE automatically switches the current session to use the newly created warehouse. If you need to continue using a different warehouse for subsequent operations, use the useWarehouse change type to switch back.
Note: Automatic rollback drops the warehouse.
Available attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Name of the warehouse to create | Yes |
| Boolean | If true, only creates if the warehouse doesn't exist | No* |
| Boolean | If true, replaces the warehouse if it already exists | No* |
| Boolean | If true, alters the warehouse if it already exists | No* |
| String | Type: STANDARD (default), SNOWPARK-OPTIMIZED | No |
| Enum | Size: XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE-X6LARGE | No |
| Integer | Maximum clusters for multi-cluster warehouse (1-10) | No |
| Integer | Minimum clusters for multi-cluster warehouse (1-10) | No |
| Enum | Scaling policy: STANDARD or ECONOMY | No |
| String | Seconds of inactivity before auto-suspend, or NULL to disable | No |
| Boolean | If true, warehouse auto-resumes when queried | No |
| Boolean | If true, warehouse is created in suspended state | No |
| String | Name of resource monitor to assign | No |
| String | Resource constraint (e.g., STANDARD_GEN_2, MEMORY_16X) | No |
| Boolean | Enable query acceleration service | No |
| Integer | Max scale factor for query acceleration (0-100) | No |
| Integer | Maximum concurrent queries (1-8) | No |
| Integer | Max seconds a query can be queued (0-43200) | No |
| Integer | Max seconds a query can run (0-604800) | No |
| String | Comment describing the warehouse | No |
| Nested | Key-value pairs of tags to apply | No |
*Only one of ifNotExists, replaceIfExists, or alterIfExists can be true.
warehouseName must be 255 characters or less, contain only letters, numbers, underscores, dollar signs, and hyphens, and cannot start with a number.
autoSuspend must be a numeric value (seconds) or the literal NULL to disable auto-suspend.
Nested elements
tags (MapWrapper) - Key-value pairs of tags to apply:
Element | Attribute | Description | Required |
|---|---|---|---|
|
| Tag name | Yes |
|
| Tag value | Yes |
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:pro-snowflake="http://www.liquibase.org/xml/ns/pro-snowflake"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
http://www.liquibase.org/xml/ns/pro-snowflake
http://www.liquibase.org/xml/ns/pro-snowflake/liquibase-pro-snowflake-latest.xsd">
<!-- Basic warehouse -->
<changeSet id="create-basic" author="examples">
<pro-snowflake:createWarehouse
warehouseName="ETL_WH"
ifNotExists="true"
warehouseSize="SMALL"/>
<!-- Restore session to default warehouse -->
<pro-snowflake:useWarehouse warehouseName="DEFAULT_WH"/>
</changeSet>
<!-- Full configuration -->
<changeSet id="create-full" author="examples">
<pro-snowflake:createWarehouse
warehouseName="COMPUTE_WH"
ifNotExists="true"
warehouseSize="MEDIUM"
warehouseType="STANDARD"
maxClusterCount="5"
minClusterCount="1"
scalingPolicy="ECONOMY"
autoSuspend="600"
autoResume="true"
initiallySuspended="true"
resourceMonitor="MONTHLY_QUOTA"
resourceConstraint="STANDARD_GEN_2"
enableQueryAcceleration="true"
queryAccelerationMaxScaleFactor="8"
maxConcurrencyLevel="8"
statementQueuedTimeoutInSeconds="3600"
statementTimeoutInSeconds="7200"
comment="Production compute warehouse">
<pro-snowflake:tags>
<pro-snowflake:entry key="environment" value="production"/>
<pro-snowflake:entry key="cost_center" value="analytics"/>
</pro-snowflake:tags>
</pro-snowflake:createWarehouse>
<pro-snowflake:useWarehouse warehouseName="DEFAULT_WH"/>
</changeSet>
</databaseChangeLog>