用于管理 Snowflake 帐户的 Terraform 提供程序
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 | Changelog | 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.
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.
2.x releaseOfficial binaries follow what the gosnowflake driver supports and what HashiCorp recommends for Terraform providers:
These binaries are also published but are not officially supported (fixes are not prioritized):
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 = ""
account_name = ""
user = ""
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:
Start with the matching guide. If you are still blocked, use the support path below.
| If you need to… | Read |
|---|---|
| Install and configure the provider | Registry docs and authentication methods |
| 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 |
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.
See CONTRIBUTING.md for requirements, the PR workflow and others.
Releases land as needed, typically every two weeks, on the Terraform Registry.
暂无开放 Issues,或尚未同步最近议题。