terraform-provider-snowflake

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

README

Terraform Provider

Requirements

  • Terraform 0.10.x
  • Go 1.8 (to build the provider plugin)

Building The Provider

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-$PROVIDER_NAME

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone git@github.com:terraform-providers/terraform-provider-$PROVIDER_NAME

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-$PROVIDER_NAME
$ make build

Using the provider

Fill in for each provider

go get github.com/snowflakedb/gosnowflake

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.8+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-$PROVIDER_NAME
...

Provider Configuration

Firstly, to use the provider you will need to create a user within Snowflake that can execute the resource requests made by Terraform

Account type defaults to standard, but can be either standard or enterprise.

$ export SF_USER
$ export SF_PASSWORD
$ export SF_REGION
$ export SF_ACCOUNT
$ export SF_ACCOUNT_TYPE
Snowflake Warehouse Management
resource "snowflake_warehouse" "warehouse_terraform" {
      name              =   "dev_wh"
      warehouse_size    =   "SMALL"
      auto_resume       =   false
      auto_suspend      =   600
      comment           =   "terraform development warehouse"
}
Properties
Property Description Type Required
name Name of the Snowflake warehouse String TRUE
max_concurrency_level Max concurrent SQL statements that can run on warehouse String FALSE
statement_queued_timeout_in_seconds Time, in seconds, an SQL statement can be queued before being cancelled String FALSE
statement_timeout_in_seconds Time, in seconds, after which an SQL statement will be terminated String FALSE
warehouse_size Size of the warehouse String FALSE
max_cluster_count Max number of warehouses String FALSE
min_cluster_count Min number of warehouses String FALSE
auto_resume Should warehouse should auto resume Boolean FALSE
auto_suspend Should warehouse should auto suspend Boolean FALSE
initially_suspended Should warehouse start off suspended Boolean FALSE
resource_monitor Name of resource monitor assigned to warehouse Boolean FALSE
comment Additional comments String FALSE
Snowflake Database Management
resource "snowflake_database" "database_terraform" {
      name              =   "dev_db"
      comment           =   "terraform development database"
}
Properties
Property Description Type Required
name Name of the Snowflake database String TRUE
comment Additional comments String FALSE
Snowflake User Management
resource "snowflake_user" "tf_test_user" {
  user = "terraform.test"
  host = "mydomain.org"
  plaintext_password = "12345QWERTYqwerty"
  default_role = "READONLY"
}
Properties
Property Description Type Required
user The username of the user String TRUE
host Host/TLD associated with the user. The default for this is localhost. This has a direct effect on the Username String FALSE
plaintext_password Password of the user. Ensure that passwords conform to the complexity requirements by Snowflake String TRUE
default_role Default role the user assumes. Defaults to null String FALSE

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL