Can someone tell me the best way for finding documentation about a particular resource on the Terraform Registry pages, please?
For example, on the Data Sources intro page there is this example:
data "aws_ami" "example" {
most_recent = true
...
}
This data source comes from aws provider as per the first segment of the name (I think that’s how you determine it). So I go to the provider docs stick aws_ami into the search box and I’m getting 525 matching results. That’s not helpful.
Based on what you’ve shared it seems like by default the filter logic is treating each segment of what you entered as a separate search term and so showing you everything that includes “aws”, which covers all resource types in this provider.
Writing "aws_ami" with the quotes seems to reduce it to only 59 results at the time of writing, which is still not ideal – I would agree that it would be better for the UI to prioritize an exact match first – but at least better than hundreds of results.
Interesting theory. Searching for ami alone gives me 94 results. If I then use my web browser search I only get 12 hits amongst those 94 results given by the filter. I don’t know what input this filter attempts to match against the term but for sure it’s not the items in the navbar. In my eyes the filter is simply borked.
What method do you use for finding docs for Terraform resources? It doesn’t have to be web based, I’m happy with any way that doesn’t require trawling through 59 results every time I need to check what a resource does or what its arguments are.
Indeed, I’m honestly not sure what this filter is doing exactly. Based on what I saw when I tried the quoted query I guessed that it was trying to do some similarity matching; “aws ami” and “aws api” have a small edit distance. But I don’t have any information beyond what we’ve observed together here.
I don’t have any special tricks here. I typically just search for what I’m looking for in quotes and then scroll to find the relevant entry. I agree that this filter could do a better job at prioritizing what it returns by relevance.
Right, that is a great question. I am struggling with the same each time when I am looking for some resources etc.
For example, a while ago I created resources with aws_iam_user, aws_iam_access_key, and aws_iam_user_policy and I realized that maybe there is some module already which bind up all them together, and I am not able to find Terraform Registry