From b626d76c3047f45a41f4510536675ae1bdd1f35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Gniewek-W=C4=99grzyn?= Date: Thu, 11 Sep 2025 11:53:41 +0200 Subject: [PATCH] docs: document workaround for Standard Snowflake edition --- README.md | 46 +++++++++++++++++++++++++++++++++++++++ examples/complete/main.tf | 31 ++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/README.md b/README.md index eb2a73c..b65dd8e 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,52 @@ List od code and variable (API) changes: For more information about preview features, refer to the [Snowflake provider documentation](https://registry.terraform.io/providers/snowflakedb/snowflake/latest/docs/resources/stage#preview-features) and [Snowflake stage resource documentation](https://registry.terraform.io/providers/snowflakedb/snowflake/latest/docs/resources/stage). +## Known limitations + +### Standard Snowflake Edition + +When using "Standard" Snowflake Edition, `transformer` "default role" for schema might be failing, due to lack of support for `MATERIALIZED VIEW`. it can be easily workaround by overwriting default role definition: + +```hcl +module "project_database" { + source = "getindata/database/snowflake" + # version = "x.x.x" + + create_default_roles = true + + schemas = { + test = { + roles = { + transformer = { + schema_grants = [{ + privileges = [ + "CREATE TEMPORARY TABLE", + "CREATE TAG", + "CREATE PIPE", + "CREATE PROCEDURE", + "USAGE", + "CREATE TABLE", + "CREATE FILE FORMAT", + "CREATE STAGE", + "CREATE TASK", + "CREATE FUNCTION", + "CREATE EXTERNAL TABLE", + "CREATE SEQUENCE", + "CREATE VIEW", + "CREATE STREAM" + ] + }] + schema_objects_grants = { + "MATERIALIZED VIEW" = [] + } + } + } + } + } +} + +``` + diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 3da8b16..1eef502 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -69,6 +69,7 @@ module "database" { } } +# This configuration might be used with "Standard" Snowflake edition, where MATERIALIZED VIEWs are not supported. module "project_database" { source = "../../" @@ -90,4 +91,34 @@ module "project_database" { create_default_roles = true database_ownership_grant = snowflake_account_role.admin_role.name + + schemas = { + test = { + roles = { + transformer = { + schema_grants = [{ + privileges = [ + "CREATE TEMPORARY TABLE", + "CREATE TAG", + "CREATE PIPE", + "CREATE PROCEDURE", + "USAGE", + "CREATE TABLE", + "CREATE FILE FORMAT", + "CREATE STAGE", + "CREATE TASK", + "CREATE FUNCTION", + "CREATE EXTERNAL TABLE", + "CREATE SEQUENCE", + "CREATE VIEW", + "CREATE STREAM" + ] + }] + schema_objects_grants = { + "MATERIALIZED VIEW" = [] + } + } + } + } + } }