Atlas now supports Snowflake tags as first-class resources. Define a tag once in HCL, assign it to schemas, tables, columns, views, and other Snowflake objects, and Atlas plans the CREATE TAG and tag-assignment statements for you.
A tag is a schema-level object that you assign to other Snowflake objects together with a string value, forming a key/value label used to organize and classify them. You can now define tags in HCL and assign them to a broad set of objects, which Atlas then inspects, diffs, and migrates declaratively.
Enabling the Feature
Tag management with Atlas is opt-in. To enable it, set tags = true inside the mode "snowflake" block of your env:
env "prod" {url = "snowflake://user:pass@account_identifier/database"dev = "snowflake://user:pass@dev_account_identifier/database"schema {src = "file://schema.hcl"mode "snowflake" {tags = true}}}
Defining a Tag
The tag block declares a tag in a given schema, with an optional list of allowed_values that constrain what can be assigned, and a comment:
tag "USER_DOMAIN" {schema = schema.SALESallowed_values = ["customer", "employee"]comment = "data domain tag"}
Atlas generates the matching statement:
-- Create tag "USER_DOMAIN"CREATE TAG "SALES"."USER_DOMAIN" ALLOWED_VALUES 'customer', 'employee' COMMENT = 'data domain tag';
Assigning a Tag
To assign a tag to an object, add a nested tag block that references the tag with ref and supplies a value. Atlas plans the appropriate assignment statement for each object type:
table "USERS" {schema = schema.SALEScolumn "CUSTOMER_ID" {type = NUMBER(38)}column "NAME" {type = VARCHAR(16777216)}tag {ref = tag.USER_DOMAINvalue = "customer"}}
And Atlas generates the matching statement with the tag assignment included:
-- Create "USERS" tableCREATE TABLE "SALES"."USERS" ("CUSTOMER_ID" NUMBER NOT NULL,"NAME" VARCHAR NOT NULL) WITH TAG (SALES.USER_DOMAIN = 'customer');
Tags and their assignments are supported across a broad set of objects: schemas, warehouses, tables (including standard, dynamic, external, Iceberg, and hybrid tables), table columns, views and view columns, functions, procedures, tasks, stages, and pipes.