nutanix / terraform-provider-nutanix

Terraform Nutanix Provider
https://www.terraform.io/docs/providers/nutanix/
Mozilla Public License 2.0
95 stars 111 forks source link

Add nutanix_images data source #584

Open N0zz opened 1 year ago

N0zz commented 1 year ago

There is no data source to fetch more than one nutanix_image. Using more than one image with the same name results in "your query returned more than one result. Please use image_id argument instead" error.

The only solutions for now, are: to use image_id, or force_deregister to only keep one image with that name. But those solutions are not optimal and user friendly in some cases.

Looking at other data sources (e.g. nutanix_host, there are counterparts which allow to fetch more than one entitiy, nutanix_hosts in that case). There is no option for nutanix_image to fetch multiple entities (e.g. nutanix_images data source).

Proposed solution: Add nutanix_images data source that could handle multiple entities.

Alternative solution: Make nutanix_image data source handle one and more than one entities.

Either way, new or updated data source could come with some handy improvements for fetching and filtering multiple entities, examples: