Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ jobs:
- name: Install dependencies
run: uv sync --all-extras --dev

- name: Validate YAML configs
run: uv run validate-config

- name: Run tests
run: uv run pytest -v --tb=short
env:
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ repos:
pass_filenames: false
always_run: false

- id: validate-config
name: Validate SnowDDL YAML Configs
entry: uv run validate-config --quiet
language: system
files: ^snowddl/.*\.yaml$
pass_filenames: false
always_run: false

- repo: https://github.com/psf/black
rev: 24.4.2 # Updated from 23.12.1 - stable version compatible with Python 3.12.5
hooks:
Expand Down
436 changes: 55 additions & 381 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "snowtower"
version = "0.2.0"
version = "0.3.0"
description = "SnowTower - Snowflake Infrastructure Management Platform using Infrastructure as Code"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
4 changes: 2 additions & 2 deletions snowddl/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ JOHN_ANALYST:
email: john.analyst@example.com
first_name: John
last_name: Analyst
default_role: ANALYST__B_ROLE
default_role: COMPANY_USERS__B_ROLE
comment: Data analyst

# =============================================================================
Expand All @@ -46,7 +46,7 @@ DLT_SERVICE:
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0example...
...replace with your actual RSA public key...
AQAB
default_role: DLT_INGESTION_ROLE__B_ROLE
default_role: DLT_STRIPE_ROLE__B_ROLE
comment: Data ingestion service account

# =============================================================================
Expand Down
39 changes: 39 additions & 0 deletions terraform-snowflake-boilerplate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Terraform Snowflake Boilerplate

Auto-generated Terraform HCL files from SnowDDL YAML configurations.

## Usage

These files were generated by:

```bash
uv run generate-terraform --output ./terraform-snowflake-boilerplate/
```

To regenerate after YAML changes:

```bash
uv run generate-terraform --output ./terraform-snowflake-boilerplate/
```

## Files

| File | Contents |
|------|----------|
| `main.tf` | Provider configuration |
| `users.tf` | `snowflake_user` resources |
| `warehouses.tf` | `snowflake_warehouse` resources |
| `roles.tf` | `snowflake_account_role` resources (business + tech) |
| `grants.tf` | `snowflake_grant_*` resources |
| `policies.tf` | Network, authentication, password, session policies |
| `databases.tf` | `snowflake_database` resources |
| `resource_monitors.tf` | `snowflake_resource_monitor` resources |

## Import Support

Each resource includes an `import {}` block so `terraform plan` can import existing Snowflake objects rather than attempting to recreate them.

## Important

These files are a starting point. Review and customize before running `terraform apply`.
The Snowflake provider requires authentication configuration not included here.
34 changes: 34 additions & 0 deletions terraform-snowflake-boilerplate/databases.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by SnowTower - DO NOT EDIT MANUALLY
# Source: snowddl/ YAML configurations

# Database resources

import {
to = snowflake_database.dev_example
id = "DEV_EXAMPLE"
}

resource "snowflake_database" "dev_example" {
name = "DEV_EXAMPLE"
comment = "Sandbox database DEV_EXAMPLE"
}

import {
to = snowflake_database.lightdash
id = "LIGHTDASH"
}

resource "snowflake_database" "lightdash" {
name = "LIGHTDASH"
comment = "LightDash BI platform database for analytics transformations and dashboard content"
}

import {
to = snowflake_database.omni
id = "OMNI"
}

resource "snowflake_database" "omni" {
name = "OMNI"
comment = "Omni BI platform database for analytics transformations and custom reporting"
}
Loading
Loading