Closed hongzed closed 2 years ago
hi @aidanmelen
I just came across this PR #42 and hence cloned the repo and built/installed the snowsql provider locally for testing. Unfortunately, it is still not able to recognise the warehouse
argument.
Built and installed locally
$ make install
go build -o terraform-provider-snowsql
mkdir -p ~/.terraform.d/plugins/registry.example.io/local/snowsql/0.4.4/darwin_amd64
mv terraform-provider-snowsql ~/.terraform.d/plugins/registry.example.io/local/snowsql/0.4.4/darwin_amd64
Modified my main.tf
terraform {
required_providers {
snowflake = {
source = "Snowflake-Labs/snowflake"
version = "~> 0.35"
}
snowsql = {
source = "registry.example.io/local/snowsql"
version = "= 0.4.4"
}
}
}
provider "snowsql" { account = var.account region = var.region username = var.snowsql_username private_key_path = var.private_key_path
warehouse = "compute_wh" }
- Executed `terraform init`
```shell
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding snowflake-labs/snowflake versions matching "~> 0.35"...
- Finding registry.example.io/local/snowsql versions matching "0.4.4"...
- Finding latest version of hashicorp/tls...
- Installing snowflake-labs/snowflake v0.40.0...
- Installed snowflake-labs/snowflake v0.40.0 (signed by a HashiCorp partner, key ID 5166D7352E69A585)
- Installing registry.example.io/local/snowsql v0.4.4...
- Installed registry.example.io/local/snowsql v0.4.4 (unauthenticated)
- Installing hashicorp/tls v4.0.1...
- Installed hashicorp/tls v4.0.1 (signed by HashiCorp)
terraform plan
given the same error
$ terraform plan
╷
│ Error: Unsupported argument
│
│ on main.tf line 30, in provider "snowsql":
│ 30: warehouse = "compute_wh"
│
│ An argument named "warehouse" is not expected here.
thanks for reporting the issue! I will look into this further. In the meantime, there is a work around described here.
Essentially, it means setting the DEFAULT_WAREHOUSE
on the user that the snowsql
provider is using to authenticate. I realize that is not ideal for users of this provider which is why I would like to fix this issue.
it also looks like there is a second work around described here.
still I will look into fixing this issue
another option is to use the environment variable.
SNOWFLAKE_WAREHOUSE='COMPUTE WH'
please use the upcoming v1.0.0 v1.0.1 release to use the provider.warehouse
feature.
thank you @aidanmelen just did a terraform init -upgrade
and everything works as expected on my end!
Hi @aidanmelen ,
I am encountering an issue when having multiple grant statements (more than one) defined in either the
create
ordelete
lifecycle. Given such a configuration theterraform apply
always errors out complaining about no active warehouse selected. When attempting with the warehouse attribute in the snowsql provider configuration, an error is given stating the warehouse is not a supported argument.Terraform Version
Terraform v1.0.11
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
What should have happened?
warehouse
should be supported in the snowsql provider configuration similar to the snowflake provider. This line of code indicates it should have been a valid argument.Actual Behavior
What actually happened?