You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just recently released terraform-provider-snowsql. This project seemed like it could benefit from this new provider!
For example, the snowpipe-base sub-module uses on the null_resource to execute snowsql statements.
resource"null_resource""create_snowflake_table" {
provisioner"local-exec" {
command=<<EOT{ snowsql --accountname $SNOWFLAKE_ACCOUNT.$SNOWFLAKE_REGION --username $SNOWFLAKE_USER --query 'CREATE TABLE IF NOT EXISTS ${var.database}.${var.schema}.${local.formatted_s3_path}${local.formatted_rows}' || \ (echo 'Make sure $SNOWFLAKE_ACCOUNT, $SNOWFLAKE_REGION and $SNOWFLAKE_USER env vars are set and the snowsql tool is on the path'; exit 1;)}EOT
}
}
which can be declare with:
terraform {
required_version=">= 0.13.0"required_providers {
snowflake={
source ="chanzuckerberg/snowflake"
version =">= v0.25.18"
}
snowsql={
source ="aidanmelen/snowsql"
version =">= 0.1.0"
}
random=">= 2.1"
}
}
# both providers use the same code to authenticate with snowflakeprovider"snowflake" {}
provider"snowsql" {}
# ...resource"snowsql_exec""dcl" {
name=local.namecreate {
statements="CREATE TABLE IF NOT EXISTS ${var.database}.${var.schema}.${local.formatted_s3_path}${local.formatted_rows}${snowflake_role.role.name};"
}
delete {
statements="DROP TABLE IF EXISTS ${var.database}.${var.schema}.${local.formatted_s3_path}${local.formatted_rows}"
}
delete_on_create=true
}
The text was updated successfully, but these errors were encountered:
aidanmelen
changed the title
replace local_exec resource for executing snowsql with the terraform-provider-snowsql
replace null_resource for executing snowsql with the terraform-provider-snowsql
Aug 30, 2021
I just recently released terraform-provider-snowsql. This project seemed like it could benefit from this new provider!
For example, the snowpipe-base sub-module uses on the
null_resource
to execute snowsql statements.which can be declare with:
The text was updated successfully, but these errors were encountered: