Passing workspace as a variable in a query lambda

I want to pass the workspace into query lambda as a variable

Unfortunately, we do not support passing the workspace as a variable to the query lambda. You would need to copy the query lambda for each workspace/collection to be queried. We do have a terraform provider that can help automate this for you in production:

Terraform Registry.