Skip to content

g2crowd/terraform-snowflake-target

 
 

Repository files navigation

Release CI License Registry

terraform-snowflake-target

A Terraform module for configuring a base Snowflake Target integration for use with Snowplow systems.

Usage

Applying module directly

  1. Fill variables in terraform.tfvars.tmpl and copy it to terraform.tfvars.
  2. Using environment variables for authentication as described in here. Fill the template in snowflake_provider_vars.sh and run source ./snowflake_provider_vars.sh to set up your local environment.
  3. Run terraform init
  4. Run terraform apply

Using the module from another module

Pass authentication parameters directly to Snowflake provider.

provider "snowflake" {
  username         = "my_user"
  account          = "my_account"
  region           = "us-west-2"
  role             = "ACCOUNTADMIN"
  private_key_path = "/path/to/private/key"
}

module "snowflake_target" {
  source = "snowplow-devops/target/snowflake"
   
  name               = "snowplow"
  snowflake_password = "exampleP@ssword1"
}

Requirements

Name Version
terraform >= 1.0.0
snowflake 0.25.32

Providers

Name Version
snowflake 0.25.32

Modules

No modules.

Resources

Name Type
snowflake_database.loader resource
snowflake_file_format.enriched resource
snowflake_schema.atomic resource
snowflake_table.events resource
snowflake_user.loader resource

Inputs

Name Description Type Default Required
name A name which will be prepended to the created resources string n/a yes
snowflake_password The password to use to connect to the database string n/a yes
is_create_database Should database be created. Set to false, to use an existing one bool true no
override_snowflake_database Override database name. If not set it will be defaulted to uppercase var.name with "_DATABASE" suffix string "" no
override_snowflake_user Override snowflake user string "" no
snowflake_file_format_name Name of the Snowflake file format which is used by stage string "SNOWPLOW_ENRICHED_JSON" no
snowflake_schema Schema name for snowplow data. Defaults to ATOMIC. string "ATOMIC" no

Outputs

Name Description
snowflake_database Snowflake database name
snowflake_event_table Snowflake event table name
snowflake_file_format Snowflake file format
snowflake_password Password for snowflake_user
snowflake_schema Snowflake schema name
snowflake_user Snowflake username

Copyright and license

The Terraform Snowflake Target project is Copyright 2022-2022 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 98.9%
  • Shell 1.1%