11---
2- page_title : " Hetzner Cloud: hcloud_image"
2+ # generated by https://github.com/hashicorp/terraform-plugin-docs
3+ page_title : " hcloud_image Data Source - hcloud"
4+ subcategory : " "
35description : |-
4- Provides details about a specific Hetzner Cloud Image.
6+ Provides details about a Hetzner Cloud Image.
7+ It is recommended to always provide the image architecture (using ''with_architecture'').
8+ See the Image API documentation https://docs.hetzner.cloud/reference/cloud#images for more details.
59---
610
7- # Data Source: hcloud_image
11+ # hcloud_image ( Data Source)
812
913Provides details about a Hetzner Cloud Image.
10- This resource is useful if you want to use a non-terraform managed image.
1114
12- When relevant, it is recommended to always provide the image architecture
13- (` with_architecture ` ) when fetching images.
15+ It is recommended to always provide the image architecture (using ''with_architecture'').
16+
17+ See the [ Image API documentation] ( https://docs.hetzner.cloud/reference/cloud#images ) for more details.
1418
1519## Example Usage
1620
1721``` terraform
1822data "hcloud_image" "by_id" {
19- id = " 114690387"
23+ id = 114690387
2024}
2125
2226data "hcloud_image" "by_name_x86" {
@@ -31,33 +35,36 @@ data "hcloud_image" "by_name_arm" {
3135
3236data "hcloud_image" "by_label" {
3337 with_selector = "key=value"
38+ most_recent = true
3439}
3540
3641resource "hcloud_server" "main" {
3742 image = data.hcloud_image.by_name.id
3843}
3944```
4045
41- ## Argument Reference
42-
43- - ` id ` - (Optional, string) ID of the Image.
44- - ` name ` - (Optional, string) Name of the Image.
45- - ` with_selector ` - (Optional, string) [ Label selector] ( https://docs.hetzner.cloud/reference/cloud#label-selector )
46- - ` most_recent ` - (Optional, bool) If more than one result is returned, use the most recent Image.
47- - ` with_status ` - (Optional, list) Select only images with the specified status, could contain ` creating ` or ` available ` .
48- - ` with_architecture ` - (Optional, string) Select only images with this architecture, could be ` x86 ` (default) or ` arm ` .
49- - ` include_deprecated ` - (Optional, bool) Also return the image if it is marked as deprecated.
50-
51- ## Attributes Reference
52-
53- - ` id ` - (int) Unique ID of the Image.
54- - ` name ` - (string) Name of the Image, only present when the Image is of type ` system ` .
55- - ` type ` - (string) Type of the Image, could be ` system ` , ` backup ` or ` snapshot ` .
56- - ` status ` - (string) Status of the Image.
57- - ` description ` - (string) Description of the Image.
58- - ` created ` - (string) Date when the Image was created (in ISO-8601 format).
59- - ` os_flavor ` - (string) Flavor of operating system contained in the image, could be ` ubuntu ` , ` centos ` , ` debian ` , ` fedora ` or ` unknown ` .
60- - ` os_version ` - (string) Operating system version.
61- - ` rapid_deploy ` - (bool) Indicates that rapid deploy of the image is available.
62- - ` deprecated ` - (string) Point in time when the image is considered to be deprecated (in ISO-8601 format).
63- - ` architecture ` - (string) Architecture of the Image.
46+ <!-- schema generated by tfplugindocs -->
47+ ## Schema
48+
49+ ### Optional
50+
51+ - ` id ` (Number) ID of the Image.
52+ - ` include_deprecated ` (Boolean) Include deprecated images.
53+ - ` most_recent ` (Boolean) Sort results by created date, and return the most recent result.
54+ - ` name ` (String) Name of the Image, only present when the type is ` system ` .
55+ - ` selector ` (String, Deprecated) Filter results using a [ Label Selector] ( https://docs.hetzner.cloud/reference/cloud#label-selector ) .
56+ - ` with_architecture ` (String) Filter results by architecture, for example ` x86 ` (default) or ` arm ` .
57+ - ` with_selector ` (String) Filter results using a [ Label Selector] ( https://docs.hetzner.cloud/reference/hetzner#label-selector ) .
58+ - ` with_status ` (Set of String) Filter results by statuses, for example ` creating ` or ` available ` .
59+
60+ ### Read-Only
61+
62+ - ` architecture ` (String) CPU architecture compatible with the Image.
63+ - ` created ` (String) Point in time when the Image was created (in RFC3339 format).
64+ - ` deprecated ` (String) Point in time when the Image was marked as deprecated (in RFC3339 format).
65+ - ` description ` (String) Description of the Image.
66+ - ` labels ` (Map of String) User-defined [ labels] ( https://docs.hetzner.cloud/reference/cloud#labels ) (key-value pairs) for the resource.
67+ - ` os_flavor ` (String) Flavor of the operating system contained in the Image.
68+ - ` os_version ` (String) Version of the operating system contained in the Image.
69+ - ` rapid_deploy ` (Boolean) Whether the Image is optimized for a rapid deployment.
70+ - ` type ` (String) Type of the Image, for example ` system ` , ` backup ` or ` snapshot ` .
0 commit comments