Skip to content
Projects

snowflakedb/terraform-provider-snowflake

View on GitHub

About

Terraform provider for managing Snowflake accounts

Systems & Infrastructure

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
+2
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Snowflake Terraform Provider

Unit tests Latest release Terraform Registry License

The Snowflake provider for Terraform manages Snowflake objects (databases, warehouses, users, roles, grants, and more) through Snowflake SQL.

Important documents: Registry docs | Tutorial | Authentication | FAQ | Known issues | Migration guide | BCR migration guide | Roadmap | Release notes | Contributing

The provider is generally available. Some resources and data sources are still preview: they are disabled by default, may change without a major version bump, and are not officially supported. Enable them with preview_features_enabled in the provider configuration. See the preview resources and preview data sources lists. experimental_features_enabled changes behavior of existing resources; it is also a preview feature.

⚠️ Please note: If you believe you have found a security issue, please responsibly disclose by contacting us at [email protected]. Do not open a public GitHub issue.

Support

For official support and urgent, production-impacting issues, please contact Snowflake Support.

⚠️ Keep in mind that the official support starts with the v2.0.0 for stable resources and data sources only. All previous versions, preview resources and data sources, and experimental behaviors are not officially supported.

Please follow creating issues guidelines, FAQ, and known issues before submitting an issue on GitHub or directly to Snowflake Support.

We welcome contributions. See CONTRIBUTING.md before opening a PR.

Table of contents

Requirements

  • Terraform CLI 1.1.5 or later (known issues)
  • Provider v2.0.0 or later for official support of stable resources; prefer the latest 2.x release
  • A Snowflake account and a user/role that can create the objects you want to manage. The introductory tutorial shows how to set up a service user and role.
  • OpenTofu is not supported. The provider is listed in the OpenTofu Registry, but compatibility is untested. See the FAQ.

Supported Architectures

Official binaries follow what the gosnowflake driver supports and what HashiCorp recommends for Terraform providers:

  • Windows: amd64
  • Linux: amd64 and arm64
  • Darwin: amd64 and arm64

These binaries are also published but are not officially supported (fixes are not prioritized):

  • Windows: arm64 and 386
  • Linux: 386
  • Darwin: 386
  • Freebsd: any architecture

Getting started

The Registry source is snowflakedb/snowflake.

The example below uses key-pair (JWT) authentication, which is only one of the authentication methods this provider supports, see the Authentication Methods guide. Keep keys and other secrets out of version control (use file(), environment variables, or a ~/.snowflake/config profile).

terraform {
  required_providers {
    snowflake = {
      source  = "snowflakedb/snowflake"
      version = "~> 2.20"
    }
  }
}

provider "snowflake" {
  organization_name = "<organization_name>"
  account_name      = "<account_name>"
  user              = "<user_name>"
  authenticator     = "SNOWFLAKE_JWT"
  private_key       = file("~/.ssh/snowflake_key.p8")
  role              = "SYSADMIN"
}

resource "snowflake_database" "example" {
  name = "TF_DEMO"
}
terraform init   # download the provider
terraform plan   # preview changes
terraform apply  # create the resources

Next:

Getting Help

Start with the matching guide. If you are still blocked, use the support path below.

Which guide do I need?

If you need to… Read
Install and configure the provider Registry docs and authentication methods
See what changed in a release GitHub release notes and MIGRATION_GUIDE.md
Upgrade the provider version (for example 2.19 → 2.20) MIGRATION_GUIDE.md
Absorb a Snowflake behavior-change (BCR) bundle SNOWFLAKE_BCR_MIGRATION_GUIDE.md
Change Registry source CZI_UPGRADE.md then SNOWFLAKEDB_MIGRATION.md
Import existing Snowflake objects into Terraform Resource migration guide
See current plans ROADMAP.md
  1. Production outage / official support — Snowflake Support (v2.0.0+ stable resources). Enterprise customers can also contact their account team.
  2. How do I…? — FAQ, known issues, discussions, and the introductory tutorial.
  3. Is this already filed? — Search open and closed issues.
  4. Open an issue — Read CREATING_ISSUES.md first, then use the matching GitHub issue template.

Additional SQL Client configuration

The provider talks to Snowflake through the gosnowflake driver. Driver log level is driver_tracing in the provider configuration (or SNOWFLAKE_DRIVER_TRACING). To see SQL that Terraform runs, see How can I turn on logs? in the FAQ.

Contributing

This repository is a mirror of our internal development repository — merges happen internally and are synced here automatically. Issues, discussions, and pull requests are still the way to reach us. See CONTRIBUTING.md for requirements, the PR workflow and others.

Releases

Releases land as needed, typically every two weeks, on the Terraform Registry.

License

MIT

Explore related projects

Loading…