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

warehouseName

String

Name of the warehouse to create

Yes

ifNotExists

Boolean

If true, only creates if the warehouse doesn't exist

No*

replaceIfExists

Boolean

If true, replaces the warehouse if it already exists

No*

alterIfExists

Boolean

If true, alters the warehouse if it already exists

No*

warehouseType

String

Type: STANDARD (default), SNOWPARK-OPTIMIZED

No

warehouseSize

Enum

Size: XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE-X6LARGE

No

maxClusterCount

Integer

Maximum clusters for multi-cluster warehouse (1-10)

No

minClusterCount

Integer

Minimum clusters for multi-cluster warehouse (1-10)

No

scalingPolicy

Enum

Scaling policy: STANDARD or ECONOMY

No

autoSuspend

String

Seconds of inactivity before auto-suspend, or NULL to disable

No

autoResume

Boolean

If true, warehouse auto-resumes when queried

No

initiallySuspended

Boolean

If true, warehouse is created in suspended state

No

resourceMonitor

String

Name of resource monitor to assign

No

resourceConstraint

String

Resource constraint (e.g., STANDARD_GEN_2, MEMORY_16X)

No

enableQueryAcceleration

Boolean

Enable query acceleration service

No

queryAccelerationMaxScaleFactor

Integer

Max scale factor for query acceleration (0-100)

No

maxConcurrencyLevel

Integer

Maximum concurrent queries (1-8)

No

statementQueuedTimeoutInSeconds

Integer

Max seconds a query can be queued (0-43200)

No

statementTimeoutInSeconds

Integer

Max seconds a query can run (0-604800)

No

comment

String

Comment describing the warehouse

No

tags

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

entry

key

Tag name

Yes

entry

value

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>