-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource: Add LBAC for datasources data_source_lbac_rules
#1797
base: main
Are you sure you want to change the base?
Conversation
In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. |
data_source_lbac_rules
data_source_lbac_rules
data_source_lbac_rules
Hey there, is there an ETA when this feature will be shipped? Or is there anything that still needs to be done? |
@undefinedhuman we are working on the backend side of things for this. So this will wait for clear resource handling |
Thank you very much! |
What's the status of this? I was using teamHttpHeaders to configure lbac via the grafana_datasource_config, but that seems to be broken after these 2 are merged:
Now I am no longer able to manage my loki lbac rules via terraform, resulting in new onboarded teams to have full query access to my log datasource. |
why/what
We have seen that users would love to provision their lbac rules using terraform. this implements a experimental feature that will be highly developed. this is the first part of LBAC rules resource for terraform.
dependancies:
teamHttpHeaders
in the json read path for data source #1857 ✅write
path ofteamHttpHeaders
in the json encoding #1856 ✅go.mod
Update to latest openapi spec #1905 ✅ability to run
terraform plan, terraform apply and terraform destroy of the rules resource
Example terraform:
why is this difficult
lbac for datasources terraform resource, why is it a bit tricky?
the bidirection of
lbac_rules -> data_source:jsonData
, meaning we are updating the jsondata with another resource impacting another resourceproposals and thought process
there is no ID for the json field
teamHttpHeaders
data_source_config
resource morethis is a resource that will be heavily used
grafana_data_source_permission_item
for this. as it suits well for how we would like to setup this resourceresource_data_source_config_lbac_rules
proposal of all rules combined into one resource
benefits
tradeoffs
proposal of each rule being a resource
benefits
tradeoffs
proposal of embedding it into a resource and then add it to the json
benefits:
tradeoff
It's a tradeoff of where you want the complexity to be. In Grafana with a new way to store this, or in the provider extracting it from json data, and possibly running into versioning issues.
I guess the less complex option is to leave everything as-is, isn't it? Have people manage those new fields in the existing json data? Perhaps provide a datasource helper for this, if the value is not trivial to build/represent
run tests via
GRAFANA_VERSION=11.1.0 GRAFANA_URL=http://localhost:3000 GRAFANA_AUTH=admin:admin TESTARGS="-run TestAccDataSourceLBAC_inOrg" make testacc-enterprise
The
teamHttpHeaders
resource is a datasource json field.epic
basically this introduced a way to add/update a datasource json field
lbac-api
here is the doc for it. https://grafana.com/docs/grafana/latest/administration/data-source-management/teamlbac/
next steps
improvements: