The snowsql_query data source ID will is always reset even if it has already been set before when the name argument is not specified.
Terraform Version
Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
Affected Resource(s)
Please list the resources as a list, for example:
snowsql_query
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
data "snowsql_query" "select_current_user" {
statements = "SELECT current_user()"
}
Debug Output
$ TF_LOG=debug terraform apply
...
2023-02-24T12:34:39.536-0700 [WARN] Provider "provider[\"registry.terraform.io/aidanmelen/snowsql\"]" produced an unexpected new value for data.snowsql_query.select_current_user.
- .id: was cty.StringVal("cfsh2finv5cve7d955og"), but now cty.StringVal("cfsh2jqnv5cvvltgp2t0")
...
Expected Behavior
during the first terraform apply, the data source ID should be set in state. Then all subsequent applies should use this ID.
Actual Behavior
The data source ID always gets reset when the name argument is not specified.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
TF_LOG=debug terraform apply
TF_LOG=debug terraform apply and we should see the data source ID change in state.
There doesn't seem like an easy way to fix this other than just explicitly setting the name. Moreover, this is only visible when running with TF_LOG=debug
The
snowsql_query
data source ID will is always reset even if it has already been set before when thename
argument is not specified.Terraform Version
Run
terraform -v
to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.Affected Resource(s)
Please list the resources as a list, for example:
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
Debug Output
Expected Behavior
during the first terraform apply, the data source ID should be set in state. Then all subsequent applies should use this ID.
Actual Behavior
The data source ID always gets reset when the
name
argument is not specified.Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
TF_LOG=debug terraform apply
TF_LOG=debug terraform apply
and we should see the data source ID change in state.