Open N3X14 opened 1 month ago
Can you describe your intended use of the provider? Users are not queryable in Grafana Cloud right now because they are provisioned externally
Sure thing. I'm trying to provision the whole stack (folders, folder_permissions, etc.) based on the users email addresses. We're using OAuth for login and basically all I need would be to provide an email and get the user_id in return. That was my intended use-case for this datasource.
Not sure if I missed what you're describing in the documentation, but I'm pretty certain that was not mentioned there?
Thanks!
In particular here: Grafana Cloud Docs It mentions that it would be available using basicAuth? Hella confusing with the various authentication options.
It mentions that it would be available using basicAuth?
Yeah, basicAuth would be user:password
which isn't available in Grafana Cloud. I will take a look if it's possible to search users with a service account token. Weird that it has never come up before 🤔
Yeap, tried that as well (user:password). Given it was referenced in the documentation I suspected they have some sync from grafana.net to the individual stacks to make that work. Kinda odd that basicAuth is mentioned quite a lot in Grafana Cloud docs if it's not even available in the first place x.x
Hit the same exact problem today. I've tried using a cloud_access_policy_token in the provider (i use this successfully to create things like stacks themselves), and then the error changed to: "the Grafana client is required for this resource. Set the auth and url provider attributes"
👍. Grafana Cloud has an API to get a stack's users. I am looking into integrating it in the provider. Probably as a new datasource: data.grafana_cloud_stack_users
Much appreciated!
For info, this is the API call that can be used: https://github.com/grafana/grafana-com-public-clients/blob/ac10800522a38443066abcca234272895af2c569/go/gcom/api_instances.go#L2281-L2288
Terraform Version
v1.9.3
Terraform Grafana Provider Version
3.6.0
Grafana Version
Grafana v11.2.0-73830 (8d98c9eba7)
Affected Resource(s)
data.grafana_users
Terraform Configuration Files
Expected Behavior
No error should be returned and the requested data should be made available for consumption.
Actual Behavior
Error: global scope resources cannot be managed with an API key. Use basic auth instead
with data.grafana_users.all_users, on data.tf line 21, in data "grafana_users" "all_users": 21: data "grafana_users" "all_users" {
Steps to Reproduce
Important Factoids
Using Grafana Cloud. Creating a user in grafana.net and using basicAuth errors in 401 suggesting that's not working/available either. This is an all new project, there's no interfering state.
References
No response