Skip to content

automata-tech/terraform-infostrux-snowflake-database

 
 

Repository files navigation

Snowflake Database Terraform Module

Quickly deploy Snowflake Database resources and attach Grants using a Terraform Module.

Usage## Usage

Simple usage:

module "database" {
  source = "Infostrux-Solutions/database/snowflake"

  name    = "DATABASE_NAME"
  comment = "Created by Terraform"

}

Full usage:

module "database" {
  source = "Infostrux-Solutions/database/snowflake"

  name = "DATABASE_NAME"

  attach_grant_usage      = true
  usage_roles             = ["SYSADMIN"]
  usage_shares            = []
  usage_with_grant_option = true

  attach_grant_modify      = true
  modify_roles             = ["SYSADMIN"]
  modify_shares            = []
  modify_with_grant_option = true

  attach_grant_create_schema      = true
  create_schema_roles             = ["SYSADMIN"]
  create_schema_shares            = []
  create_schema_with_grant_option = true

  attach_grant_monitor      = true
  monitor_roles             = ["SYSADMIN"]
  monitor_shares            = []
  monitor_with_grant_option = true

  data_retention_time_in_days = 1
}

Requirements

Name Version
terraform >= 0.13.1
snowflake >=0.40.0

Providers

Name Version
snowflake >=0.40.0

Modules

No modules.

Resources

Name Type
snowflake_database.database resource
snowflake_database_grant.grant_create_schema resource
snowflake_database_grant.grant_modify resource
snowflake_database_grant.grant_monitor resource
snowflake_database_grant.grant_usage resource

Inputs

Name Description Type Default Required
attach_grant_create_schema Create the grant create_schema at the same time. (true|false) bool false no
attach_grant_modify Create the grant modify at the same time. (true|false) bool false no
attach_grant_monitor Create the grant monitor at the same time. (true|false) bool false no
attach_grant_usage Create the grant usage at the same time. (true|false) bool false no
comment A comment to add to the database resource. string "Created by Terraform." no
create_schema_roles A list of roles that will be granted create_schema on the database. list(string) [] no
create_schema_shares A list of roles that will be granted create_schema on the database shares. list(string) [] no
create_schema_with_grant_option When this is set to true, allows the recipient role to grant the privileges to other roles. bool false no
data_retention_time_in_days Days to retain deleted data for. Default is 1 string 1 no
modify_roles A list of roles that will be granted modify on the database. list(string) [] no
modify_shares A list of roles that will be granted modify on the database shares. list(string) [] no
modify_with_grant_option When this is set to true, allows the recipient role to grant the privileges to other roles. bool false no
monitor_roles A list of roles that will be granted monitor on the database. list(string) [] no
monitor_shares A list of roles that will be granted monitor on the database shares. list(string) [] no
monitor_with_grant_option When this is set to true, allows the recipient role to grant the privileges to other roles. bool false no
name The name to apply to the database resource. string n/a yes
usage_roles A list of roles that will be granted usage on the database. list(string) [] no
usage_shares A list of roles that will be granted usage on the database shares. list(string) [] no
usage_with_grant_option When this is set to true, allows the recipient role to grant the privileges to other roles. bool false no

Outputs

Name Description
database_id The database resource ID.
database_name The database resource name.

Authors

Module is maintained by Infostrux Solutions with help from these awesome contributors.

License

Apache 2 Licensed. See LICENSE for full details.

About

Open Source Snowflake Terraform Module for Database Object Implementation, also in the terraform registry, https://registry.terraform.io/modules/Infostrux-Solutions/database/snowflake/latest

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 100.0%