{"id":21514829,"url":"https://github.com/getindata/terraform-snowflake-shared-database","last_synced_at":"2026-03-19T20:41:49.725Z","repository":{"id":261430137,"uuid":"858717959","full_name":"getindata/terraform-snowflake-shared-database","owner":"getindata","description":"Terraform module for managing Shared Databases in Snowflake ","archived":false,"fork":false,"pushed_at":"2025-02-18T15:53:44.000Z","size":79,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-18T16:33:33.305Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getindata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-17T12:15:36.000Z","updated_at":"2025-02-18T15:36:35.000Z","dependencies_parsed_at":"2024-11-06T14:41:08.096Z","dependency_job_id":"7873a9a3-9936-4cfa-b48d-2d30a798f7fe","html_url":"https://github.com/getindata/terraform-snowflake-shared-database","commit_stats":null,"previous_names":["getindata/terraform-snowflake-shared-database"],"tags_count":6,"template":false,"template_full_name":"getindata/terraform-module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-shared-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-shared-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-shared-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-shared-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getindata","download_url":"https://codeload.github.com/getindata/terraform-snowflake-shared-database/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244066190,"owners_count":20392407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T23:53:07.811Z","updated_at":"2026-01-03T16:50:42.906Z","avatar_url":"https://github.com/getindata.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snowflake Database Terraform Module\n![Snowflake](https://img.shields.io/badge/-SNOWFLAKE-249edc?style=for-the-badge\u0026logo=snowflake\u0026logoColor=white)\n![Terraform](https://img.shields.io/badge/terraform-%235835CC.svg?style=for-the-badge\u0026logo=terraform\u0026logoColor=white)\n\n![License](https://badgen.net/github/license/getindata/terraform-snowflake-shared-database/)\n![Release](https://badgen.net/github/release/getindata/terraform-snowflake-shared-database/)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg height=\"150\" src=\"https://getindata.com/img/logo.svg\"\u003e\n  \u003ch3 align=\"center\"\u003eWe help companies turn their data into assets\u003c/h3\u003e\n\u003c/p\u003e\n\n---\n\nTerraform module for Snowflake Shared Database management.\n\n* Creates Snowflake Shared database\n* Can create custom Snowflake account roles with role-to-role assignments\n* Can create a set of default account roles to simplify access management:\n  * `READONLY` - granted `IMPORTED_PRIVILEGES` privilege on the database\n\n## Breaking changes in v2.x of the module\n\n- Due to rename of Snowflake terraform provider source, all `versions.tf` files were updated accordingly.\n\n  Please keep in mind to mirror this change in your own repos also.\n\n  For more information about provider rename, refer to [Snowflake documentation](https://github.com/snowflakedb/terraform-provider-snowflake/blob/main/SNOWFLAKEDB_MIGRATION.md).\n\n## USAGE\n\n```terraform\nmodule \"snowflake_shared_database\" {\n  source = \"getindata/shared-database/snowflake\"\n  # version  = \"x.x.x\"\n\n  name       = \"SHARED_DATABASE\"\n  from_share = \"\u003corgname.accountname.sharename\u003e\"\n\n  create_default_roles = true\n}\n\n```\n\n## EXAMPLES\n\n- [Simple](examples/simple) - Basic usage of the module\n- [Complete](examples/complete) - Advanced usage of the module\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n\n\n\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_catalog\"\u003e\u003c/a\u003e [catalog](#input\\_catalog) | The database parameter that specifies the default catalog to use for Iceberg tables | `string` | `null` | no |\n| \u003ca name=\"input_comment\"\u003e\u003c/a\u003e [comment](#input\\_comment) | Specifies a comment for the database | `string` | `null` | no |\n| \u003ca name=\"input_context_templates\"\u003e\u003c/a\u003e [context\\_templates](#input\\_context\\_templates) | Map of context templates used for naming conventions - this variable supersedes `naming_scheme.properties` and `naming_scheme.delimiter` configuration | `map(string)` | `{}` | no |\n| \u003ca name=\"input_create_default_roles\"\u003e\u003c/a\u003e [create\\_default\\_roles](#input\\_create\\_default\\_roles) | Whether the default roles should be created | `bool` | `false` | no |\n| \u003ca name=\"input_default_ddl_collation\"\u003e\u003c/a\u003e [default\\_ddl\\_collation](#input\\_default\\_ddl\\_collation) | Specifies a default collation specification for all schemas and tables added to the database. | `string` | `null` | no |\n| \u003ca name=\"input_enable_console_output\"\u003e\u003c/a\u003e [enable\\_console\\_output](#input\\_enable\\_console\\_output) | If true, enables stdout/stderr fast path logging for anonymous stored procedures | `bool` | `null` | no |\n| \u003ca name=\"input_external_volume\"\u003e\u003c/a\u003e [external\\_volume](#input\\_external\\_volume) | The database parameter that specifies the default external volume to use for Iceberg tables | `string` | `null` | no |\n| \u003ca name=\"input_from_share\"\u003e\u003c/a\u003e [from\\_share](#input\\_from\\_share) | A fully qualified path to a share from which the database will be created. A fully qualified path follows the format of `\u003corganization_name\u003e.\u003caccount_name\u003e.\u003cshare_name\u003e` | `string` | n/a | yes |\n| \u003ca name=\"input_log_level\"\u003e\u003c/a\u003e [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] | `string` | `null` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | Name of the resource | `string` | n/a | yes |\n| \u003ca name=\"input_name_scheme\"\u003e\u003c/a\u003e [name\\_scheme](#input\\_name\\_scheme) | Naming scheme configuration for the resource. This configuration is used to generate names using context provider:\u003cbr/\u003e    - `properties` - list of properties to use when creating the name - is superseded by `var.context_templates`\u003cbr/\u003e    - `delimiter` - delimited used to create the name from `properties` - is superseded by `var.context_templates`\u003cbr/\u003e    - `context_template_name` - name of the context template used to create the name\u003cbr/\u003e    - `replace_chars_regex` - regex to use for replacing characters in property-values created by the provider - any characters that match the regex will be removed from the name\u003cbr/\u003e    - `extra_values` - map of extra label-value pairs, used to create a name\u003cbr/\u003e    - `uppercase` - convert name to uppercase | \u003cpre\u003eobject({\u003cbr/\u003e    properties            = optional(list(string), [\"environment\", \"name\"])\u003cbr/\u003e    delimiter             = optional(string, \"_\")\u003cbr/\u003e    context_template_name = optional(string, \"snowflake-shared-database\")\u003cbr/\u003e    replace_chars_regex   = optional(string, \"[^a-zA-Z0-9_]\")\u003cbr/\u003e    extra_values          = optional(map(string))\u003cbr/\u003e    uppercase             = optional(bool, true)\u003cbr/\u003e  })\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_quoted_identifiers_ignore_case\"\u003e\u003c/a\u003e [quoted\\_identifiers\\_ignore\\_case](#input\\_quoted\\_identifiers\\_ignore\\_case) | If true, the case of quoted identifiers is ignored | `bool` | `null` | no |\n| \u003ca name=\"input_replace_invalid_characters\"\u003e\u003c/a\u003e [replace\\_invalid\\_characters](#input\\_replace\\_invalid\\_characters) | If true, invalid characters are replaced with the replacement character | `bool` | `null` | no |\n| \u003ca name=\"input_roles\"\u003e\u003c/a\u003e [roles](#input\\_roles) | Account roles created on the Shared Database level | \u003cpre\u003emap(object({\u003cbr/\u003e    name_scheme = optional(object({\u003cbr/\u003e      properties            = optional(list(string))\u003cbr/\u003e      delimiter             = optional(string)\u003cbr/\u003e      context_template_name = optional(string)\u003cbr/\u003e      replace_chars_regex   = optional(string)\u003cbr/\u003e      extra_labels          = optional(map(string))\u003cbr/\u003e      uppercase             = optional(bool)\u003cbr/\u003e    }))\u003cbr/\u003e    comment              = optional(string)\u003cbr/\u003e    role_ownership_grant = optional(string)\u003cbr/\u003e    granted_roles        = optional(list(string))\u003cbr/\u003e    granted_to_roles     = optional(list(string))\u003cbr/\u003e    granted_to_users     = optional(list(string))\u003cbr/\u003e    database_grants = optional(object({\u003cbr/\u003e      privileges = optional(list(string))\u003cbr/\u003e    }))\u003cbr/\u003e  }))\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_storage_serialization_policy\"\u003e\u003c/a\u003e [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 |\n| \u003ca name=\"input_suspend_task_after_num_failures\"\u003e\u003c/a\u003e [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 |\n| \u003ca name=\"input_task_auto_retry_attempts\"\u003e\u003c/a\u003e [task\\_auto\\_retry\\_attempts](#input\\_task\\_auto\\_retry\\_attempts) | Maximum automatic retries allowed for a user task | `number` | `null` | no |\n| \u003ca name=\"input_trace_level\"\u003e\u003c/a\u003e [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 |\n| \u003ca name=\"input_user_task_managed_initial_warehouse_size\"\u003e\u003c/a\u003e [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 |\n| \u003ca name=\"input_user_task_minimum_trigger_interval_in_seconds\"\u003e\u003c/a\u003e [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 |\n| \u003ca name=\"input_user_task_timeout_ms\"\u003e\u003c/a\u003e [user\\_task\\_timeout\\_ms](#input\\_user\\_task\\_timeout\\_ms) | User task execution timeout in milliseconds | `number` | `null` | no |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_roles_deep_merge\"\u003e\u003c/a\u003e [roles\\_deep\\_merge](#module\\_roles\\_deep\\_merge) | Invicton-Labs/deepmerge/null | 0.1.5 |\n| \u003ca name=\"module_snowflake_custom_role\"\u003e\u003c/a\u003e [snowflake\\_custom\\_role](#module\\_snowflake\\_custom\\_role) | getindata/role/snowflake | 4.0.0 |\n| \u003ca name=\"module_snowflake_default_role\"\u003e\u003c/a\u003e [snowflake\\_default\\_role](#module\\_snowflake\\_default\\_role) | getindata/role/snowflake | 4.0.0 |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_catalog\"\u003e\u003c/a\u003e [catalog](#output\\_catalog) | The database parameter that specifies the default catalog to use for Iceberg tables |\n| \u003ca name=\"output_comment\"\u003e\u003c/a\u003e [comment](#output\\_comment) | The comment for the database |\n| \u003ca name=\"output_default_ddl_collation\"\u003e\u003c/a\u003e [default\\_ddl\\_collation](#output\\_default\\_ddl\\_collation) | Specifies a default collation specification for all schemas and tables added to the database. |\n| \u003ca name=\"output_enable_console_output\"\u003e\u003c/a\u003e [enable\\_console\\_output](#output\\_enable\\_console\\_output) | If true, enables stdout/stderr fast path logging for anonymous stored procedures |\n| \u003ca name=\"output_external_volume\"\u003e\u003c/a\u003e [external\\_volume](#output\\_external\\_volume) | The database parameter that specifies the default external volume to use for Iceberg tables |\n| \u003ca name=\"output_from_share\"\u003e\u003c/a\u003e [from\\_share](#output\\_from\\_share) | The name of the share from which the database is created |\n| \u003ca name=\"output_log_level\"\u003e\u003c/a\u003e [log\\_level](#output\\_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] |\n| \u003ca name=\"output_name\"\u003e\u003c/a\u003e [name](#output\\_name) | Name of the database |\n| \u003ca name=\"output_quoted_identifiers_ignore_case\"\u003e\u003c/a\u003e [quoted\\_identifiers\\_ignore\\_case](#output\\_quoted\\_identifiers\\_ignore\\_case) | If true, the case of quoted identifiers is ignored |\n| \u003ca name=\"output_roles\"\u003e\u003c/a\u003e [roles](#output\\_roles) | Snowflake Roles |\n| \u003ca name=\"output_storage_serialization_policy\"\u003e\u003c/a\u003e [storage\\_serialization\\_policy](#output\\_storage\\_serialization\\_policy) | The storage serialization policy for Iceberg tables that use Snowflake as the catalog. Valid options are: [COMPATIBLE OPTIMIZED] |\n| \u003ca name=\"output_suspend_task_after_num_failures\"\u003e\u003c/a\u003e [suspend\\_task\\_after\\_num\\_failures](#output\\_suspend\\_task\\_after\\_num\\_failures) | How many times a task must fail in a row before it is automatically suspended. 0 disables auto-suspending |\n| \u003ca name=\"output_task_auto_retry_attempts\"\u003e\u003c/a\u003e [task\\_auto\\_retry\\_attempts](#output\\_task\\_auto\\_retry\\_attempts) | Maximum automatic retries allowed for a user task |\n| \u003ca name=\"output_trace_level\"\u003e\u003c/a\u003e [trace\\_level](#output\\_trace\\_level) | Controls how trace events are ingested into the event table. Valid options are: [ALWAYS ON\\_EVENT OFF] |\n| \u003ca name=\"output_user_task_managed_initial_warehouse_size\"\u003e\u003c/a\u003e [user\\_task\\_managed\\_initial\\_warehouse\\_size](#output\\_user\\_task\\_managed\\_initial\\_warehouse\\_size) | The initial size of warehouse to use for managed warehouses in the absence of history |\n| \u003ca name=\"output_user_task_minimum_trigger_interval_in_seconds\"\u003e\u003c/a\u003e [user\\_task\\_minimum\\_trigger\\_interval\\_in\\_seconds](#output\\_user\\_task\\_minimum\\_trigger\\_interval\\_in\\_seconds) | Minimum amount of time between Triggered Task executions in seconds |\n| \u003ca name=\"output_user_task_timeout_ms\"\u003e\u003c/a\u003e [user\\_task\\_timeout\\_ms](#output\\_user\\_task\\_timeout\\_ms) | User task execution timeout in milliseconds |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_context\"\u003e\u003c/a\u003e [context](#provider\\_context) | \u003e=0.4.0 |\n| \u003ca name=\"provider_snowflake\"\u003e\u003c/a\u003e [snowflake](#provider\\_snowflake) | \u003e= 0.94.0 |\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.3 |\n| \u003ca name=\"requirement_context\"\u003e\u003c/a\u003e [context](#requirement\\_context) | \u003e=0.4.0 |\n| \u003ca name=\"requirement_snowflake\"\u003e\u003c/a\u003e [snowflake](#requirement\\_snowflake) | \u003e= 0.94.0 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [snowflake_shared_database.this](https://registry.terraform.io/providers/snowflakedb/snowflake/latest/docs/resources/shared_database) | resource |\n| [context_label.this](https://registry.terraform.io/providers/cloudposse/context/latest/docs/data-sources/label) | data source |\n\u003c!-- END_TF_DOCS --\u003e\n\n## CONTRIBUTING\n\nContributions are very welcomed!\n\nStart by reviewing [contribution guide](CONTRIBUTING.md) and our [code of conduct](CODE_OF_CONDUCT.md). After that, start coding and ship your changes by creating a new PR.\n\n## LICENSE\n\nApache 2 Licensed. See [LICENSE](LICENSE) for full details.\n\n## AUTHORS\n\n\u003c!--- Replace repository name --\u003e\n\u003ca href=\"https://github.com/getindata/terraform-snowflake-shared-database/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=getindata/terraform-snowflake-shared-database\" /\u003e\n\u003c/a\u003e\n\nMade with [contrib.rocks](https://contrib.rocks).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetindata%2Fterraform-snowflake-shared-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetindata%2Fterraform-snowflake-shared-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetindata%2Fterraform-snowflake-shared-database/lists"}