Crossplane providers generated by Upjet do not support the TF Data Source blocks, however some Grafana resources rely on inputs from these data sources. While it is possible to work around this by providing data like User IDs directly, it is rather inconvenient.
This Crossplane function can look up Grafana data and replace that on a resource. For example it can look up a user by its email and replace the data with the ID.
# Run code generation - see input/generate.go
$ go generate ./...
# Run tests - see fn_test.go
$ go test ./...
# Build the function's runtime image - see Dockerfile
$ docker build . --tag=runtime
# Build a function package - see package/crossplane.yaml
$ crossplane xpkg build -f package --embed-runtime-image=runtime