From a76b7c98e7442bae1a71d1e75da675e0745c70fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Gniewek-W=C4=99grzyn?= Date: Fri, 2 Aug 2024 12:28:43 +0200 Subject: [PATCH 1/5] fix: default roles permissions, bump stage module, removed unneeded / dangerous variables --- README.md | 6 +- examples/complete/main.tf | 3 +- locals.tf | 322 ++++++++++++++++++++++---------------- main.tf | 2 +- variables.tf | 11 -- 5 files changed, 194 insertions(+), 150 deletions(-) diff --git a/README.md b/README.md index 56c22e9..62947f8 100644 --- a/README.md +++ b/README.md @@ -100,10 +100,10 @@ For more information, refer to [variables.tf](variables.tf), list of inputs belo | [quoted\_identifiers\_ignore\_case](#input\_quoted\_identifiers\_ignore\_case) | If true, the case of quoted identifiers is ignored. | `bool` | `null` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [replace\_invalid\_characters](#input\_replace\_invalid\_characters) | Specifies whether to replace invalid UTF-8 characters with the Unicode replacement character () in query results for an Iceberg table.
You can only set this parameter for tables that use an external Iceberg catalog. | `bool` | `null` | no | -| [roles](#input\_roles) | Database roles created in the scheme scope |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-database-role")
role_ownership_grant = optional(string)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
database_grants = optional(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string), null)
}))
schema_grants = optional(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string), null)
all_schemas_in_database = optional(bool, false)
future_schemas_in_database = optional(bool, false)
schema_name = optional(string, null)
})))
schema_objects_grants = optional(map(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool)
privileges = optional(list(string), null)
object_name = optional(string)
on_all = optional(bool, false)
schema_name = optional(string)
on_future = optional(bool, false)
}))), {})
}))
| `{}` | no | +| [roles](#input\_roles) | Database roles created in the scheme scope |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-database-role")
role_ownership_grant = optional(string)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
schema_grants = optional(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string), null)
future_schemas_in_database = optional(bool, false)
})))
schema_objects_grants = optional(map(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool)
privileges = optional(list(string), null)
object_name = optional(string)
on_all = optional(bool, false)
on_future = optional(bool, false)
}))), {})
}))
| `{}` | no | | [skip\_schema\_creation](#input\_skip\_schema\_creation) | "Should schema creation be skipped but allow all other resources to be created.
Useful if schema already exsists but you want to add e.g. access roles" | `bool` | `false` | no | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | -| [stages](#input\_stages) | Stages to be created in the schema |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-stage")
aws_external_id = optional(string)
comment = optional(string)
copy_options = optional(string)
credentials = optional(string)
directory = optional(string)
encryption = optional(string)
file_format = optional(string)
snowflake_iam_user = optional(string)
storage_integration = optional(string)
url = optional(string)
roles = optional(map(object({
descriptor_name = optional(string, "snowflake-database-role")
with_grant_option = optional(bool)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
stage_grants = optional(list(string))
all_privileges = optional(bool)
on_all = optional(bool, false)
schema_name = optional(string)
on_future = optional(bool, false)
})), ({}))
create_default_roles = optional(bool, false)
}))
| `{}` | no | +| [stages](#input\_stages) | Stages to be created in the schema |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-stage")
aws_external_id = optional(string)
comment = optional(string)
copy_options = optional(string)
credentials = optional(string)
directory = optional(string)
encryption = optional(string)
file_format = optional(string)
snowflake_iam_user = optional(string)
storage_integration = optional(string)
url = optional(string)
roles = optional(map(object({
descriptor_name = optional(string, "snowflake-database-role")
with_grant_option = optional(bool)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
stage_grants = optional(list(string))
all_privileges = optional(bool)
})), ({}))
create_default_roles = optional(bool, false)
}))
| `{}` | no | | [storage\_serialization\_policy](#input\_storage\_serialization\_policy) | The storage serialization policy for Iceberg tables that use Snowflake as the catalog.
Valid options are: [COMPATIBLE OPTIMIZED]. | `string` | `null` | no | | [suspend\_task\_after\_num\_failures](#input\_suspend\_task\_after\_num\_failures) | How many times a task must fail in a row before it is automatically suspended. 0 disables auto-suspending. | `number` | `null` | no | | [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | @@ -123,7 +123,7 @@ For more information, refer to [variables.tf](variables.tf), list of inputs belo | [schema\_label](#module\_schema\_label) | cloudposse/label/null | 0.25.0 | | [snowflake\_custom\_role](#module\_snowflake\_custom\_role) | getindata/database-role/snowflake | 1.1.1 | | [snowflake\_default\_role](#module\_snowflake\_default\_role) | getindata/database-role/snowflake | 1.1.1 | -| [snowflake\_stage](#module\_snowflake\_stage) | getindata/stage/snowflake | 2.1.0 | +| [snowflake\_stage](#module\_snowflake\_stage) | getindata/stage/snowflake | 2.1.1 | | [this](#module\_this) | cloudposse/label/null | 0.25.0 | ## Outputs diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 320ad8d..0041da1 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -91,7 +91,7 @@ module "this_schema" { on_future = true } ] - "HYBRID TABLE" = [ + "ICEBERG TABLE" = [ { all_privileges = true on_all = true @@ -116,7 +116,6 @@ module "this_schema" { "ALERT" = [ { all_privileges = true - schema_name = "RAW" with_grant_option = true on_all = true } diff --git a/locals.tf b/locals.tf index debd75a..032df8e 100644 --- a/locals.tf +++ b/locals.tf @@ -18,7 +18,6 @@ locals { granted_database_roles = [] granted_to_database_roles = [] schema_grants = [] - database_grants = [] schema_objects_grants = { "TABLE" = [] "DYNAMIC TABLE" = [] @@ -38,178 +37,205 @@ locals { default_roles_definition = { readonly = { schema_grants = [{ - privileges = ["USAGE"] - all_schemas_in_database = true - future_schemas_in_database = true + privileges = ["USAGE"] + schema_name = local.name_from_descriptor }] schema_objects_grants = { "TABLE" = [{ - privileges = ["SELECT"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT"] + on_all = true + on_future = true }] "DYNAMIC TABLE" = [{ - privileges = ["SELECT"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT"] + on_all = true + on_future = true }] "EXTERNAL TABLE" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "VIEW" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "MATERIALIZED VIEW" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "FILE FORMAT" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] "FUNCTION" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] "STAGE" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] "TASK" = [{ - privileges = ["MONITOR"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["MONITOR"] + on_all = true + on_future = true }] } } readwrite = { schema_grants = [{ - privileges = ["USAGE"] - all_schemas_in_database = true - future_schemas_in_database = true + privileges = ["USAGE"] + schema_name = local.name_from_descriptor }] schema_objects_grants = { "TABLE" = [{ - privileges = ["SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "REBUILD"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "REBUILD"] + on_all = true + on_future = true }] "DYNAMIC TABLE" = [{ - privileges = ["SELECT"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT"] + on_all = true + on_future = true }] "EXTERNAL TABLE" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "VIEW" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "MATERIALIZED VIEW" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "FILE FORMAT" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] "FUNCTION" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] "STAGE" = [{ - privileges = ["USAGE", "READ", "WRITE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE", "READ", "WRITE"] + on_all = true + on_future = true }] "TASK" = [{ - privileges = ["MONITOR", "OPERATE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["MONITOR", "OPERATE"] + on_all = true + on_future = true }] "PROCEDURE" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] } } admin = { schema_grants = [{ - privileges = ["ALL PRIVILEGES"] - all_schemas_in_database = true - future_schemas_in_database = true + privileges = ["ALL PRIVILEGES"] + schema_name = local.name_from_descriptor }] schema_objects_grants = { "TABLE" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "DYNAMIC TABLE" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "EXTERNAL TABLE" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "VIEW" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "MATERIALIZED VIEW" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "FILE FORMAT" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "FUNCTION" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "STAGE" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "TASK" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] "PROCEDURE" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true + schema_name = local.name_from_descriptor }] } } transformer = { schema_grants = [{ + schema_name = local.name_from_descriptor privileges = [ "CREATE TEMPORARY TABLE", "CREATE TAG", @@ -227,69 +253,99 @@ locals { "CREATE VIEW", "CREATE STREAM" ] - all_schemas_in_database = true - future_schemas_in_database = true }] schema_objects_grants = { "TABLE" = [{ - privileges = ["SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "REBUILD"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES", "REBUILD"] + on_all = true + on_future = true }] "DYNAMIC TABLE" = [{ - privileges = ["ALL PRIVILEGES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["ALL PRIVILEGES"] + on_all = true + on_future = true }] "EXTERNAL TABLE" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "VIEW" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "MATERIALIZED VIEW" = [{ - privileges = ["SELECT", "REFERENCES"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["SELECT", "REFERENCES"] + on_all = true + on_future = true }] "FILE FORMAT" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] "FUNCTION" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] "STAGE" = [{ - privileges = ["USAGE", "READ", "WRITE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE", "READ", "WRITE"] + on_all = true + on_future = true }] "TASK" = [{ - privileges = ["MONITOR", "OPERATE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["MONITOR", "OPERATE"] + on_all = true + on_future = true }] "PROCEDURE" = [{ - privileges = ["USAGE"] - on_all = true - on_future = true + schema_name = local.name_from_descriptor + privileges = ["USAGE"] + on_all = true + on_future = true }] } } } + # Cleanup null values and add current schema_name to the objects provided_roles = { - for role_name, role in var.roles : role_name => { - for k, v in role : k => v - if v != null - } + for role_name, role in var.roles : role_name => merge( + { + for k, v in role : k => v + if v != null && k != "schema_objects_grants" && k != "schema_grants" + }, + { + for k, v in role : k => [ + for object in v : merge(object, { schema_name = local.name_from_descriptor }) + ] + if v != null && k == "schema_grants" + }, + { + for k, v in role : k => { + for object, config in v : object => [ + for grant in config : merge( + grant, + { + schema_name = local.name_from_descriptor + } + ) + ] + } + if v != null && k == "schema_objects_grants" + } + ) } roles_definition = { diff --git a/main.tf b/main.tf index 90f793b..3ad67cb 100644 --- a/main.tf +++ b/main.tf @@ -41,7 +41,7 @@ module "snowflake_stage" { for_each = var.stages source = "getindata/stage/snowflake" - version = "2.1.0" + version = "2.1.1" enabled = module.this.enabled && each.value.enabled context = module.this.context diff --git a/variables.tf b/variables.tf index 1653a5f..3fc4376 100644 --- a/variables.tf +++ b/variables.tf @@ -58,18 +58,11 @@ variable "roles" { granted_to_roles = optional(list(string)) granted_to_database_roles = optional(list(string)) granted_database_roles = optional(list(string)) - database_grants = optional(object({ - all_privileges = optional(bool) - with_grant_option = optional(bool, false) - privileges = optional(list(string), null) - })) schema_grants = optional(list(object({ all_privileges = optional(bool) with_grant_option = optional(bool, false) privileges = optional(list(string), null) - all_schemas_in_database = optional(bool, false) future_schemas_in_database = optional(bool, false) - schema_name = optional(string, null) }))) schema_objects_grants = optional(map(list(object({ all_privileges = optional(bool) @@ -77,7 +70,6 @@ variable "roles" { privileges = optional(list(string), null) object_name = optional(string) on_all = optional(bool, false) - schema_name = optional(string) on_future = optional(bool, false) }))), {}) })) @@ -107,9 +99,6 @@ variable "stages" { granted_database_roles = optional(list(string)) stage_grants = optional(list(string)) all_privileges = optional(bool) - on_all = optional(bool, false) - schema_name = optional(string) - on_future = optional(bool, false) })), ({})) create_default_roles = optional(bool, false) })) From 29418c9556bc6115258b347823f0cdb70a4cf5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Gniewek-W=C4=99grzyn?= Date: Fri, 2 Aug 2024 12:46:44 +0200 Subject: [PATCH 2/5] fix: remove once more, unneeded var --- variables.tf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/variables.tf b/variables.tf index 3fc4376..7dd9ea1 100644 --- a/variables.tf +++ b/variables.tf @@ -59,10 +59,9 @@ variable "roles" { granted_to_database_roles = optional(list(string)) granted_database_roles = optional(list(string)) schema_grants = optional(list(object({ - all_privileges = optional(bool) - with_grant_option = optional(bool, false) - privileges = optional(list(string), null) - future_schemas_in_database = optional(bool, false) + all_privileges = optional(bool) + with_grant_option = optional(bool, false) + privileges = optional(list(string), null) }))) schema_objects_grants = optional(map(list(object({ all_privileges = optional(bool) From e0ac0c0ef9713b865d142136915ed4614e10b7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Gniewek-W=C4=99grzyn?= Date: Fri, 2 Aug 2024 12:53:38 +0200 Subject: [PATCH 3/5] docs: update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62947f8..3b6acb6 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ For more information, refer to [variables.tf](variables.tf), list of inputs belo | [quoted\_identifiers\_ignore\_case](#input\_quoted\_identifiers\_ignore\_case) | If true, the case of quoted identifiers is ignored. | `bool` | `null` | no | | [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | [replace\_invalid\_characters](#input\_replace\_invalid\_characters) | Specifies whether to replace invalid UTF-8 characters with the Unicode replacement character () in query results for an Iceberg table.
You can only set this parameter for tables that use an external Iceberg catalog. | `bool` | `null` | no | -| [roles](#input\_roles) | Database roles created in the scheme scope |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-database-role")
role_ownership_grant = optional(string)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
schema_grants = optional(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string), null)
future_schemas_in_database = optional(bool, false)
})))
schema_objects_grants = optional(map(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool)
privileges = optional(list(string), null)
object_name = optional(string)
on_all = optional(bool, false)
on_future = optional(bool, false)
}))), {})
}))
| `{}` | no | +| [roles](#input\_roles) | Database roles created in the scheme scope |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-database-role")
role_ownership_grant = optional(string)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
schema_grants = optional(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string), null)
})))
schema_objects_grants = optional(map(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool)
privileges = optional(list(string), null)
object_name = optional(string)
on_all = optional(bool, false)
on_future = optional(bool, false)
}))), {})
}))
| `{}` | no | | [skip\_schema\_creation](#input\_skip\_schema\_creation) | "Should schema creation be skipped but allow all other resources to be created.
Useful if schema already exsists but you want to add e.g. access roles" | `bool` | `false` | no | | [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | | [stages](#input\_stages) | Stages to be created in the schema |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-stage")
aws_external_id = optional(string)
comment = optional(string)
copy_options = optional(string)
credentials = optional(string)
directory = optional(string)
encryption = optional(string)
file_format = optional(string)
snowflake_iam_user = optional(string)
storage_integration = optional(string)
url = optional(string)
roles = optional(map(object({
descriptor_name = optional(string, "snowflake-database-role")
with_grant_option = optional(bool)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
stage_grants = optional(list(string))
all_privileges = optional(bool)
})), ({}))
create_default_roles = optional(bool, false)
}))
| `{}` | no | From 352fe3efe2be831b860c9db76358467ee9cb59d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Gniewek-W=C4=99grzyn?= Date: Fri, 2 Aug 2024 12:59:33 +0200 Subject: [PATCH 4/5] fix: example fixtures --- examples/complete/fixtures.tfvars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/complete/fixtures.tfvars b/examples/complete/fixtures.tfvars index 78d1a3e..37d8286 100644 --- a/examples/complete/fixtures.tfvars +++ b/examples/complete/fixtures.tfvars @@ -2,7 +2,7 @@ namespace = "gid" stage = "example" descriptor_formats = { - snowflake-role = { + snowflake-database-role = { labels = ["attributes", "name"] format = "%v_%v" } From 3689477b82466a9b27d37a8cb0ac9b2a19b60f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Gniewek-W=C4=99grzyn?= Date: Fri, 2 Aug 2024 14:47:50 +0200 Subject: [PATCH 5/5] docs: fix readme --- README.md | 176 +++++++++++++++++++++++++++--------------------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index c16bdbb..35175f9 100644 --- a/README.md +++ b/README.md @@ -68,111 +68,111 @@ For more information, refer to [variables.tf](variables.tf), list of inputs belo ## Inputs -| Name | Description | Type | Default | Required | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------: | -| [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no | -| [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no | -| [catalog](#input\_catalog) | Parameter that specifies the default catalog to use for Iceberg tables. | `string` | `null` | no | -| [comment](#input\_comment) | Specifies a comment for the schema | `string` | `null` | no | -| [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no | -| [create\_default\_roles](#input\_create\_default\_roles) | Whether the default database roles should be created | `bool` | `false` | no | -| [data\_retention\_time\_in\_days](#input\_data\_retention\_time\_in\_days) | Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema,
as well as specifying the default Time Travel retention time for all tables created in the schema | `number` | `1` | no | -| [database](#input\_database) | Database where the schema should be created | `string` | n/a | yes | -| [default\_ddl\_collation](#input\_default\_ddl\_collation) | Specifies a default collation specification for all schemas and tables added to the database.
It can be overridden on schema or table level. | `string` | `null` | no | -| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | -| [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no | -| [descriptor\_name](#input\_descriptor\_name) | Name of the descriptor used to form a resource name | `string` | `"snowflake-schema"` | no | -| [enable\_console\_output](#input\_enable\_console\_output) | Enables console output for user tasks. | `bool` | `null` | no | -| [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no | -| [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | -| [external\_volume](#input\_external\_volume) | Parameter that specifies the default external volume to use for Iceberg tables. | `string` | `null` | no | -| [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length.
Set to `null` for keep the existing setting, which defaults to `0`.
Does not affect `id_full`. | `number` | `null` | no | -| [is\_transient](#input\_is\_transient) | Specifies a schema as transient.
Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel;
however, this means they are also not protected by Fail-safe in the event of a data loss. | `bool` | `false` | no | -| [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
Does not affect keys of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no | -| [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no | -| [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no | -| [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` |
[
"default"
]
| no | -| [log\_level](#input\_log\_level) | Specifies the severity level of messages that should be ingested and made available in the active event table.
Valid options are: [TRACE DEBUG INFO WARN ERROR FATAL OFF].
Messages at the specified level (and at more severe levels) are ingested. | `string` | `null` | no | -| [max\_data\_extension\_time\_in\_days](#input\_max\_data\_extension\_time\_in\_days) | Object parameter that specifies the maximum number of days for which Snowflake can extend the data retention period
for tables in the database to prevent streams on the tables from becoming stale. | `number` | `null` | no | -| [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no | -| [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | -| [pipe\_execution\_paused](#input\_pipe\_execution\_paused) | Pauses the execution of a pipe. | `bool` | `null` | no | -| [quoted\_identifiers\_ignore\_case](#input\_quoted\_identifiers\_ignore\_case) | If true, the case of quoted identifiers is ignored. | `bool` | `null` | no | -| [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | -| [replace\_invalid\_characters](#input\_replace\_invalid\_characters) | Specifies whether to replace invalid UTF-8 characters with the Unicode replacement character () in query results for an Iceberg table.
You can only set this parameter for tables that use an external Iceberg catalog. | `bool` | `null` | no | -| [roles](#input\_roles) | Database roles created in the scheme scope |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-database-role")
role_ownership_grant = optional(string)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
schema_grants = optional(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string), null)
})))
schema_objects_grants = optional(map(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool)
privileges = optional(list(string), null)
object_name = optional(string)
on_all = optional(bool, false)
on_future = optional(bool, false)
}))), {})
}))
| `{}` | no | -| [skip\_schema\_creation](#input\_skip\_schema\_creation) | "Should schema creation be skipped but allow all other resources to be created.
Useful if schema already exsists but you want to add e.g. access roles" | `bool` | `false` | no | -| [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | -| [stages](#input\_stages) | Stages to be created in the schema |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-stage")
aws_external_id = optional(string)
comment = optional(string)
copy_options = optional(string)
credentials = optional(string)
directory = optional(string)
encryption = optional(string)
file_format = optional(string)
snowflake_iam_user = optional(string)
storage_integration = optional(string)
url = optional(string)
roles = optional(map(object({
descriptor_name = optional(string, "snowflake-database-role")
with_grant_option = optional(bool)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
stage_grants = optional(list(string))
all_privileges = optional(bool)
})), ({}))
create_default_roles = optional(bool, false)
}))
| `{}` | no | -| [storage\_serialization\_policy](#input\_storage\_serialization\_policy) | The storage serialization policy for Iceberg tables that use Snowflake as the catalog.
Valid options are: [COMPATIBLE OPTIMIZED]. | `string` | `null` | no | -| [suspend\_task\_after\_num\_failures](#input\_suspend\_task\_after\_num\_failures) | How many times a task must fail in a row before it is automatically suspended. 0 disables auto-suspending. | `number` | `null` | no | -| [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | -| [task\_auto\_retry\_attempts](#input\_task\_auto\_retry\_attempts) | Maximum automatic retries allowed for a user task. | `number` | `null` | no | -| [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no | -| [trace\_level](#input\_trace\_level) | Controls how trace events are ingested into the event table.
Valid options are: [ALWAYS ON\_EVENT OFF]." | `string` | `null` | no | -| [user\_task\_managed\_initial\_warehouse\_size](#input\_user\_task\_managed\_initial\_warehouse\_size) | The initial size of warehouse to use for managed warehouses in the absence of history. | `string` | `null` | no | -| [user\_task\_minimum\_trigger\_interval\_in\_seconds](#input\_user\_task\_minimum\_trigger\_interval\_in\_seconds) | Minimum amount of time between Triggered Task executions in seconds. | `number` | `null` | no | -| [user\_task\_timeout\_ms](#input\_user\_task\_timeout\_ms) | User task execution timeout in milliseconds. | `number` | `null` | no | -| [with\_managed\_access](#input\_with\_managed\_access) | Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner | `bool` | `false` | no | +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
This is for some rare cases where resources want additional configuration of tags
and therefore take a list of maps with tag key, value, and additional configuration. | `map(string)` | `{}` | no | +| [attributes](#input\_attributes) | ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`,
in the order they appear in the list. New attributes are appended to the
end of the list. The elements of the list are joined by the `delimiter`
and treated as a single ID element. | `list(string)` | `[]` | no | +| [catalog](#input\_catalog) | Parameter that specifies the default catalog to use for Iceberg tables. | `string` | `null` | no | +| [comment](#input\_comment) | Specifies a comment for the schema | `string` | `null` | no | +| [context](#input\_context) | Single object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as `null` to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional\_tag\_map, which are merged. | `any` |
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {},
"tenant": null
}
| no | +| [create\_default\_roles](#input\_create\_default\_roles) | Whether the default database roles should be created | `bool` | `false` | no | +| [data\_retention\_time\_in\_days](#input\_data\_retention\_time\_in\_days) | Specifies the number of days for which Time Travel actions (CLONE and UNDROP) can be performed on the schema,
as well as specifying the default Time Travel retention time for all tables created in the schema | `number` | `1` | no | +| [database](#input\_database) | Database where the schema should be created | `string` | n/a | yes | +| [default\_ddl\_collation](#input\_default\_ddl\_collation) | Specifies a default collation specification for all schemas and tables added to the database.
It can be overridden on schema or table level. | `string` | `null` | no | +| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | +| [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no | +| [descriptor\_name](#input\_descriptor\_name) | Name of the descriptor used to form a resource name | `string` | `"snowflake-schema"` | no | +| [enable\_console\_output](#input\_enable\_console\_output) | Enables console output for user tasks. | `bool` | `null` | no | +| [enabled](#input\_enabled) | Set to false to prevent the module from creating any resources | `bool` | `null` | no | +| [environment](#input\_environment) | ID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | +| [external\_volume](#input\_external\_volume) | Parameter that specifies the default external volume to use for Iceberg tables. | `string` | `null` | no | +| [id\_length\_limit](#input\_id\_length\_limit) | Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length.
Set to `null` for keep the existing setting, which defaults to `0`.
Does not affect `id_full`. | `number` | `null` | no | +| [is\_transient](#input\_is\_transient) | Specifies a schema as transient.
Transient schemas do not have a Fail-safe period so they do not incur additional storage costs once they leave Time Travel;
however, this means they are also not protected by Fail-safe in the event of a data loss. | `bool` | `false` | no | +| [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.
Does not affect keys of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper`.
Default value: `title`. | `string` | `null` | no | +| [label\_order](#input\_label\_order) | The order in which the labels (ID elements) appear in the `id`.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 6 labels ("tenant" is the 6th), but at least one must be present. | `list(string)` | `null` | no | +| [label\_value\_case](#input\_label\_value\_case) | Controls the letter case of ID elements (labels) as included in `id`,
set as tag values, and output by this module individually.
Does not affect values of tags passed in via the `tags` input.
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Set this to `title` and set `delimiter` to `""` to yield Pascal Case IDs.
Default value: `lower`. | `string` | `null` | no | +| [labels\_as\_tags](#input\_labels\_as\_tags) | Set of labels (ID elements) to include as tags in the `tags` output.
Default is to include all labels.
Tags with empty values will not be included in the `tags` output.
Set to `[]` to suppress all generated tags.
**Notes:**
The value of the `name` tag, if included, will be the `id`, not the `name`.
Unlike other `null-label` inputs, the initial setting of `labels_as_tags` cannot be
changed in later chained modules. Attempts to change it will be silently ignored. | `set(string)` |
[
"default"
]
| no | +| [log\_level](#input\_log\_level) | Specifies the severity level of messages that should be ingested and made available in the active event table.
Valid options are: [TRACE DEBUG INFO WARN ERROR FATAL OFF].
Messages at the specified level (and at more severe levels) are ingested. | `string` | `null` | no | +| [max\_data\_extension\_time\_in\_days](#input\_max\_data\_extension\_time\_in\_days) | Object parameter that specifies the maximum number of days for which Snowflake can extend the data retention period
for tables in the database to prevent streams on the tables from becoming stale. | `number` | `null` | no | +| [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
This is the only ID element not also included as a `tag`.
The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no | +| [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no | +| [pipe\_execution\_paused](#input\_pipe\_execution\_paused) | Pauses the execution of a pipe. | `bool` | `null` | no | +| [quoted\_identifiers\_ignore\_case](#input\_quoted\_identifiers\_ignore\_case) | If true, the case of quoted identifiers is ignored. | `bool` | `null` | no | +| [regex\_replace\_chars](#input\_regex\_replace\_chars) | Terraform regular expression (regex) string.
Characters matching the regex will be removed from the ID elements.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | +| [replace\_invalid\_characters](#input\_replace\_invalid\_characters) | Specifies whether to replace invalid UTF-8 characters with the Unicode replacement character () in query results for an Iceberg table.
You can only set this parameter for tables that use an external Iceberg catalog. | `bool` | `null` | no | +| [roles](#input\_roles) | Database roles created in the scheme scope |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-database-role")
role_ownership_grant = optional(string)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
schema_grants = optional(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool, false)
privileges = optional(list(string), null)
})))
schema_objects_grants = optional(map(list(object({
all_privileges = optional(bool)
with_grant_option = optional(bool)
privileges = optional(list(string), null)
object_name = optional(string)
on_all = optional(bool, false)
on_future = optional(bool, false)
}))), {})
}))
| `{}` | no | +| [skip\_schema\_creation](#input\_skip\_schema\_creation) | Should schema creation be skipped but allow all other resources to be created.
Useful if schema already exsists but you want to add e.g. access roles." | `bool` | `false` | no | +| [stage](#input\_stage) | ID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'build', 'test', 'deploy', 'release' | `string` | `null` | no | +| [stages](#input\_stages) | Stages to be created in the schema |
map(object({
enabled = optional(bool, true)
descriptor_name = optional(string, "snowflake-stage")
aws_external_id = optional(string)
comment = optional(string)
copy_options = optional(string)
credentials = optional(string)
directory = optional(string)
encryption = optional(string)
file_format = optional(string)
snowflake_iam_user = optional(string)
storage_integration = optional(string)
url = optional(string)
roles = optional(map(object({
descriptor_name = optional(string, "snowflake-database-role")
with_grant_option = optional(bool)
granted_to_roles = optional(list(string))
granted_to_database_roles = optional(list(string))
granted_database_roles = optional(list(string))
stage_grants = optional(list(string))
all_privileges = optional(bool)
})), ({}))
create_default_roles = optional(bool, false)
}))
| `{}` | no | +| [storage\_serialization\_policy](#input\_storage\_serialization\_policy) | The storage serialization policy for Iceberg tables that use Snowflake as the catalog.
Valid options are: [COMPATIBLE OPTIMIZED]. | `string` | `null` | no | +| [suspend\_task\_after\_num\_failures](#input\_suspend\_task\_after\_num\_failures) | How many times a task must fail in a row before it is automatically suspended. 0 disables auto-suspending. | `number` | `null` | no | +| [tags](#input\_tags) | Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`).
Neither the tag keys nor the tag values will be modified by this module. | `map(string)` | `{}` | no | +| [task\_auto\_retry\_attempts](#input\_task\_auto\_retry\_attempts) | Maximum automatic retries allowed for a user task. | `number` | `null` | no | +| [tenant](#input\_tenant) | ID element \_(Rarely used, not included by default)\_. A customer identifier, indicating who this instance of a resource is for | `string` | `null` | no | +| [trace\_level](#input\_trace\_level) | Controls how trace events are ingested into the event table.
Valid options are: [ALWAYS ON\_EVENT OFF]." | `string` | `null` | no | +| [user\_task\_managed\_initial\_warehouse\_size](#input\_user\_task\_managed\_initial\_warehouse\_size) | The initial size of warehouse to use for managed warehouses in the absence of history. | `string` | `null` | no | +| [user\_task\_minimum\_trigger\_interval\_in\_seconds](#input\_user\_task\_minimum\_trigger\_interval\_in\_seconds) | Minimum amount of time between Triggered Task executions in seconds. | `number` | `null` | no | +| [user\_task\_timeout\_ms](#input\_user\_task\_timeout\_ms) | User task execution timeout in milliseconds. | `number` | `null` | no | +| [with\_managed\_access](#input\_with\_managed\_access) | Specifies a managed schema. Managed access schemas centralize privilege management with the schema owner | `bool` | `false` | no | ## Modules -| Name | Source | Version | -| ---------------------------------------------------------------------------------------------------------- | --------------------------------- | ------- | -| [roles\_deep\_merge](#module\_roles\_deep\_merge) | Invicton-Labs/deepmerge/null | 0.1.5 | -| [schema\_label](#module\_schema\_label) | cloudposse/label/null | 0.25.0 | -| [snowflake\_custom\_role](#module\_snowflake\_custom\_role) | getindata/database-role/snowflake | 1.1.1 | -| [snowflake\_default\_role](#module\_snowflake\_default\_role) | getindata/database-role/snowflake | 1.1.1 | -| [snowflake\_stage](#module\_snowflake\_stage) | getindata/stage/snowflake | 2.1.1 | -| [this](#module\_this) | cloudposse/label/null | 0.25.0 | +| Name | Source | Version | +|------|--------|---------| +| [roles\_deep\_merge](#module\_roles\_deep\_merge) | Invicton-Labs/deepmerge/null | 0.1.5 | +| [schema\_label](#module\_schema\_label) | cloudposse/label/null | 0.25.0 | +| [snowflake\_custom\_role](#module\_snowflake\_custom\_role) | getindata/database-role/snowflake | 1.1.1 | +| [snowflake\_default\_role](#module\_snowflake\_default\_role) | getindata/database-role/snowflake | 1.1.1 | +| [snowflake\_stage](#module\_snowflake\_stage) | getindata/stage/snowflake | 2.1.1 | +| [this](#module\_this) | cloudposse/label/null | 0.25.0 | ## Outputs -| Name | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| [database](#output\_database) | Database where the schema is deployed to | -| [database\_roles](#output\_database\_roles) | Snowflake Database Roles | -| [name](#output\_name) | Name of the schema | -| [schema\_catalog](#output\_schema\_catalog) | Catalog for the schema | -| [schema\_comment](#output\_schema\_comment) | Comment of the schema | -| [schema\_data\_retention\_time\_in\_days](#output\_schema\_data\_retention\_time\_in\_days) | Data retention time in days for the schema | -| [schema\_database](#output\_schema\_database) | Database where the schema is deployed to | -| [schema\_default\_ddl\_collation](#output\_schema\_default\_ddl\_collation) | Default DDL collation for the schema | -| [schema\_enable\_console\_output](#output\_schema\_enable\_console\_output) | Whether to enable console output for the schema | -| [schema\_external\_volume](#output\_schema\_external\_volume) | External volume for the schema | -| [schema\_is\_transient](#output\_schema\_is\_transient) | Is the schema transient | -| [schema\_log\_level](#output\_schema\_log\_level) | Log level for the schema | -| [schema\_max\_data\_extension\_time\_in\_days](#output\_schema\_max\_data\_extension\_time\_in\_days) | Maximum data extension time in days for the schema | -| [schema\_pipe\_execution\_paused](#output\_schema\_pipe\_execution\_paused) | Whether to pause pipe execution for the schema | -| [schema\_quoted\_identifiers\_ignore\_case](#output\_schema\_quoted\_identifiers\_ignore\_case) | Whether to ignore case for quoted identifiers for the schema | -| [schema\_replace\_invalid\_characters](#output\_schema\_replace\_invalid\_characters) | Whether to replace invalid characters for the schema | -| [schema\_storage\_serialization\_policy](#output\_schema\_storage\_serialization\_policy) | Storage serialization policy for the schema | -| [schema\_suspend\_task\_after\_num\_failures](#output\_schema\_suspend\_task\_after\_num\_failures) | Number of task failures after which to suspend the task for the schema | -| [schema\_task\_auto\_retry\_attempts](#output\_schema\_task\_auto\_retry\_attempts) | Number of task auto retry attempts for the schema | -| [schema\_trace\_level](#output\_schema\_trace\_level) | Trace level for the schema | -| [schema\_user\_task\_managed\_initial\_warehouse\_size](#output\_schema\_user\_task\_managed\_initial\_warehouse\_size) | User task managed initial warehouse size for the schema | -| [schema\_user\_task\_minimum\_trigger\_interval\_in\_seconds](#output\_schema\_user\_task\_minimum\_trigger\_interval\_in\_seconds) | User task minimum trigger interval in seconds for the schema | -| [schema\_user\_task\_timeout\_ms](#output\_schema\_user\_task\_timeout\_ms) | User task timeout in milliseconds for the schema | -| [schema\_with\_managed\_access](#output\_schema\_with\_managed\_access) | Whether the schema has managed access | -| [stages](#output\_stages) | Schema stages | +| Name | Description | +|------|-------------| +| [database](#output\_database) | Database where the schema is deployed to | +| [database\_roles](#output\_database\_roles) | Snowflake Database Roles | +| [name](#output\_name) | Name of the schema | +| [schema\_catalog](#output\_schema\_catalog) | Catalog for the schema | +| [schema\_comment](#output\_schema\_comment) | Comment of the schema | +| [schema\_data\_retention\_time\_in\_days](#output\_schema\_data\_retention\_time\_in\_days) | Data retention time in days for the schema | +| [schema\_database](#output\_schema\_database) | Database where the schema is deployed to | +| [schema\_default\_ddl\_collation](#output\_schema\_default\_ddl\_collation) | Default DDL collation for the schema | +| [schema\_enable\_console\_output](#output\_schema\_enable\_console\_output) | Whether to enable console output for the schema | +| [schema\_external\_volume](#output\_schema\_external\_volume) | External volume for the schema | +| [schema\_is\_transient](#output\_schema\_is\_transient) | Is the schema transient | +| [schema\_log\_level](#output\_schema\_log\_level) | Log level for the schema | +| [schema\_max\_data\_extension\_time\_in\_days](#output\_schema\_max\_data\_extension\_time\_in\_days) | Maximum data extension time in days for the schema | +| [schema\_pipe\_execution\_paused](#output\_schema\_pipe\_execution\_paused) | Whether to pause pipe execution for the schema | +| [schema\_quoted\_identifiers\_ignore\_case](#output\_schema\_quoted\_identifiers\_ignore\_case) | Whether to ignore case for quoted identifiers for the schema | +| [schema\_replace\_invalid\_characters](#output\_schema\_replace\_invalid\_characters) | Whether to replace invalid characters for the schema | +| [schema\_storage\_serialization\_policy](#output\_schema\_storage\_serialization\_policy) | Storage serialization policy for the schema | +| [schema\_suspend\_task\_after\_num\_failures](#output\_schema\_suspend\_task\_after\_num\_failures) | Number of task failures after which to suspend the task for the schema | +| [schema\_task\_auto\_retry\_attempts](#output\_schema\_task\_auto\_retry\_attempts) | Number of task auto retry attempts for the schema | +| [schema\_trace\_level](#output\_schema\_trace\_level) | Trace level for the schema | +| [schema\_user\_task\_managed\_initial\_warehouse\_size](#output\_schema\_user\_task\_managed\_initial\_warehouse\_size) | User task managed initial warehouse size for the schema | +| [schema\_user\_task\_minimum\_trigger\_interval\_in\_seconds](#output\_schema\_user\_task\_minimum\_trigger\_interval\_in\_seconds) | User task minimum trigger interval in seconds for the schema | +| [schema\_user\_task\_timeout\_ms](#output\_schema\_user\_task\_timeout\_ms) | User task timeout in milliseconds for the schema | +| [schema\_with\_managed\_access](#output\_schema\_with\_managed\_access) | Whether the schema has managed access | +| [stages](#output\_stages) | Schema stages | ## Providers -| Name | Version | -| ------------------------------------------------------------------- | ------- | +| Name | Version | +|------|---------| | [snowflake](#provider\_snowflake) | ~> 0.94 | ## Requirements -| Name | Version | -| ------------------------------------------------------------------------- | ------- | -| [terraform](#requirement\_terraform) | >= 1.3 | +| Name | Version | +|------|---------| +| [terraform](#requirement\_terraform) | >= 1.3 | | [snowflake](#requirement\_snowflake) | ~> 0.94 | ## Resources -| Name | Type | -| ---------------------------------------------------------------------------------------------------------------------- | -------- | +| Name | Type | +|------|------| | [snowflake_schema.this](https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/schema) | resource |