Snowflake Schema
aggregation_policy
The aggregation_policy block describes a Snowflake aggregation policy in a database schema.
aggregation_policy "min_group" {
schema = schema.public
as = "AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE => 11)"
}
aggregation_policy attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
aggregation_policy blocks
aggregation_policy.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
aggregation_policy.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
aggregation_policy.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
aggregation_policy constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., aggregation_policy "name" ) | true |
Allow Qualifier (e.g., aggregation_policy "schema" "name" ) | true |
alert
The alert block describes a Snowflake alert in a database schema.
alert "failed_jobs" {
schema = schema.public
schedule = "USING CRON 0 9 * * * UTC"
warehouse = "my_wh"
condition = "SELECT 1 FROM jobs WHERE status = 'failed'"
action = "CALL notify_ops()"
comment = "Alert on failed jobs"
}
alert attributes
| Name | Required | Value |
|---|---|---|
action | true | string |
comment | false | string |
condition | true | string |
schedule | false | string |
schema | true | Object reference to |
suspend_alert_after_num_failures | false | int |
warehouse | false | Warehouse name or reference can be one of:
|
alert blocks
alert.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
alert.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
alert.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
alert constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., alert "name" ) | true |
Allow Qualifier (e.g., alert "schema" "name" ) | true |
data_metric_function
The data_metric_function block describes a Snowflake data metric function in a database schema. Each arg is a table, listing the columns the body reads, and return defaults to NUMBER. Functions are told apart by their name and the types of their columns, so changing the rest of the definition recreates the function, dropping its grants and tags: Atlas sets again the ones it manages.
data_metric_function "INVALID_EMAIL_COUNT" {
schema = schema.PUBLIC
arg "ARG_T" {
column "ARG_EMAIL" {
type = VARCHAR
}
}
as = "SELECT COUNT_IF(NOT REGEXP_LIKE(ARG_EMAIL, '^[^@]+@[^@]+$')) FROM ARG_T"
}
Argument and column names are quoted, so declare them in upper case: unquoted names in the body fold to upper case and match only upper-case names.
data_metric_function attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
return | false | Return type can be one of:
|
schema | true | Object reference to |
secure | false | bool |
data_metric_function blocks
data_metric_function.arg
data_metric_function.arg blocks
data_metric_function.arg.column
data_metric_function.arg.column attributes
| Name | Required | Value |
|---|---|---|
type | true | Column type can be one of:
|
data_metric_function.arg.column blocks
data_metric_function.arg.column.annotation
data_metric_function.arg.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
data_metric_function.arg.column constraints
| Constraint | Value |
|---|---|
| Required | true |
Require Name (e.g., data_metric_function.arg.column "name" ) | true |
data_metric_function.arg constraints
| Constraint | Value |
|---|---|
| Required | true |
Require Name (e.g., data_metric_function.arg "name" ) | true |
data_metric_function.return
data_metric_function.return attributes
| Name | Required | Value |
|---|---|---|
null | false | bool |
type | true | Return type can be one of:
|
data_metric_function.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
data_metric_function.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
data_metric_function.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
data_metric_function constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., data_metric_function "name" ) | true |
Allow Qualifier (e.g., data_metric_function "schema" "name" ) | true |
| Repeatable | true |
| Mutually exclusive sets | [return (attribute), return (block)] |
database_role
database_role attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
database | false | string |
member_of | false | List of object reference to |
database_role constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., database_role "name" ) | true |
dynamic_table
The dynamic block describes a dynamic table in a database schema.
dynamic_table "users" {
schema = schema.public
column "id" {
comment = "User ID"
}
target_lag = DOWNSTREAM // or "<num> { seconds | minutes | hours | days }"
refresh_mode = INCREMENTAL | FULL
initialize = ON_CREATE | ON_SCHEDULE
as = "SELECT * FROM users"
...
}
dynamic_table attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
cluster_by | false | List of strings |
comment | false | string |
depends_on | false | List of object references |
initialize | false | Dynamic table initialize mode can be one of:
|
max_data_extension_time | false | int |
refresh_mode | false | Dynamic table refresh mode can be one of:
|
retention_time | false | int |
schema | true | Object reference to |
target_lag | true | Dynamic table target lag can be one of:
|
transient | false | bool |
warehouse | false | string |
dynamic_table blocks
dynamic_table.column
dynamic_table.column attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
null | false | bool |
type | false | Column type can be one of:
|
dynamic_table.column blocks
dynamic_table.column.annotation
dynamic_table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
dynamic_table.column.policy.masking
dynamic_table.column.policy.masking attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
using | false | List of strings |
dynamic_table.column.policy.masking constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
dynamic_table.column.policy.projection
dynamic_table.column.policy.projection attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
dynamic_table.column.policy.projection constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
dynamic_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
dynamic_table.column.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
dynamic_table.column.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
dynamic_table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., dynamic_table.column "name" ) | true |
dynamic_table.policy.aggregation
dynamic_table.policy.aggregation attributes
| Name | Required | Value |
|---|---|---|
entity_key | false | List of strings |
ref | true | Policy reference can be one of:
|
dynamic_table.policy.aggregation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
dynamic_table.policy.join
dynamic_table.policy.join attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
dynamic_table.policy.join constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
dynamic_table.policy.row_access
dynamic_table.policy.row_access attributes
| Name | Required | Value |
|---|---|---|
columns | true | List of strings |
ref | true | Policy reference can be one of:
|
dynamic_table.policy.row_access constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
dynamic_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
dynamic_table.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
dynamic_table.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
dynamic_table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., dynamic_table "name" ) | true |
Allow Qualifier (e.g., dynamic_table "schema" "name" ) | true |
external_access_integration
The external_access_integration block describes a Snowflake external access integration, an account-level object.
external_access_integration "gateway" {
allowed_network_rules = [network_rule.egress_api]
allowed_authentication_secrets = [secret.api_token] // or ALL
comment = "outbound gateway"
}
Only HOST_PORT egress network rules may be listed, and at least one is
required. enabled defaults to true.
external_access_integration attributes
| Name | Required | Value |
|---|---|---|
allow_all_authentication_secrets | false | bool |
allowed_api_authentication_integrations | false | List of strings |
allowed_authentication_secrets | false | List of values, where each can be one of:
|
allowed_network_rules | true | List of values, where each can be one of:
|
comment | false | string |
enabled | false | bool |
external_access_integration blocks
external_access_integration.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
external_access_integration.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
external_access_integration.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
external_access_integration constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., external_access_integration "name" ) | true |
| Mutually exclusive sets | [allowed_authentication_secrets, allow_all_authentication_secrets] |
external_table
The external_table block describes an external table in a database schema.
external_table "events" {
schema = schema.public
column "event_id" {
type = VARCHAR(255)
as {
expr = "value:c1::varchar"
}
}
location {
stage = stage.mystage
path = "data/events/"
}
}
external_table attributes
| Name | Required | Value |
|---|---|---|
auto_refresh | false | bool |
comment | false | string |
depends_on | false | List of object references |
file_format | false | File format options or reference can be one of:
|
partition_by | false | List of strings |
pattern | false | string |
refresh_on_create | false | bool |
retention_time | false | int |
schema | true | Object reference to |
external_table blocks
external_table.column
external_table.column attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
comment | false | string |
null | false | bool |
type | true | Column type can be one of:
|
external_table.column blocks
external_table.column.annotation
external_table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
external_table.column.policy.masking
external_table.column.policy.masking attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
using | false | List of strings |
external_table.column.policy.masking constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
external_table.column.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
external_table.column.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
external_table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., external_table.column "name" ) | true |
external_table.foreign_key
external_table.foreign_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Foreign key columns can be one of:
|
comment | false | string |
ref_columns | true | Foreign key reference columns can be one of:
|
external_table.foreign_key constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., external_table.foreign_key "name" ) | true |
external_table.location
external_table.location attributes
| Name | Required | Value |
|---|---|---|
path | false | string |
stage | true | Object reference to |
external_table.location constraints
| Constraint | Value |
|---|---|
| Required | true |
| Require Name | false |
external_table.policy.join
external_table.policy.join attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
external_table.policy.join constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_table.policy.row_access
external_table.policy.row_access attributes
| Name | Required | Value |
|---|---|---|
columns | true | List of strings |
ref | true | Policy reference can be one of:
|
external_table.policy.row_access constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_table.primary_key
external_table.primary_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
external_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
external_table.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
external_table.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
external_table.unique
external_table.unique attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
external_table.unique constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
external_table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., external_table "name" ) | true |
Allow Qualifier (e.g., external_table "schema" "name" ) | true |
external_volume
The external_volume block describes a Snowflake external volume for Iceberg tables.
external_volume "my_vol" {
allow_writes = true
comment = "My external volume"
storage_location "S3" "my-s3-location" {
storage_base_url = "s3://my-bucket/path/"
storage_aws_role_arn = "arn:aws:iam::123456789012:role/myrole"
encryption {
type = "AWS_SSE_KMS"
kms_key_id = "1234abcd-12ab-34cd-56ef-1234567890ab"
}
}
}
external_volume attributes
| Name | Required | Value |
|---|---|---|
allow_writes | false | bool |
comment | false | string |
external_volume blocks
external_volume.storage_location.AZURE
external_volume.storage_location.AZURE attributes
| Name | Required | Value |
|---|---|---|
azure_tenant_id | true | string |
storage_base_url | true | string |
external_volume.storage_location.AZURE constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.GCS
external_volume.storage_location.GCS attributes
| Name | Required | Value |
|---|---|---|
storage_base_url | true | string |
external_volume.storage_location.GCS blocks
external_volume.storage_location.encryption
external_volume.storage_location.encryption attributes
| Name | Required | Value |
|---|---|---|
kms_key_id | false | string |
type | false | string |
external_volume.storage_location.GCS constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.S3
external_volume.storage_location.S3 attributes
| Name | Required | Value |
|---|---|---|
storage_aws_access_point_arn | false | string |
storage_aws_external_id | false | string |
storage_aws_role_arn | true | string |
storage_base_url | true | string |
external_volume.storage_location.S3 blocks
external_volume.storage_location.encryption
external_volume.storage_location.encryption attributes
| Name | Required | Value |
|---|---|---|
kms_key_id | false | string |
type | false | string |
external_volume.storage_location.S3 constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.S3COMPAT
external_volume.storage_location.S3COMPAT attributes
| Name | Required | Value |
|---|---|---|
storage_base_url | true | string |
storage_endpoint | true | string |
external_volume.storage_location.S3COMPAT constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_volume.storage_location.S3GOV
external_volume.storage_location.S3GOV attributes
| Name | Required | Value |
|---|---|---|
storage_aws_access_point_arn | false | string |
storage_aws_external_id | false | string |
storage_aws_role_arn | true | string |
storage_base_url | true | string |
external_volume.storage_location.S3GOV blocks
external_volume.storage_location.encryption
external_volume.storage_location.encryption attributes
| Name | Required | Value |
|---|---|---|
kms_key_id | false | string |
type | false | string |
external_volume.storage_location.S3GOV constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
external_volume constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., external_volume "name" ) | true |
file_format
The file_format block describes a named Snowflake file format in a database schema.
file_format "my_csv_format" {
schema = schema.public
comment = "My CSV file format"
type = CSV
options = {
BINARY_AS_TEXT = false
COMPRESSION = GZIP
FIELD_DELIMITER = "|"
SKIP_HEADER = 1
}
}
file_format attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
options | false | map |
schema | true | Object reference to |
type | true |
|
file_format constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., file_format "name" ) | true |
Allow Qualifier (e.g., file_format "schema" "name" ) | true |
function
The function block describes a function in a database schema.
function "positive" {
schema = schema.public
lang = SQL
arg "v" {
type = integer
}
...
}
function attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
comment | false | string |
depends_on | false | List of object references |
execute_as | false |
|
external_access_integrations | false | List of values, where each can be one of:
|
handler | false | string |
immutable | false | bool |
lang | false |
|
null_call | false |
|
packages | false | List of strings |
return | false | Return type can be one of:
|
runtime_version | false | string |
schema | true | Object reference to |
secure | false | bool |
function blocks
function.annotation
function.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
function.arg
function.arg attributes
| Name | Required | Value |
|---|---|---|
default | false | Argument default value can be one of:
|
type | true | Argument type can be one of:
|
function.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., function.arg "name" ) | true |
function.imports
function.imports attributes
| Name | Required | Value |
|---|---|---|
file | true | string |
stage | true | Object reference to |
function.imports constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
function.return_table
function.return_table blocks
function.return_table.column
function.return_table.column attributes
| Name | Required | Value |
|---|---|---|
type | true | Column type can be one of:
|
function.return_table.column blocks
function.return_table.column.annotation
function.return_table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
function.return_table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., function.return_table.column "name" ) | true |
function.secrets
function.secrets attributes
| Name | Required | Value |
|---|---|---|
secret | true | Object reference to |
function.secrets constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., function.secrets "name" ) | true |
function.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
function.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
function.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
function constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., function "name" ) | true |
Allow Qualifier (e.g., function "schema" "name" ) | true |
| Repeatable | true |
| Mutually exclusive sets | [return, return_table] |
hybrid_table
The hybrid block describes a hybrid table in a database schema.
hybrid_table "users" {
schema = schema.public
column "id" {
comment = "User ID"
type = VARCHAR(255)
}
primary_key {
columns = ["id"]
}
...
}
hybrid_table attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
depends_on | false | List of object references |
max_data_extension_time | false | int |
retention_time | false | int |
schema | true | Object reference to |
hybrid_table blocks
hybrid_table.column
hybrid_table.column attributes
| Name | Required | Value |
|---|---|---|
collate | false | string |
comment | false | string |
default | false | Column default value can be one of:
|
null | false | bool |
type | true | Column type can be one of:
|
hybrid_table.column blocks
hybrid_table.column.annotation
hybrid_table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
hybrid_table.column.identity
hybrid_table.column.identity attributes
| Name | Required | Value |
|---|---|---|
increment | false | int |
order | false |
|
start | false | int |
hybrid_table.column.policy.masking
hybrid_table.column.policy.masking attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
using | false | List of strings |
hybrid_table.column.policy.masking constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
hybrid_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
hybrid_table.column.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
hybrid_table.column.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
hybrid_table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., hybrid_table.column "name" ) | true |
hybrid_table.foreign_key
hybrid_table.foreign_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Foreign key columns can be one of:
|
comment | false | string |
ref_columns | true | Foreign key reference columns can be one of:
|
hybrid_table.foreign_key constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., hybrid_table.foreign_key "name" ) | true |
hybrid_table.policy.row_access
hybrid_table.policy.row_access attributes
| Name | Required | Value |
|---|---|---|
columns | true | List of strings |
ref | true | Policy reference can be one of:
|
hybrid_table.policy.row_access constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
hybrid_table.primary_key
hybrid_table.primary_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
hybrid_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
hybrid_table.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
hybrid_table.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
hybrid_table.unique
hybrid_table.unique attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
hybrid_table.unique constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
hybrid_table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., hybrid_table "name" ) | true |
Allow Qualifier (e.g., hybrid_table "schema" "name" ) | true |
iceberg_table
The iceberg_table block describes an Iceberg table in a database schema.
iceberg_table "events" {
schema = schema.public
external_volume = "my_ext_vol"
catalog = "SNOWFLAKE"
base_location = "iceberg/tables/"
column "id" {
type = NUMBER(38,0)
}
}
iceberg_table attributes
| Name | Required | Value |
|---|---|---|
base_location | false | string |
catalog | true | string |
catalog_sync | false | string |
change_tracking | false | bool |
cluster_by | false | List of strings |
comment | false | string |
depends_on | false | List of object references |
enable_data_compaction | false | bool |
enable_iceberg_merge_on_read | false | bool |
error_logging | false | bool |
external_volume | true | External volume name or reference can be one of:
|
iceberg_version | false | int |
log_event_level | false | Log event level can be one of:
|
max_data_extension_time | false | int |
partition_by | false | List of strings |
path_layout | false |
|
replace_invalid_characters | false | bool |
retention_time | false | int |
schema | true | Object reference to |
storage_serialization_policy | false |
|
target_file_size | false | string |
transient | false | bool |
iceberg_table blocks
iceberg_table.column
iceberg_table.column attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
default | false | Column default value can be one of:
|
null | false | bool |
type | true | Column type can be one of:
|
iceberg_table.column blocks
iceberg_table.column.annotation
iceberg_table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
iceberg_table.column.policy.masking
iceberg_table.column.policy.masking attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
using | false | List of strings |
iceberg_table.column.policy.masking constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
iceberg_table.column.policy.projection
iceberg_table.column.policy.projection attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
iceberg_table.column.policy.projection constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
iceberg_table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
iceberg_table.column.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
iceberg_table.column.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
iceberg_table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., iceberg_table.column "name" ) | true |
iceberg_table.foreign_key
iceberg_table.foreign_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Foreign key columns can be one of:
|
comment | false | string |
ref_columns | true | Foreign key reference columns can be one of:
|
iceberg_table.foreign_key constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., iceberg_table.foreign_key "name" ) | true |
iceberg_table.policy.aggregation
iceberg_table.policy.aggregation attributes
| Name | Required | Value |
|---|---|---|
entity_key | false | List of strings |
ref | true | Policy reference can be one of:
|
iceberg_table.policy.aggregation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
iceberg_table.policy.join
iceberg_table.policy.join attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
iceberg_table.policy.join constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
iceberg_table.policy.row_access
iceberg_table.policy.row_access attributes
| Name | Required | Value |
|---|---|---|
columns | true | List of strings |
ref | true | Policy reference can be one of:
|
iceberg_table.policy.row_access constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
iceberg_table.primary_key
iceberg_table.primary_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
iceberg_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
iceberg_table.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
iceberg_table.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
iceberg_table.unique
iceberg_table.unique attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
iceberg_table.unique constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
iceberg_table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., iceberg_table "name" ) | true |
Allow Qualifier (e.g., iceberg_table "schema" "name" ) | true |
| Mutually exclusive sets | [partition_by, cluster_by] |
interactive_table
The interactive_table block describes an interactive table in a database schema.
Setting target_lag makes it refresh itself (a dynamic interactive table). Snowflake does not
keep the query of a static one, so changing only its query is not detected.
interactive_table "orders" {
schema = schema.public
cluster_by = ["customer_id"]
target_lag = "5 minutes"
warehouse = "refresh_wh"
as = "SELECT * FROM orders_staging"
...
}
interactive_table attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
cluster_by | true | List of strings |
comment | false | string |
depends_on | false | List of object references |
initialization_warehouse | false | string |
schema | true | Object reference to |
target_lag | false | string |
warehouse | false | string |
interactive_table blocks
interactive_table.column
interactive_table.column attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
null | false | bool |
type | false | Column type can be one of:
|
interactive_table.column blocks
interactive_table.column.annotation
interactive_table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
interactive_table.column.policy.masking
interactive_table.column.policy.masking attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
using | false | List of strings |
interactive_table.column.policy.masking constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
interactive_table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., interactive_table.column "name" ) | true |
interactive_table.policy.aggregation
interactive_table.policy.aggregation attributes
| Name | Required | Value |
|---|---|---|
entity_key | false | List of strings |
ref | true | Policy reference can be one of:
|
interactive_table.policy.aggregation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
interactive_table.policy.join
interactive_table.policy.join attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
interactive_table.policy.join constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
interactive_table.policy.row_access
interactive_table.policy.row_access attributes
| Name | Required | Value |
|---|---|---|
columns | true | List of strings |
ref | true | Policy reference can be one of:
|
interactive_table.policy.row_access constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
interactive_table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
interactive_table.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
interactive_table.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
interactive_table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., interactive_table "name" ) | true |
Allow Qualifier (e.g., interactive_table "schema" "name" ) | true |
interactive_warehouse
The interactive_warehouse block describes a Snowflake interactive warehouse, which serves
low-latency queries and keeps the data of its attached tables cached.
interactive_warehouse "sales_iwh" {
size = XSMALL
auto_suspend = 86400
initially_suspended = true
fallback_warehouse = warehouse.my_wh
tables = [interactive_table.public.orders]
}
interactive_warehouse attributes
| Name and description | Required | Value |
|---|---|---|
auto_resume | false | bool |
Seconds of inactivity before the warehouse suspends, at least 86400. Leave it out to never suspend. | false | int |
comment | false | string |
fallback_warehouse | false | Warehouse name or reference can be one of:
|
Creates the warehouse suspended, so it is not billed until resumed. Used only on creation, as Snowflake does not report it back. | false | bool |
max_cluster_count | false | int |
max_concurrency_level | false | int |
min_cluster_count | false | int |
resource_monitor | false | Resource monitor name or reference can be one of:
|
size | false |
|
statement_queued_timeout_in_seconds | false | int |
Seconds a query runs before it is canceled, at most 5: Snowflake caps an interactive warehouse there. | false | int |
tables | false | List of values, where each can be one of:
|
interactive_warehouse blocks
interactive_warehouse.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
interactive_warehouse.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
interactive_warehouse.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
interactive_warehouse constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., interactive_warehouse "name" ) | true |
join_policy
The join_policy block describes a Snowflake join policy in a database schema.
join_policy "require_join" {
schema = schema.public
as = "JOIN_CONSTRAINT(JOIN_REQUIRED => TRUE)"
}
join_policy attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
join_policy blocks
join_policy.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
join_policy.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
join_policy.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
join_policy constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., join_policy "name" ) | true |
Allow Qualifier (e.g., join_policy "schema" "name" ) | true |
masking_policy
The masking_policy block describes a Snowflake masking policy in a database schema.
masking_policy "mask_ssn" {
schema = schema.public
arg "val" {
type = varchar
}
return = varchar
as = "CASE WHEN CURRENT_ROLE() = 'ADMIN' THEN val ELSE '***' END"
}
masking_policy attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
exempt_other_policies | false | bool |
return | true | Return type can be one of:
|
schema | true | Object reference to |
masking_policy blocks
masking_policy.arg
masking_policy.arg attributes
| Name | Required | Value |
|---|---|---|
type | true | Argument type can be one of:
|
masking_policy.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., masking_policy.arg "name" ) | true |
masking_policy.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
masking_policy.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
masking_policy.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
masking_policy constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., masking_policy "name" ) | true |
Allow Qualifier (e.g., masking_policy "schema" "name" ) | true |
network_rule
The network_rule block describes a Snowflake network rule in a database schema.
network_rule "allowed_ips" {
schema = schema.public
type = IPV4
mode = INGRESS
value_list = ["192.168.1.0/24", "10.0.0.1"]
comment = "office network"
}
Which modes a type accepts depends on the cloud provider hosting the account,
and neither type nor mode can be altered: changing one recreates
the rule.
network_rule attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
mode | true |
|
schema | true | Object reference to |
type | true |
|
value_list | false | List of strings |
network_rule constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., network_rule "name" ) | true |
Allow Qualifier (e.g., network_rule "schema" "name" ) | true |
permission
permission attributes
| Name | Required | Value |
|---|---|---|
for | true | Permission target resource can be one of:
|
grantable | false | bool |
privileges | true | List of strings or/and |
to | true | Permission grantee can be one of:
|
permission constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
pipe
The pipe block describes a Snowflake pipe for Snowpipe data loading.
pipe "mypipe" {
schema = schema.public
as = "COPY INTO mytable FROM @mystage FILE_FORMAT = (TYPE = 'JSON')"
auto_ingest = true
comment = "My data loading pipe"
}
pipe attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
auto_ingest | false | bool |
aws_sns_topic | false | string |
comment | false | string |
depends_on | false | List of object references |
error_integration | false | string |
integration | false | string |
schema | true | Object reference to |
pipe blocks
pipe.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
pipe.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
pipe.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
pipe constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., pipe "name" ) | true |
Allow Qualifier (e.g., pipe "schema" "name" ) | true |
procedure
The procedure block describes a procedure in a database schema.
procedure "proc" {
schema = schema.public
lang = SQL
arg "a" {
type = integer
}
...
}
procedure attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
comment | false | string |
depends_on | false | List of object references |
execute_as | false |
|
external_access_integrations | false | List of values, where each can be one of:
|
handler | false | string |
lang | false |
|
null_call | false |
|
packages | false | List of strings |
return | false | Return type can be one of:
|
runtime_version | false | string |
schema | true | Object reference to |
secure | false | bool |
procedure blocks
procedure.annotation
procedure.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
procedure.arg
procedure.arg attributes
| Name | Required | Value |
|---|---|---|
default | false | Argument default value can be one of:
|
mode | false |
|
type | true | Argument type can be one of:
|
procedure.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., procedure.arg "name" ) | true |
procedure.imports
procedure.imports attributes
| Name | Required | Value |
|---|---|---|
file | true | string |
stage | true | Object reference to |
procedure.imports constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
procedure.return
procedure.return attributes
| Name | Required | Value |
|---|---|---|
null | false | bool |
type | true | Return type can be one of:
|
procedure.return_table
procedure.return_table blocks
procedure.return_table.column
procedure.return_table.column attributes
| Name | Required | Value |
|---|---|---|
type | true | Column type can be one of:
|
procedure.return_table.column blocks
procedure.return_table.column.annotation
procedure.return_table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
procedure.return_table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., procedure.return_table.column "name" ) | true |
procedure.secrets
procedure.secrets attributes
| Name | Required | Value |
|---|---|---|
secret | true | Object reference to |
procedure.secrets constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., procedure.secrets "name" ) | true |
procedure.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
procedure.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
procedure.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
procedure constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., procedure "name" ) | true |
Allow Qualifier (e.g., procedure "schema" "name" ) | true |
| Repeatable | true |
| Mutually exclusive sets | [return, return_table] |
projection_policy
The projection_policy block describes a Snowflake projection policy in a database schema.
projection_policy "no_project" {
schema = schema.public
as = "PROJECTION_CONSTRAINT(ALLOW => FALSE)"
}
projection_policy attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
projection_policy blocks
projection_policy.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
projection_policy.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
projection_policy.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
projection_policy constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., projection_policy "name" ) | true |
Allow Qualifier (e.g., projection_policy "schema" "name" ) | true |
resource_monitor
The resource_monitor block describes a Snowflake resource monitor.
resource_monitor "my_rm" {
credit_quota = 1000
frequency = MONTHLY
notify_users = ["alice"]
trigger {
threshold = 100
action = SUSPEND
}
}
resource_monitor attributes
| Name and description | Required | Value |
|---|---|---|
Credits the monitor allows per interval. Dropping it clears the quota. | false | number |
When the monitor stops tracking, as an RFC3339 timestamp. Dropping it clears the end. | false | string |
How often the used-credit count resets. Snowflake takes it together with | false |
|
notify_users | false | List of strings |
When the monitor starts tracking, as an RFC3339 timestamp. Leave it out to start now: Atlas then emits Snowflake's | false | string |
resource_monitor blocks
resource_monitor.trigger
resource_monitor.trigger attributes
| Name | Required | Value |
|---|---|---|
action | true |
|
threshold | true | int |
resource_monitor.trigger blocks
resource_monitor.trigger.annotation
resource_monitor.trigger.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
resource_monitor.trigger constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
resource_monitor constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., resource_monitor "name" ) | true |
role
role attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
member_of | false | List of values, where each can be one of:
|
role constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., role "name" ) | true |
row_access_policy
The row_access_policy block describes a Snowflake row access policy in a database schema.
row_access_policy "sales_policy" {
schema = schema.public
arg "sales_region" {
type = varchar
}
as = "current_role() = 'ADMIN' or sales_region = 'US'"
comment = "Restrict rows by sales region"
}
row_access_policy attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
row_access_policy blocks
row_access_policy.arg
row_access_policy.arg attributes
| Name | Required | Value |
|---|---|---|
type | true | Argument type can be one of:
|
row_access_policy.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., row_access_policy.arg "name" ) | true |
row_access_policy.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
row_access_policy.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
row_access_policy.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
row_access_policy constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., row_access_policy "name" ) | true |
Allow Qualifier (e.g., row_access_policy "schema" "name" ) | true |
schema
The schema block describes a database schema.
schema "public" {
...
}
schema attributes
| Name | Required | Value |
|---|---|---|
catalog | false | string |
classification_profile | false | string |
comment | false | string |
default_ddl_collation | false | string |
enable_data_compaction | false | bool |
external_volume | false | External volume reference can be one of:
|
iceberg_default_ddl_collation | false | string |
iceberg_merge_on_read_behavior | false |
|
iceberg_version_default | false | int |
log_level | false |
|
managed_access | false | bool |
max_data_extension_time | false | int |
name | false | string |
object_visibility | false |
|
replace_invalid_characters | false | bool |
retention_time | false | int |
storage_serialization_policy | false |
|
trace_level | false |
|
transient | false | bool |
schema blocks
schema.annotation
schema.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
schema.contact
The contact block sets the contact of the schema for a purpose, by the fully qualified name of the contact.
schema.contact attributes
| Name | Required | Value |
|---|---|---|
name | true | string |
purpose | true |
|
schema.contact constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
schema.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
schema.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
schema.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
schema constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., schema "name" ) | true |
secret
The secret block describes a Snowflake secret in a database schema.
secret "data_gen_key" {
schema = schema.public
type = SYMMETRIC_KEY
algorithm = GENERIC
}
The versioned workflow does not support a secret whose type carries a password, a
secret string, or a refresh token: they are written only by schema apply. The
api_authentication of a CLOUD_PROVIDER_TOKEN secret cannot be changed after it
is created.
secret attributes
| Name | Required | Value |
|---|---|---|
algorithm | false |
|
api_authentication | false | string |
comment | false | string |
oauth_refresh_token | false | string |
oauth_refresh_token_expiry_time | false | string |
oauth_scopes | false | List of strings |
password | false | string |
schema | true | Object reference to |
secret_string | false | string |
type | true |
|
username | false | string |
secret constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., secret "name" ) | true |
Allow Qualifier (e.g., secret "schema" "name" ) | true |
| Mutually exclusive sets | [oauth_scopes, oauth_refresh_token] |
sequence
The sequence block describes a Snowflake sequence in a database schema.
sequence "myseq" {
schema = schema.public
start = 1
increment = 1
order = true
comment = "My sequence"
}
sequence attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
increment | false | int |
order | false | bool |
schema | true | Object reference to |
start | false | int |
sequence blocks
sequence.annotation
sequence.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
sequence constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., sequence "name" ) | true |
Allow Qualifier (e.g., sequence "schema" "name" ) | true |
stage
The stage block describes a Snowflake stage in a database schema.
stage "mystage" {
schema = schema.public
url = "s3://mybucket/data/"
storage_integration = "my_integration"
directory_enabled = true
comment = "This is my stage"
}
stage attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
credentials | false | map |
directory_enabled | false | bool |
file_format | false | File format options or reference can be one of:
|
schema | true | Object reference to |
storage_integration | false | string |
url | false | string |
stage blocks
stage.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
stage.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
stage.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
stage constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., stage "name" ) | true |
Allow Qualifier (e.g., stage "schema" "name" ) | true |
| Mutually exclusive sets | [storage_integration, credentials] |
storage_lifecycle_policy
The storage_lifecycle_policy block describes a Snowflake storage lifecycle policy in a database schema. Its body returns BOOLEAN: the rows it selects expire, or are archived in archive_tier for archive_for_days when both are set. Neither the arguments nor the archive tier can be altered, so changing them recreates the policy.
storage_lifecycle_policy "expire_events" {
schema = schema.public
arg "EVENT_TS" {
type = TIMESTAMP_NTZ
}
as = "EVENT_TS < DATEADD(DAY, -365, CURRENT_TIMESTAMP())"
archive_tier = COOL
archive_for_days = 90
}
Argument names are quoted, so the body refers to them as Snowflake folds unquoted identifiers: in upper case.
storage_lifecycle_policy attributes
| Name | Required | Value |
|---|---|---|
archive_for_days | false | int |
archive_tier | false |
|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
storage_lifecycle_policy blocks
storage_lifecycle_policy.arg
storage_lifecycle_policy.arg attributes
| Name | Required | Value |
|---|---|---|
type | true | Argument type can be one of:
|
storage_lifecycle_policy.arg constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., storage_lifecycle_policy.arg "name" ) | true |
storage_lifecycle_policy.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
storage_lifecycle_policy.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
storage_lifecycle_policy.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
storage_lifecycle_policy constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., storage_lifecycle_policy "name" ) | true |
Allow Qualifier (e.g., storage_lifecycle_policy "schema" "name" ) | true |
table
The table block describes a table in a database schema.
table "users" {
schema = schema.public
column "id" {
type = int
}
...
}
table attributes
| Name | Required | Value |
|---|---|---|
change_tracking | false | bool |
cluster_by | false | List of strings |
comment | false | string |
depends_on | false | List of object references |
enable_schema_evolution | false | bool |
max_data_extension_time | false | int |
retention_time | false | int |
schema | true | Object reference to |
transient | false | bool |
table blocks
table.annotation
table.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
table.column
table.column attributes
| Name | Required | Value |
|---|---|---|
as | false | string |
collate | false | string |
comment | false | string |
default | false | Column default value can be one of:
|
null | false | bool |
type | true | Column type can be one of:
|
table.column blocks
table.column.annotation
table.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
table.column.identity
table.column.identity attributes
| Name | Required | Value |
|---|---|---|
increment | false | int |
order | false |
|
start | false | int |
table.column.policy.masking
table.column.policy.masking attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
using | false | List of strings |
table.column.policy.masking constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
table.column.policy.projection
table.column.policy.projection attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
table.column.policy.projection constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
table.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
table.column.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
table.column.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
table.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.column "name" ) | true |
table.foreign_key
table.foreign_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Foreign key columns can be one of:
|
comment | false | string |
ref_columns | true | Foreign key reference columns can be one of:
|
table.foreign_key constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table.foreign_key "name" ) | true |
table.policy.aggregation
table.policy.aggregation attributes
| Name | Required | Value |
|---|---|---|
entity_key | false | List of strings |
ref | true | Policy reference can be one of:
|
table.policy.aggregation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
table.policy.join
table.policy.join attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
table.policy.join constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
table.policy.row_access
table.policy.row_access attributes
| Name | Required | Value |
|---|---|---|
columns | true | List of strings |
ref | true | Policy reference can be one of:
|
table.policy.row_access constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
table.primary_key
table.primary_key attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
table.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
table.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
table.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
table.unique
table.unique attributes
| Name | Required | Value |
|---|---|---|
columns | true | Index columns can be one of:
|
comment | false | string |
table.unique constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Mutually exclusive sets | [columns, on] |
| One of required sets | [columns, on] |
table constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., table "name" ) | true |
Allow Qualifier (e.g., table "schema" "name" ) | true |
tag
The tag block describes a Snowflake tag in a database schema.
tag "public" "cost_center" {
schema = schema.public
allowed_values = ["finance", "engineering", "sales"]
propagate = ON_DEPENDENCY
on_conflict = ALLOWED_VALUES_SEQUENCE
comment = "cost center tag"
}
tag attributes
| Name | Required | Value |
|---|---|---|
allowed_values | false | List of strings |
comment | false | string |
masking_policies | false | List of values, where each can be one of:
|
on_conflict | false | Conflict resolution strategy can be one of:
|
propagate | false |
|
schema | true | Object reference to |
tag constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., tag "name" ) | true |
Allow Qualifier (e.g., tag "schema" "name" ) | true |
task
The task block describes a Snowflake task in a database schema.
task "my_task" {
schema = schema.public
schedule = "5 MINUTE"
warehouse = "my_wh"
as = "INSERT INTO t1 SELECT * FROM t2"
comment = "This is my task"
}
task attributes
| Name | Required | Value |
|---|---|---|
after | false | List of object reference to |
as | true | string |
comment | false | string |
condition | false | string |
config | false | string |
depends_on | false | List of object references |
error_integration | false | string |
execute_as | false | string |
finalize | false | Object reference to |
log_level | false | string |
overlap_policy | false |
|
query_tag | false | string |
schedule | false | string |
schema | true | Object reference to |
serverless_task_max_statement_size | false | string |
serverless_task_min_statement_size | false | string |
session_parameters | false | map |
success_integration | false | string |
suspend_task_after_num_failures | false | int |
target_completion_interval | false | string |
task_auto_retry_attempts | false | int |
timezone | false | string |
user_task_managed_initial_warehouse_size | false | string |
user_task_minimum_trigger_interval_in_seconds | false | int |
user_task_timeout_ms | false | int |
warehouse | false | Warehouse name or reference can be one of:
|
task blocks
task.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
task.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
task.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
task constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., task "name" ) | true |
Allow Qualifier (e.g., task "schema" "name" ) | true |
| Mutually exclusive sets | [warehouse, user_task_managed_initial_warehouse_size], [schedule, after], [schedule, finalize], [after, finalize], [overlap_policy, after], [overlap_policy, finalize] |
user
user attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
member_of | false | List of values, where each can be one of:
|
user constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., user "name" ) | true |
view
The view block describes a view in a database schema.
view "clean_users" {
schema = schema.public
column "id" {
type = int
}
...
}
view attributes
| Name | Required | Value |
|---|---|---|
as | true | string |
comment | false | string |
depends_on | false | List of object references |
schema | true | Object reference to |
secure | false | bool |
view blocks
view.annotation
view.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
view.column
view.column attributes
| Name | Required | Value |
|---|---|---|
comment | false | string |
default | false | Column default value can be one of:
|
null | false | bool |
type | false | Column type can be one of:
|
view.column blocks
view.column.annotation
view.column.annotation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Allow unknown blocks | true |
| Allow unknown attributes | true |
view.column.policy.masking
view.column.policy.masking attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
using | false | List of strings |
view.column.policy.masking constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
view.column.policy.projection
view.column.policy.projection attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
view.column.policy.projection constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
view.column.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
view.column.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
view.column.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
view.column constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., view.column "name" ) | true |
view.policy.aggregation
view.policy.aggregation attributes
| Name | Required | Value |
|---|---|---|
entity_key | false | List of strings |
ref | true | Policy reference can be one of:
|
view.policy.aggregation constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
view.policy.join
view.policy.join attributes
| Name | Required | Value |
|---|---|---|
ref | true | Policy reference can be one of:
|
view.policy.join constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
view.policy.row_access
view.policy.row_access attributes
| Name | Required | Value |
|---|---|---|
columns | true | List of strings |
ref | true | Policy reference can be one of:
|
view.policy.row_access constraints
| Constraint | Value |
|---|---|
| Required | false |
| Repeatable | true |
view.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
view.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
view.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
view constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., view "name" ) | true |
Allow Qualifier (e.g., view "schema" "name" ) | true |
warehouse
The warehouse block describes a Snowflake virtual warehouse.
warehouse "my_wh" {
size = "X-Small"
type = STANDARD
auto_suspend = 600
auto_resume = true
comment = "My warehouse"
}
warehouse attributes
| Name | Required | Value |
|---|---|---|
auto_resume | false | bool |
auto_suspend | false | int |
comment | false | string |
enable_query_acceleration | false | bool |
generation | false | Warehouse generation can be one of:
|
max_cluster_count | false | int |
max_concurrency_level | false | int |
min_cluster_count | false | int |
query_acceleration_max_scale_factor | false | int |
resource_constraint | false |
|
resource_monitor | false | Resource monitor name or reference can be one of:
|
scaling_policy | false |
|
size | false |
|
statement_queued_timeout_in_seconds | false | int |
statement_timeout_in_seconds | false | int |
type | false |
|
warehouse blocks
warehouse.tag
The tag block describes the association of a Snowflake tag with a supported object (e.g., table, view, column, etc.).
table "USERS" {
schema = schema.SALES
retention_time = 1
column "CUSTOMER_ID" {
null = true
type = NUMBER(38)
}
column "EMAIL" {
null = true
type = VARCHAR(16777216)
}
tag {
ref = tag.DATA_DOMAIN
value = "customer_management"
}
}
warehouse.tag attributes
| Name | Required | Value |
|---|---|---|
ref | true | Tag reference can be one of:
|
value | true | string |
warehouse.tag constraints
| Constraint | Value |
|---|---|
| Required | false |
| Require Name | false |
| Repeatable | true |
warehouse constraints
| Constraint | Value |
|---|---|
| Required | false |
Require Name (e.g., warehouse "name" ) | true |