Terraform, the declarative Infrastructure as Code (IaC) tool, sheds light on the interdependencies between resources that exist within an organization. Popular among Snowflake users, Terraform aids Snowflake users in complying with security controls, maintaining consistency, and supporting similar engineering workflows at scale.
Brad Culberson, principal architect of data apps and field CTO office at Snowflake, join DBTA’s webinar, Terraform 101: How To Manage Snowflake Account Objects With Code, to explore basic Terraform usage, how to create users, roles, databases, and more, enabling anyone to build a repository containing a Terraform project that manages Snowflake account objects through code.
Culberson began by first defining Terraform as an IaC tool in which operations are reproducible and auditable. Terraform not only supports Snowflake, but AWS, Azure, Google Cloud open source and cloud versions as well.
Following his definition, Culberson walked viewers through a detailed guide in leveraging Terraform in combination with Snowflake. Highlighting steps toward implementation, including creating a repository, creating a service user for Terraform, setting up a Terraform authentication, declaring resources, and much more, Culberson emphasized the utility of Terraform, showing exact code additions that can best support the combination.
In conjunction with his thorough demo of Terraform for Snowflake, Culberson offered the following best practices to ensure optimized usage of both services in tandem:
- Create objects you want to manage from code in Terraform.
- Manage any dependencies of those objects in Terraform.
- Store state in Terraform Cloud or a backend provider, like S3.
- Use modules for repeatable patterns.
- Plan before you commit changes.
- Run all environment changes through continuous integration.
- Pair Terraform with an imperative/transformation tool for data migration needs.
To view an in-depth tutorial of using Terraform with Snowflake, you can view an archived version of the webinar here.