aidanmelen / terraform-provider-snowsql

Terraform SnowSQL provider
https://registry.terraform.io/providers/aidanmelen/snowsql/latest
Other
21 stars 10 forks source link

feat: data resource to query snowflake #71

Closed aidanmelen closed 1 year ago

aidanmelen commented 1 year ago

Terraform Version

1.x.x

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

data "snowsql_query" "query" {
  name       = local.name
  statements = "SHOW USERS LIKE '${local.name}';"
}

output "snowsql_query_results" {
  value = jsondecode(nonsensitive(data.snowsql_query.query.results))
}

Expected Behavior

the snowsql_query.results attribute will contain a list of JSON formatted query results.