terraform-cdk-provider-snowflake
is a custom provider built on top of terraform-provider-snowflake
by Snowflake Labs. This repo is automatically updated by Github Actions each time Snowflake Labs creates a new release for terraform-provider-snowflake
. You can find the original repository here: terraform-provider-snowflake.
The project automates the creation of a Terraform CDK library in TypeScript based on terraform-provider-snowflake
by Snowflake Labs. Here's how it works:
- The latest version of
terraform-provider-snowflake
is cloned from the Snowflake Labs repository. - README files for each of the resources are parsed to extract information.
- This information is then used to generate TypeScript interfaces.
- The resources and their parameters are organized from these interfaces into a JSON file located at
tools/snowflake_resources.json
. - Template files, located in
tools/templates
, are used to loop through the JSON data and create a TypeScript file for each resource. - All generated files in
src/snowflake_resources
are compiled intodist/snowflake_resources
.
To rebuild all Snowflake resource files, follow these steps:
- Run
npm install
to install the necessary dependencies. - Execute the
main.js
script by runningnode main.js
to generate the Terraform CDK files.
- Go to Snowflake Labs Releases
- Find the latest release and download the appropriate zip file (this example uses the linux_amd64 architecture)
- Unzip the file and extract the terraform-provider-snowflake_v<VERSION> file
- Copy the file into ~/.terraform.d/plugins/terraform-cdk-provider-snowflake/<VERSION>/<ARCHITECTURE>/
- Clone this repo down into the desired project
Example Copying Provider File from Downloads Folder to Correct Directory Using linux_amd64 and Version 0.72.0
mkdir -p ~/.terraform.d/plugins/terraform-provider-snowflake/0.72.0/linux_amd64 && cp /mnt/c/Users/<YOUR USER NAME>/Downloads/terraform-provider-snowflake_v0.72.0 ~/.terraform.d/plugins/terraform-provider-snowflake/0.72.0/linux_amd64