alterWarehouseState
Suspends or resumes a Snowflake warehouse. Suspended warehouses do not consume credits but queries cannot be executed against them.
Note: This change type does not support automatic rollback or database inspection features (snapshot, diff, diff-changelog, and generate-changelog commands).
Available attributes
Attribute | Type | Description | Required |
|---|---|---|---|
| String | Name of the warehouse to modify | Yes |
| String | Target state: | Yes |
| Boolean | If true, do not throw an error if the warehouse does not exist | No |
State values
Value | Description |
|---|---|
| Suspends the warehouse, stopping all queries |
| Resumes a suspended warehouse |
| Resumes only if currently suspended (idempotent) |
<?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">
<!-- Suspend warehouse -->
<changeSet id="suspend-warehouse" author="examples">
<pro-snowflake:alterWarehouseState
warehouseName="ANALYTICS_WH"
state="suspend"/>
</changeSet>
<!-- Resume warehouse -->
<changeSet id="resume-warehouse" author="examples">
<pro-snowflake:alterWarehouseState
warehouseName="ANALYTICS_WH"
state="resume"/>
</changeSet>
<!-- Resume if suspended (idempotent) -->
<changeSet id="resume-if-suspended" author="examples">
<pro-snowflake:alterWarehouseState
warehouseName="ANALYTICS_WH"
ifExists="true"
state="resumeIfSuspended"/>
</changeSet>
</databaseChangeLog>