Skip to content

Commit 9625c8d

Browse files
committed
Stage devops-guidance from Snowflake-Solutions
1 parent be318e8 commit 9625c8d

3 files changed

Lines changed: 478 additions & 0 deletions

File tree

skills/devops-guidance/LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Snowflake Skills License
2+
3+
© 2026 Snowflake Inc. All rights reserved.
4+
5+
LICENSE: Use of these materials (including all code, prompts, assets, files, and other components of these skills (collectively, “Skills”)) is governed by your agreement with Snowflake for the Service. If no separate agreement exists, use is governed by Snowflake’s Terms of Service (available at: https://www.snowflake.com/en/legal/terms-of-service/).
6+
7+
Your applicable agreement is referred to as the "Agreement." "Service" is as defined in the Agreement.
8+
9+
ADDITIONAL RESTRICTIONS: Notwithstanding anything in the Agreement to the contrary, you may not:
10+
11+
* Extract from the Service or retain copies of the Skills outside use with the Service;
12+
* Reproduce or copy the Skills , except for temporary copies created automatically during authorized use of the Service;
13+
* Create derivative works based on the Skills;
14+
* Distribute, sublicense, or transfer the Skills to any third party;
15+
* Make, offer to sell, sell, or import any inventions embodied in the Skills; nor,
16+
* Reverse engineer, decompile, or disassemble the Skills.
17+
18+
The receipt, viewing, or possession of the Skills does not convey or imply any license or right beyond those expressly granted above.
19+
20+
Snowflake retains all rights, title, and interest in the Skills, including all copyrights, trademarks, patents, and all other applicable intellectual property rights.
21+
22+
THE SKILLS ARE PROVIDED “AS IS,” WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SKILLS OR THE USE OR OTHER DEALINGS IN THE SKILLS.

skills/devops-guidance/SKILL.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
name: devops-guidance
3+
title: Snowflake DevOps Guidance
4+
summary: Opinionated guidance on CI/CD, Database Change Management, and deployment tooling for Snowflake.
5+
description: "Use when choosing deployment tools, setting up CI/CD pipelines, comparing schemachange/Flyway/Liquibase/Terraform, deciding between imperative and declarative approaches, deploying simple vs complex Snowflake objects, evaluating DCM Projects, or asking about Snowflake DevOps best practices. Triggers: devops, CI/CD, database change management, DCM, schema migration, deployment pipeline, schemachange, flyway, liquibase, terraform, snowflake CLI deploy, DCM Projects, imperative vs declarative, rollback, infrastructure as code, database versioning."
6+
tools:
7+
- Read
8+
- Write
9+
- Edit
10+
- Bash
11+
- snowflake_sql_execute
12+
- snowflake_object_search
13+
prompt: "How should I set up a CI/CD pipeline for Snowflake schema changes?"
14+
language: en
15+
status: Published
16+
author: Snowflake Solutions Team
17+
type: snowflake
18+
---
19+
20+
# Snowflake DevOps Guidance
21+
22+
Opinionated technical advice on Database Change Management (DCM), CI/CD pipelines, and deployment tooling for Snowflake projects.
23+
24+
## Overview
25+
26+
This skill answers questions about how to deploy and version Snowflake objects safely. It covers terminology, tool selection (schemachange, Flyway, Liquibase, Terraform, Snowflake CLI), imperative vs declarative tradeoffs, native Snowflake features (CREATE OR ALTER, EXECUTE IMMEDIATE FROM, DCM Projects), and where the deployment process should run.
27+
28+
Load `references/raw-guidance.md` for the full reference content (terminology, tool landscape, deployment approaches, native features, curated links).
29+
30+
## When to Use
31+
32+
- Setting up CI/CD or deployment pipelines for Snowflake
33+
- Choosing a deployment tool (schemachange, Flyway, Liquibase, Terraform)
34+
- Deciding between imperative and declarative approaches
35+
- Deploying simple vs complex objects (Streamlit, Notebooks, Snowpark procs, dbt projects)
36+
- Evaluating DCM Projects, EXECUTE IMMEDIATE FROM, or Git Repositories
37+
- Planning rollback / failure recovery strategy
38+
39+
## Key Positions
40+
41+
1. **Imperative for pipelines.** Declarative tools (especially Terraform) should not drive CI/CD for most scenarios.
42+
2. **Declarative still has value** for storing definitions in source control, generating initial scripts, and drift detection.
43+
3. **Snowflake CLI (`snow`)** is the primary tool for complex objects: Streamlit, Notebooks, Snowpark stored procedures, dbt Projects.
44+
4. **schemachange** is the recommended starting point for imperative DCM on Snowflake.
45+
5. **External CI/CD tools** (GitHub Actions, GitLab CI, Azure DevOps, Jenkins) beat running deployments from inside Snowflake.
46+
6. **Roll forward, not back.** Undo/rollback features are unreliable for databases — fail forward with a new migration.
47+
7. **Combining tools is normal.** Real pipelines often mix a DCM tool, the Snowflake CLI, and others.
48+
8. **DCM Projects** are not recommended for most deployment scenarios today (preview, limited object coverage, declarative limitations).
49+
9. **EXECUTE IMMEDIATE FROM** is a script runner, not a DCM tool.
50+
10. **Git Repository integration** is a development feature, not a deployment feature.
51+
52+
## Decision Framework
53+
54+
| Scenario | Recommendation |
55+
|----------|----------------|
56+
| New to DCM on Snowflake | schemachange |
57+
| Already on Flyway / Liquibase | Stay on it |
58+
| Only simple objects (tables, views, schemas) | Any imperative DCM tool |
59+
| Only complex objects | Snowflake CLI |
60+
| Mixed simple + complex | schemachange + Snowflake CLI in migration scripts |
61+
| Cloud infra adjacent to Snowflake | Terraform is acceptable for infra-adjacent objects |
62+
| Account-level / environment provisioning | Terraform is acceptable |
63+
| No CI/CD tool, limited engineering capacity | DCM Projects may be acceptable, with caveats |
64+
65+
## Terraform Nuance
66+
67+
- Generally not recommended for object-level DCM, especially for newcomers.
68+
- Acceptable for two scenarios: cloud-infra-adjacent objects and environment/account management.
69+
- Real challenges: steep learning curve, state file management, incomplete provider coverage, HCL format lock-in.
70+
71+
## Important Distinctions
72+
73+
- **DCM ≠ IaC.** Database Change Management is not Infrastructure as Code.
74+
- **Git Repository ≠ DevOps.** Connecting Snowflake to Git is not a deployment pipeline.
75+
- **CREATE OR ALTER ≠ DCM tool.** Helpful SQL syntax, not a complete solution.
76+
- **EXECUTE IMMEDIATE FROM ≠ pipeline.** It runs scripts; it doesn't track state or order.
77+
- **Snowflake CLI ≠ SnowSQL.** `snow` is current; `snowsql` is the older, deprecated CLI.
78+
79+
## Common Mistakes
80+
81+
- Using Terraform to manage tables, views, and stored procedures in CI/CD — leads to brittle state files and partial drift.
82+
- Treating Git Repositories + EXECUTE IMMEDIATE FROM as a deployment pipeline — no migration ordering, no state tracking, no idempotency guarantees.
83+
- Skipping a DCM tool because CREATE OR ALTER exists — you still need migration history and ordering.
84+
- Relying on rollback features (Flyway undo) — database rollbacks frequently fail; design for forward-only migrations.
85+
- Mixing simple and complex objects in one declarative tool — Streamlit, Notebooks, and Snowpark procs need the Snowflake CLI deploy commands.
86+
- Running deployments from inside Snowflake worksheets — no audit trail, no PR review, no environment promotion.
87+
- Following the Snowflake DevOps landing page's EXECUTE IMMEDIATE FROM example as a production pattern — it's a primitive, not a pipeline.
88+
89+
## Resources
90+
91+
Point users to the schemachange repo, Flyway/Liquibase Snowflake docs, and Snowflake CLI deploy guides. Warn about outdated material that frames Git Repositories + EXECUTE IMMEDIATE FROM as a complete DevOps solution.
92+
93+
## Output
94+
95+
Clear, opinionated DevOps guidance with specific tool recommendations, decision criteria, and warnings about common anti-patterns. Ask a clarifying question first when the scenario is ambiguous (object types, team size, existing tooling).

0 commit comments

Comments
 (0)