Viewing docs for Hetzner Cloud v1.32.1
published on Tuesday, Feb 17, 2026 by Pulumi
published on Tuesday, Feb 17, 2026 by Pulumi
Viewing docs for Hetzner Cloud v1.32.1
published on Tuesday, Feb 17, 2026 by Pulumi
published on Tuesday, Feb 17, 2026 by Pulumi
Provides details about a Hetzner Cloud Image. This resource is useful if you want to use a non-terraform managed image.
When relevant, it is recommended to always provide the image architecture
(with_architecture) when fetching images.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const byId = hcloud.getImage({
id: 114690387,
});
const byNameX86 = hcloud.getImage({
name: "debian-12",
withArchitecture: "x86",
});
const byNameArm = hcloud.getImage({
name: "debian-12",
withArchitecture: "arm",
});
const byLabel = hcloud.getImage({
withSelector: "key=value",
});
const main = new hcloud.Server("main", {image: byName.id});
import pulumi
import pulumi_hcloud as hcloud
by_id = hcloud.get_image(id=114690387)
by_name_x86 = hcloud.get_image(name="debian-12",
with_architecture="x86")
by_name_arm = hcloud.get_image(name="debian-12",
with_architecture="arm")
by_label = hcloud.get_image(with_selector="key=value")
main = hcloud.Server("main", image=by_name["id"])
package main
import (
"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := hcloud.GetImage(ctx, &hcloud.GetImageArgs{
Id: pulumi.IntRef(114690387),
}, nil)
if err != nil {
return err
}
_, err = hcloud.GetImage(ctx, &hcloud.GetImageArgs{
Name: pulumi.StringRef("debian-12"),
WithArchitecture: pulumi.StringRef("x86"),
}, nil)
if err != nil {
return err
}
_, err = hcloud.GetImage(ctx, &hcloud.GetImageArgs{
Name: pulumi.StringRef("debian-12"),
WithArchitecture: pulumi.StringRef("arm"),
}, nil)
if err != nil {
return err
}
_, err = hcloud.GetImage(ctx, &hcloud.GetImageArgs{
WithSelector: pulumi.StringRef("key=value"),
}, nil)
if err != nil {
return err
}
_, err = hcloud.NewServer(ctx, "main", &hcloud.ServerArgs{
Image: pulumi.Any(byName.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
var byId = HCloud.GetImage.Invoke(new()
{
Id = 114690387,
});
var byNameX86 = HCloud.GetImage.Invoke(new()
{
Name = "debian-12",
WithArchitecture = "x86",
});
var byNameArm = HCloud.GetImage.Invoke(new()
{
Name = "debian-12",
WithArchitecture = "arm",
});
var byLabel = HCloud.GetImage.Invoke(new()
{
WithSelector = "key=value",
});
var main = new HCloud.Server("main", new()
{
Image = byName.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.HcloudFunctions;
import com.pulumi.hcloud.inputs.GetImageArgs;
import com.pulumi.hcloud.Server;
import com.pulumi.hcloud.ServerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var byId = HcloudFunctions.getImage(GetImageArgs.builder()
.id(114690387)
.build());
final var byNameX86 = HcloudFunctions.getImage(GetImageArgs.builder()
.name("debian-12")
.withArchitecture("x86")
.build());
final var byNameArm = HcloudFunctions.getImage(GetImageArgs.builder()
.name("debian-12")
.withArchitecture("arm")
.build());
final var byLabel = HcloudFunctions.getImage(GetImageArgs.builder()
.withSelector("key=value")
.build());
var main = new Server("main", ServerArgs.builder()
.image(byName.id())
.build());
}
}
resources:
main:
type: hcloud:Server
properties:
image: ${byName.id}
variables:
byId:
fn::invoke:
function: hcloud:getImage
arguments:
id: '114690387'
byNameX86:
fn::invoke:
function: hcloud:getImage
arguments:
name: debian-12
withArchitecture: x86
byNameArm:
fn::invoke:
function: hcloud:getImage
arguments:
name: debian-12
withArchitecture: arm
byLabel:
fn::invoke:
function: hcloud:getImage
arguments:
withSelector: key=value
Using getImage
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getImage(args: GetImageArgs, opts?: InvokeOptions): Promise<GetImageResult>
function getImageOutput(args: GetImageOutputArgs, opts?: InvokeOptions): Output<GetImageResult>def get_image(id: Optional[int] = None,
include_deprecated: Optional[bool] = None,
most_recent: Optional[bool] = None,
name: Optional[str] = None,
selector: Optional[str] = None,
with_architecture: Optional[str] = None,
with_selector: Optional[str] = None,
with_statuses: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(id: Optional[pulumi.Input[int]] = None,
include_deprecated: Optional[pulumi.Input[bool]] = None,
most_recent: Optional[pulumi.Input[bool]] = None,
name: Optional[pulumi.Input[str]] = None,
selector: Optional[pulumi.Input[str]] = None,
with_architecture: Optional[pulumi.Input[str]] = None,
with_selector: Optional[pulumi.Input[str]] = None,
with_statuses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetImageResult]func GetImage(ctx *Context, args *GetImageArgs, opts ...InvokeOption) (*GetImageResult, error)
func GetImageOutput(ctx *Context, args *GetImageOutputArgs, opts ...InvokeOption) GetImageResultOutput> Note: This function is named GetImage in the Go SDK.
public static class GetImage
{
public static Task<GetImageResult> InvokeAsync(GetImageArgs args, InvokeOptions? opts = null)
public static Output<GetImageResult> Invoke(GetImageInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
public static Output<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
fn::invoke:
function: hcloud:index/getImage:getImage
arguments:
# arguments dictionaryThe following arguments are supported:
- Id int
- ID of the Image.
- Include
Deprecated bool - Also return the image if it is marked as deprecated.
- Most
Recent bool - If more than one result is returned, use the most recent Image.
- Name string
- Name of the Image.
- Selector string
- With
Architecture string - Select only images with this architecture, could be
x86(default) orarm. - With
Selector string - Label selector
- With
Statuses List<string> - Select only images with the specified status, could contain
creatingoravailable.
- Id int
- ID of the Image.
- Include
Deprecated bool - Also return the image if it is marked as deprecated.
- Most
Recent bool - If more than one result is returned, use the most recent Image.
- Name string
- Name of the Image.
- Selector string
- With
Architecture string - Select only images with this architecture, could be
x86(default) orarm. - With
Selector string - Label selector
- With
Statuses []string - Select only images with the specified status, could contain
creatingoravailable.
- id Integer
- ID of the Image.
- include
Deprecated Boolean - Also return the image if it is marked as deprecated.
- most
Recent Boolean - If more than one result is returned, use the most recent Image.
- name String
- Name of the Image.
- selector String
- with
Architecture String - Select only images with this architecture, could be
x86(default) orarm. - with
Selector String - Label selector
- with
Statuses List<String> - Select only images with the specified status, could contain
creatingoravailable.
- id number
- ID of the Image.
- include
Deprecated boolean - Also return the image if it is marked as deprecated.
- most
Recent boolean - If more than one result is returned, use the most recent Image.
- name string
- Name of the Image.
- selector string
- with
Architecture string - Select only images with this architecture, could be
x86(default) orarm. - with
Selector string - Label selector
- with
Statuses string[] - Select only images with the specified status, could contain
creatingoravailable.
- id int
- ID of the Image.
- include_
deprecated bool - Also return the image if it is marked as deprecated.
- most_
recent bool - If more than one result is returned, use the most recent Image.
- name str
- Name of the Image.
- selector str
- with_
architecture str - Select only images with this architecture, could be
x86(default) orarm. - with_
selector str - Label selector
- with_
statuses Sequence[str] - Select only images with the specified status, could contain
creatingoravailable.
- id Number
- ID of the Image.
- include
Deprecated Boolean - Also return the image if it is marked as deprecated.
- most
Recent Boolean - If more than one result is returned, use the most recent Image.
- name String
- Name of the Image.
- selector String
- with
Architecture String - Select only images with this architecture, could be
x86(default) orarm. - with
Selector String - Label selector
- with
Statuses List<String> - Select only images with the specified status, could contain
creatingoravailable.
getImage Result
The following output properties are available:
- Architecture string
- (string) Architecture of the Image.
- Created string
- (string) Date when the Image was created (in ISO-8601 format).
- Deprecated string
- (string) Point in time when the image is considered to be deprecated (in ISO-8601 format).
- Description string
- (string) Description of the Image.
- Id int
- (int) Unique ID of the Image.
- Labels Dictionary<string, string>
- Name string
- (string) Name of the Image, only present when the Image is of type
system. - Os
Flavor string - (string) Flavor of operating system contained in the image, could be
ubuntu,centos,debian,fedoraorunknown. - Os
Version string - (string) Operating system version.
- Rapid
Deploy bool - (bool) Indicates that rapid deploy of the image is available.
- Type string
- (string) Type of the Image, could be
system,backuporsnapshot. - Include
Deprecated bool - Most
Recent bool - Selector string
- With
Architecture string - With
Selector string - With
Statuses List<string>
- Architecture string
- (string) Architecture of the Image.
- Created string
- (string) Date when the Image was created (in ISO-8601 format).
- Deprecated string
- (string) Point in time when the image is considered to be deprecated (in ISO-8601 format).
- Description string
- (string) Description of the Image.
- Id int
- (int) Unique ID of the Image.
- Labels map[string]string
- Name string
- (string) Name of the Image, only present when the Image is of type
system. - Os
Flavor string - (string) Flavor of operating system contained in the image, could be
ubuntu,centos,debian,fedoraorunknown. - Os
Version string - (string) Operating system version.
- Rapid
Deploy bool - (bool) Indicates that rapid deploy of the image is available.
- Type string
- (string) Type of the Image, could be
system,backuporsnapshot. - Include
Deprecated bool - Most
Recent bool - Selector string
- With
Architecture string - With
Selector string - With
Statuses []string
- architecture String
- (string) Architecture of the Image.
- created String
- (string) Date when the Image was created (in ISO-8601 format).
- deprecated String
- (string) Point in time when the image is considered to be deprecated (in ISO-8601 format).
- description String
- (string) Description of the Image.
- id Integer
- (int) Unique ID of the Image.
- labels Map<String,String>
- name String
- (string) Name of the Image, only present when the Image is of type
system. - os
Flavor String - (string) Flavor of operating system contained in the image, could be
ubuntu,centos,debian,fedoraorunknown. - os
Version String - (string) Operating system version.
- rapid
Deploy Boolean - (bool) Indicates that rapid deploy of the image is available.
- type String
- (string) Type of the Image, could be
system,backuporsnapshot. - include
Deprecated Boolean - most
Recent Boolean - selector String
- with
Architecture String - with
Selector String - with
Statuses List<String>
- architecture string
- (string) Architecture of the Image.
- created string
- (string) Date when the Image was created (in ISO-8601 format).
- deprecated string
- (string) Point in time when the image is considered to be deprecated (in ISO-8601 format).
- description string
- (string) Description of the Image.
- id number
- (int) Unique ID of the Image.
- labels {[key: string]: string}
- name string
- (string) Name of the Image, only present when the Image is of type
system. - os
Flavor string - (string) Flavor of operating system contained in the image, could be
ubuntu,centos,debian,fedoraorunknown. - os
Version string - (string) Operating system version.
- rapid
Deploy boolean - (bool) Indicates that rapid deploy of the image is available.
- type string
- (string) Type of the Image, could be
system,backuporsnapshot. - include
Deprecated boolean - most
Recent boolean - selector string
- with
Architecture string - with
Selector string - with
Statuses string[]
- architecture str
- (string) Architecture of the Image.
- created str
- (string) Date when the Image was created (in ISO-8601 format).
- deprecated str
- (string) Point in time when the image is considered to be deprecated (in ISO-8601 format).
- description str
- (string) Description of the Image.
- id int
- (int) Unique ID of the Image.
- labels Mapping[str, str]
- name str
- (string) Name of the Image, only present when the Image is of type
system. - os_
flavor str - (string) Flavor of operating system contained in the image, could be
ubuntu,centos,debian,fedoraorunknown. - os_
version str - (string) Operating system version.
- rapid_
deploy bool - (bool) Indicates that rapid deploy of the image is available.
- type str
- (string) Type of the Image, could be
system,backuporsnapshot. - include_
deprecated bool - most_
recent bool - selector str
- with_
architecture str - with_
selector str - with_
statuses Sequence[str]
- architecture String
- (string) Architecture of the Image.
- created String
- (string) Date when the Image was created (in ISO-8601 format).
- deprecated String
- (string) Point in time when the image is considered to be deprecated (in ISO-8601 format).
- description String
- (string) Description of the Image.
- id Number
- (int) Unique ID of the Image.
- labels Map<String>
- name String
- (string) Name of the Image, only present when the Image is of type
system. - os
Flavor String - (string) Flavor of operating system contained in the image, could be
ubuntu,centos,debian,fedoraorunknown. - os
Version String - (string) Operating system version.
- rapid
Deploy Boolean - (bool) Indicates that rapid deploy of the image is available.
- type String
- (string) Type of the Image, could be
system,backuporsnapshot. - include
Deprecated Boolean - most
Recent Boolean - selector String
- with
Architecture String - with
Selector String - with
Statuses List<String>
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloudTerraform Provider.
Viewing docs for Hetzner Cloud v1.32.1
published on Tuesday, Feb 17, 2026 by Pulumi
published on Tuesday, Feb 17, 2026 by Pulumi
