logo
logo
logo

titan core

Open source infrastructure as code

Open source
infrastructure
as code

Titan Core helps you provision, deploy, and secure resources in Snowflake, replacing tools like Terraform.

Define any Snowflake resource, including users, roles, schemas, databases, integrations,
pipes, stages, functions, and stored procedures, using declarative Python or YAML.

from titan import Blueprint
from titan.resources import Grant, Role, Warehouse

bp = Blueprint(resources=[
    Role(name="transformer"),
    Warehouse(
        name="transforming",
        warehouse_size="large",
        auto_suspend=60,
    ),
    Grant(
        priv="usage",
        to="transformer",
        on="transforming"
    ),
])
from titan import Blueprint
from titan.resources import Grant, Role, Warehouse

bp = Blueprint(resources=[
    Role(name="transformer"),
    Warehouse(
        name="transforming",
        warehouse_size="large",
        auto_suspend=60,
    ),
    Grant(
        priv="usage",
        to="transformer",
        on="transforming"
    ),
])
plan = bp.plan(connection)
print(plan) # =>
"""
» account:ABC123

  ~ warehouse "urn::ABC123:warehouse/transforming" {
     ~ auto_suspend = 600 -> 60
    }

  + grant "urn::ABC123:grant/..." {
     + priv = "USAGE"
     + on   = warehouse "transforming"
     + to   = role "transformer"
    }
"""
bp.apply(connection, plan)
plan = bp.plan(connection)
print(plan) # =>
"""
» account:ABC123

  ~ warehouse "urn::ABC123:warehouse/transforming" {
     ~ auto_suspend = 600 -> 60
    }

  + grant "urn::ABC123:grant/..." {
     + priv = "USAGE"
     + on   = warehouse "transforming"
     + to   = role "transformer"
    }
"""
bp.apply(connection, plan)

Backed by