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
Our main usecase for the role datasource is to fetch a single role by name, which we could previously do like this:
data "snowflake_role" "this" {
name = "role1"
}
output "name_output" {
value = data.snowflake_role.this.name
}
Actual Behavior
To achieve the same behaviour, we now have to do something more like
data "snowflake_roles" "like" {
like = "role1"
}
output "name_output" {
value = one(one(data.snowflake_roles.like.roles).show_output).name
}
Steps to Reproduce
It seems like the new resource is much more verbose for this common usecase, where we have to wrap any usage of the source in two one statements - and may also want to add multiple checks to ensure that exactly 1 value is returned, adding several more lines for each source.
Additionally, I am a little confused as to why both roles and show_output are lists, rather than one of them being single value?
How much impact is this issue causing?
Low
Logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
I think we have not shared it anywhere publicly yet, but we had internal discussions about the datasources shape for the V1. Main pointers:
for V1 we focus on having a "plural" datasource for each stable object because it covers all the use cases (sometimes much more verbose as you said)
after V1 we plan to revisit the topic; the current idea would be to provide 2 more datasources for each object (or to extend the existing datasource with 1. and add just one described in 2.):
id-fetching one with more filtering; the idea would be to have a lightweight object to fetch all objects matching the filters to use it in...
... the "singular" datasource which has all the details that also the resource has (so it would be essentially a read-only copy of the resource)
We will, however, address it after V1, and after hitting GA.
About the show_output looks, please check our answers in #3074, #3118, and #3084.
Terraform CLI Version
1.7.5
Terraform Provider Version
0.98.0
Company Name
No response
Terraform Configuration
No response
Category
category:resource
Object type(s)
No response
Expected Behavior
Our main usecase for the role datasource is to fetch a single role by name, which we could previously do like this:
Actual Behavior
To achieve the same behaviour, we now have to do something more like
Steps to Reproduce
It seems like the new resource is much more verbose for this common usecase, where we have to wrap any usage of the source in two one statements - and may also want to add multiple checks to ensure that exactly 1 value is returned, adding several more lines for each source.
Additionally, I am a little confused as to why both
roles
andshow_output
are lists, rather than one of them being single value?How much impact is this issue causing?
Low
Logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: