One gotcha is that chef search normally return a list of results, while a terraform data source (as far as I understand) isn't allowed to do that. So that is why I introduced "unique" above, which would mean that a unique result is expected (and an error would be raised otherwise). Without "unique = true" the result would instead contain the list attribute "rows" with all the results.
To easily use data stored on a chef server in terraform would be very useful.
I envision something you would call like this:
data.chef_search.rabbitmq.rabbitmq.default_password
anddata.chef_search.rabbitmq.host
would then be examples of attributes to use.This is similar to how you would use search in a chef recipe: https://docs.chef.io/chef_search.html#filter-search-results
One gotcha is that chef search normally return a list of results, while a terraform data source (as far as I understand) isn't allowed to do that. So that is why I introduced "unique" above, which would mean that a unique result is expected (and an error would be raised otherwise). Without "unique = true" the result would instead contain the list attribute "rows" with all the results.