openstack_images_image_ids_v2
This instruction is a copy of the official OpenStack Terraform provider documentation in the Terraform Registry.
Use this data source to get a list of OpenStack Image IDs matching the specified criteria.
Example Usage
data "openstack_images_image_ids_v2" "images" {
name_regex = "^Ubuntu 16\\.04.*-amd64"
sort = "updated_at"
properties = {
key = "value"
}
}
Argument Reference
-
region- (Optional) The region in which to obtain the V2 Glance client. A Glance client is needed to create an Image that can be used with a compute instance. If omitted, theregionargument of the provider is used. -
member_status- (Optional) The status of the image. Must be one of "accepted", "pending", "rejected", or "all". -
name- (Optional) The name of the image. Cannot be used simultaneously withname_regex. -
name_regex- (Optional) The regular expression for the name of the image. Cannot be used simultaneously withname. Unlike filtering bynamethename_regexfiltering is performed by the client on the result of the OpenStack search query. -
owner- (Optional) The owner (UUID) of the image. -
properties- (Optional) a map of key/value pairs to match an image with. All specified properties must be matched. Unlike other options, filtering
filtering bypropertiesis performed by the client on the result of the OpenStack search query. -
size_min- (Optional) The minimum size (in bytes) of the image to return. -
size_max- (Optional) The maximum size (in bytes) of the image to return. -
sort- (Optional) Sorts the response by one or more attribute and sort direction combinations. You can also set multiple sort keys and directions. Default direction isdesc. Use the comma (,) character to separate multiple values. For example, expressionsort = "name:asc,status"sorts ascending by name and descending by status.sortcannot be used simultaneously withsort_key. If both are present in a configuration, then onlysortwill be used. -
sort_direction- (Optional) Order the results in eitherascordesc. Can be applied only withsort_key. Defaults toasc -
sort_key- (Optional) Sort images based on a certain key. Defaults toname.sort_keycannot be used simultaneously withsort. If both are present in a configuration, then onlysortwill be used. -
tag- (Optional) Search for images with a specific tag. -
tags- (Optional) A list of tags required to be set on the image (all specified tags must be in the image's tag list for it to be matched). -
visibility- (Optional) The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".
Attributes Reference
ids is set to the list of OpenStack Image IDs.