{"id":21514832,"url":"https://github.com/getindata/terraform-snowflake-warehouse","last_synced_at":"2026-02-14T17:03:14.542Z","repository":{"id":137896402,"uuid":"572081553","full_name":"getindata/terraform-snowflake-warehouse","owner":"getindata","description":"Terraform module for Snowflake Warehouse management","archived":false,"fork":false,"pushed_at":"2025-01-27T18:52:30.000Z","size":87,"stargazers_count":3,"open_issues_count":7,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-09T20:11:21.455Z","etag":null,"topics":["module","snowflake","snowflakedb","terraform"],"latest_commit_sha":null,"homepage":"","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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-29T14:13:13.000Z","updated_at":"2025-02-28T01:49:30.000Z","dependencies_parsed_at":"2023-10-16T19:33:40.519Z","dependency_job_id":"18f817f0-613b-4e95-951a-75f61d45e023","html_url":"https://github.com/getindata/terraform-snowflake-warehouse","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":"getindata/terraform-module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-warehouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-warehouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-warehouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getindata%2Fterraform-snowflake-warehouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getindata","download_url":"https://codeload.github.com/getindata/terraform-snowflake-warehouse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["module","snowflake","snowflakedb","terraform"],"created_at":"2024-11-23T23:53:08.604Z","updated_at":"2026-02-14T17:03:14.537Z","avatar_url":"https://github.com/getindata.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform Snowflake Warehouse\n\n\u003c!--- Pick Cloud provider Badge --\u003e\n\u003c!---![Azure](https://img.shields.io/badge/azure-%230072C6.svg?style=for-the-badge\u0026logo=microsoftazure\u0026logoColor=white) --\u003e\n\u003c!---![Google Cloud](https://img.shields.io/badge/GoogleCloud-%234285F4.svg?style=for-the-badge\u0026logo=google-cloud\u0026logoColor=white) --\u003e\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\u003c!--- Replace repository name --\u003e\n![License](https://badgen.net/github/license/getindata/terraform-snowflake-warehouse/)\n![Release](https://badgen.net/github/release/getindata/terraform-snowflake-warehouse/)\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 Warehouse management\n\n- Creates Snowflake Warehouse\n- Can create custom Snowflake Roles with role-to-role, role-to-user assignments\n- Can create a set of default, functional roles to simplify access management:\n  - `ADMIN` - full access\n  - `MONITOR` - abillity to monitor warehouse\n  - `USAGE` - abillity to use warehouse\n\n## USAGE\n\n```terraform\nmodule \"terraform_snowflake_warehouse\" {\n  source  = \"getindata/warehouse/snowflake\"\n  context = module.this.context\n\n  name    = \"warehouse\"\n  comment = \"My Warehouse\"\n\n  warehouse_size = \"x-small\"\n\n  auto_resume         = true\n  auto_suspend        = 600\n  initially_suspended = true\n\n  create_default_roles = true\n\n  roles = {\n    admin = {\n      granted_to_roles = [\"SYSADMIN\"]\n    }\n  }\n}\n\n```\n\n## NOTES\n\nWhen upgrading to version `v2.2.x` - all `default_roles` will be recreated using new terraform resources.\n\n## EXAMPLES\n\n- [Simple](examples/simple)\n- [Complete](examples/complete)\n\n## Breaking changes in v3.x of the module\n\nDue to replacement of nulllabel (`context.tf`) with context provider, some **breaking changes** were introduced in `v3.0.0` version of this module.\n\nList od code and variable (API) changes:\n\n- Removed `context.tf` file (a single-file module with additonal variables), which implied a removal of all its variables (except `name`):\n  - `descriptor_formats`\n  - `label_value_case`\n  - `label_key_case`\n  - `id_length_limit`\n  - `regex_replace_chars`\n  - `label_order`\n  - `additional_tag_map`\n  - `tags`\n  - `labels_as_tags`\n  - `attributes`\n  - `delimiter`\n  - `stage`\n  - `environment`\n  - `tenant`\n  - `namespace`\n  - `enabled`\n  - `context`\n- Remove support `enabled` flag - that might cause some backward compatibility issues with terraform state (please take into account that proper `move` clauses were added to minimize the impact), but proceed with caution\n- Additional `context` provider configuration\n- New variables were added, to allow naming configuration via `context` provider:\n  - `context_templates`\n  - `name_schema`\n\n## Breaking changes in v4.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\u003c!-- BEGIN_TF_DOCS --\u003e\n\n\n\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_auto_resume\"\u003e\u003c/a\u003e [auto\\_resume](#input\\_auto\\_resume) | Specifies whether to automatically resume a warehouse when a SQL statement (e.g. query) is submitted to it. | `bool` | `true` | no |\n| \u003ca name=\"input_auto_suspend\"\u003e\u003c/a\u003e [auto\\_suspend](#input\\_auto\\_suspend) | Specifies the number of seconds of inactivity after which a warehouse is automatically suspended. | `number` | `null` | no |\n| \u003ca name=\"input_comment\"\u003e\u003c/a\u003e [comment](#input\\_comment) | Warehouse comment/description. | `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_enable_query_acceleration\"\u003e\u003c/a\u003e [enable\\_query\\_acceleration](#input\\_enable\\_query\\_acceleration) | Specifies whether to enable the query acceleration service for queries that rely on this warehouse for compute resources. | `bool` | `true` | no |\n| \u003ca name=\"input_generation\"\u003e\u003c/a\u003e [generation](#input\\_generation) | Specifies the generation for the warehouse. Only available for standard warehouses. Valid values are: 1, 2, docs: \u003chttps://docs.snowflake.com/en/user-guide/warehouses-gen2\u003e. | `string` | `null` | no |\n| \u003ca name=\"input_initially_suspended\"\u003e\u003c/a\u003e [initially\\_suspended](#input\\_initially\\_suspended) | Specifies whether the warehouse is created initially in the ‘Suspended’ state. | `bool` | `true` | no |\n| \u003ca name=\"input_max_cluster_count\"\u003e\u003c/a\u003e [max\\_cluster\\_count](#input\\_max\\_cluster\\_count) | Specifies the maximum number of server clusters for the warehouse. | `number` | `1` | no |\n| \u003ca name=\"input_max_concurrency_level\"\u003e\u003c/a\u003e [max\\_concurrency\\_level](#input\\_max\\_concurrency\\_level) | Object parameter that specifies the concurrency level for SQL statements (i.e. queries and DML) executed by a warehouse. | `number` | `null` | no |\n| \u003ca name=\"input_min_cluster_count\"\u003e\u003c/a\u003e [min\\_cluster\\_count](#input\\_min\\_cluster\\_count) | Specifies the minimum number of server clusters for the warehouse (only applies to multi-cluster warehouses). | `number` | `1` | 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-warehouse\")\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_query_acceleration_max_scale_factor\"\u003e\u003c/a\u003e [query\\_acceleration\\_max\\_scale\\_factor](#input\\_query\\_acceleration\\_max\\_scale\\_factor) | Specifies the maximum scale factor for leasing compute resources for query acceleration. The scale factor is used as a multiplier based on warehouse size. | `number` | `null` | no |\n| \u003ca name=\"input_resource_monitor\"\u003e\u003c/a\u003e [resource\\_monitor](#input\\_resource\\_monitor) | Specifies the name of a resource monitor that is explicitly assigned to the warehouse. | `string` | `null` | no |\n| \u003ca name=\"input_roles\"\u003e\u003c/a\u003e [roles](#input\\_roles) | Account roles created on the warehouse 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    warehouse_grants = optional(object({\u003cbr/\u003e      all_privileges    = optional(bool)\u003cbr/\u003e      with_grant_option = optional(bool, false)\u003cbr/\u003e      privileges        = optional(list(string))\u003cbr/\u003e    }))\u003cbr/\u003e  }))\u003c/pre\u003e | `{}` | no |\n| \u003ca name=\"input_scaling_policy\"\u003e\u003c/a\u003e [scaling\\_policy](#input\\_scaling\\_policy) | Specifies the policy for automatically starting and shutting down clusters in a multi-cluster warehouse running in Auto-scale mode. Valid values are `STANDARD` and `ECONOMY`. | `string` | `null` | no |\n| \u003ca name=\"input_statement_queued_timeout_in_seconds\"\u003e\u003c/a\u003e [statement\\_queued\\_timeout\\_in\\_seconds](#input\\_statement\\_queued\\_timeout\\_in\\_seconds) | Object parameter that specifies the time, in seconds, a SQL statement (query, DDL, DML, etc.) can be queued on a warehouse before it is canceled by the system. | `number` | `null` | no |\n| \u003ca name=\"input_statement_timeout_in_seconds\"\u003e\u003c/a\u003e [statement\\_timeout\\_in\\_seconds](#input\\_statement\\_timeout\\_in\\_seconds) | Specifies the time, in seconds, after which a running SQL statement (query, DDL, DML, etc.) is canceled by the system | `number` | `null` | no |\n| \u003ca name=\"input_warehouse_size\"\u003e\u003c/a\u003e [warehouse\\_size](#input\\_warehouse\\_size) | Specifies the size of the virtual warehouse. Possible values are: XSMALL, X-SMALL, SMALL, MEDIUM, LARGE, XLARGE, X-LARGE, XXLARGE, X2LARGE, 2X-LARGE, XXXLARGE, X3LARGE, 3X-LARGE, X4LARGE, 4X-LARGE, X5LARGE, 5X-LARGE, X6LARGE, 6X-LARGE. | `string` | `\"X-Small\"` | no |\n| \u003ca name=\"input_warehouse_type\"\u003e\u003c/a\u003e [warehouse\\_type](#input\\_warehouse\\_type) | Specifies the type of the virtual warehouse. | `string` | `\"STANDARD\"` | 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_roles\"\u003e\u003c/a\u003e [roles](#output\\_roles) | Access roles created for warehouse |\n| \u003ca name=\"output_warehouse\"\u003e\u003c/a\u003e [warehouse](#output\\_warehouse) | Details of the warehouse |\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= 2.7 |\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= 2.7 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [snowflake_warehouse.this](https://registry.terraform.io/providers/snowflakedb/snowflake/latest/docs/resources/warehouse) | 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/REPO_NAME/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=getindata/terraform-snowflake-warehouse\" /\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-warehouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetindata%2Fterraform-snowflake-warehouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetindata%2Fterraform-snowflake-warehouse/lists"}