1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getImages
Hetzner Cloud v1.22.0 published on Wednesday, Feb 26, 2025 by Pulumi

hcloud.getImages

Explore with Pulumi AI

Hetzner Cloud v1.22.0 published on Wednesday, Feb 26, 2025 by Pulumi

Provides details about multiple Hetzner Cloud Images.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const image2 = hcloud.getImages({
    withArchitectures: ["x86"],
});
const image3 = hcloud.getImages({
    withSelector: "key=value",
});
Copy
import pulumi
import pulumi_hcloud as hcloud

image2 = hcloud.get_images(with_architectures=["x86"])
image3 = hcloud.get_images(with_selector="key=value")
Copy
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.GetImages(ctx, &hcloud.GetImagesArgs{
			WithArchitectures: []string{
				"x86",
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetImages(ctx, &hcloud.GetImagesArgs{
			WithSelector: pulumi.StringRef("key=value"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;

return await Deployment.RunAsync(() => 
{
    var image2 = HCloud.GetImages.Invoke(new()
    {
        WithArchitectures = new[]
        {
            "x86",
        },
    });

    var image3 = HCloud.GetImages.Invoke(new()
    {
        WithSelector = "key=value",
    });

});
Copy
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.GetImagesArgs;
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 image2 = HcloudFunctions.getImages(GetImagesArgs.builder()
            .withArchitectures("x86")
            .build());

        final var image3 = HcloudFunctions.getImages(GetImagesArgs.builder()
            .withSelector("key=value")
            .build());

    }
}
Copy
variables:
  image2:
    fn::invoke:
      function: hcloud:getImages
      arguments:
        withArchitectures:
          - x86
  image3:
    fn::invoke:
      function: hcloud:getImages
      arguments:
        withSelector: key=value
Copy

Using getImages

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 getImages(args: GetImagesArgs, opts?: InvokeOptions): Promise<GetImagesResult>
function getImagesOutput(args: GetImagesOutputArgs, opts?: InvokeOptions): Output<GetImagesResult>
Copy
def get_images(include_deprecated: Optional[bool] = None,
               most_recent: Optional[bool] = None,
               with_architectures: Optional[Sequence[str]] = None,
               with_selector: Optional[str] = None,
               with_statuses: Optional[Sequence[str]] = None,
               opts: Optional[InvokeOptions] = None) -> GetImagesResult
def get_images_output(include_deprecated: Optional[pulumi.Input[bool]] = None,
               most_recent: Optional[pulumi.Input[bool]] = None,
               with_architectures: Optional[pulumi.Input[Sequence[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[GetImagesResult]
Copy
func GetImages(ctx *Context, args *GetImagesArgs, opts ...InvokeOption) (*GetImagesResult, error)
func GetImagesOutput(ctx *Context, args *GetImagesOutputArgs, opts ...InvokeOption) GetImagesResultOutput
Copy

> Note: This function is named GetImages in the Go SDK.

public static class GetImages 
{
    public static Task<GetImagesResult> InvokeAsync(GetImagesArgs args, InvokeOptions? opts = null)
    public static Output<GetImagesResult> Invoke(GetImagesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetImagesResult> getImages(GetImagesArgs args, InvokeOptions options)
public static Output<GetImagesResult> getImages(GetImagesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: hcloud:index/getImages:getImages
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

IncludeDeprecated bool
Also list images that are marked as deprecated.
MostRecent bool
Sorts list by date.
WithArchitectures List<string>
List only images with this architecture, could contain x86 or arm.
WithSelector string
Label selector
WithStatuses List<string>
List only images with the specified status, could contain creating or available.
IncludeDeprecated bool
Also list images that are marked as deprecated.
MostRecent bool
Sorts list by date.
WithArchitectures []string
List only images with this architecture, could contain x86 or arm.
WithSelector string
Label selector
WithStatuses []string
List only images with the specified status, could contain creating or available.
includeDeprecated Boolean
Also list images that are marked as deprecated.
mostRecent Boolean
Sorts list by date.
withArchitectures List<String>
List only images with this architecture, could contain x86 or arm.
withSelector String
Label selector
withStatuses List<String>
List only images with the specified status, could contain creating or available.
includeDeprecated boolean
Also list images that are marked as deprecated.
mostRecent boolean
Sorts list by date.
withArchitectures string[]
List only images with this architecture, could contain x86 or arm.
withSelector string
Label selector
withStatuses string[]
List only images with the specified status, could contain creating or available.
include_deprecated bool
Also list images that are marked as deprecated.
most_recent bool
Sorts list by date.
with_architectures Sequence[str]
List only images with this architecture, could contain x86 or arm.
with_selector str
Label selector
with_statuses Sequence[str]
List only images with the specified status, could contain creating or available.
includeDeprecated Boolean
Also list images that are marked as deprecated.
mostRecent Boolean
Sorts list by date.
withArchitectures List<String>
List only images with this architecture, could contain x86 or arm.
withSelector String
Label selector
withStatuses List<String>
List only images with the specified status, could contain creating or available.

getImages Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Images List<Pulumi.HCloud.Outputs.GetImagesImage>
(list) List of all matching images. See data.hcloud_image for schema.
IncludeDeprecated bool
MostRecent bool
WithArchitectures List<string>
WithSelector string
WithStatuses List<string>
Id string
The provider-assigned unique ID for this managed resource.
Images []GetImagesImage
(list) List of all matching images. See data.hcloud_image for schema.
IncludeDeprecated bool
MostRecent bool
WithArchitectures []string
WithSelector string
WithStatuses []string
id String
The provider-assigned unique ID for this managed resource.
images List<GetImagesImage>
(list) List of all matching images. See data.hcloud_image for schema.
includeDeprecated Boolean
mostRecent Boolean
withArchitectures List<String>
withSelector String
withStatuses List<String>
id string
The provider-assigned unique ID for this managed resource.
images GetImagesImage[]
(list) List of all matching images. See data.hcloud_image for schema.
includeDeprecated boolean
mostRecent boolean
withArchitectures string[]
withSelector string
withStatuses string[]
id str
The provider-assigned unique ID for this managed resource.
images Sequence[GetImagesImage]
(list) List of all matching images. See data.hcloud_image for schema.
include_deprecated bool
most_recent bool
with_architectures Sequence[str]
with_selector str
with_statuses Sequence[str]
id String
The provider-assigned unique ID for this managed resource.
images List<Property Map>
(list) List of all matching images. See data.hcloud_image for schema.
includeDeprecated Boolean
mostRecent Boolean
withArchitectures List<String>
withSelector String
withStatuses List<String>

Supporting Types

GetImagesImage

Architecture This property is required. string
Created This property is required. string
Deprecated This property is required. string
Description This property is required. string
Id This property is required. int
Labels This property is required. Dictionary<string, string>
Name This property is required. string
OsFlavor This property is required. string
OsVersion This property is required. string
RapidDeploy This property is required. bool
Type This property is required. string
Selector string

Deprecated: Please use the with_selector property instead.

Architecture This property is required. string
Created This property is required. string
Deprecated This property is required. string
Description This property is required. string
Id This property is required. int
Labels This property is required. map[string]string
Name This property is required. string
OsFlavor This property is required. string
OsVersion This property is required. string
RapidDeploy This property is required. bool
Type This property is required. string
Selector string

Deprecated: Please use the with_selector property instead.

architecture This property is required. String
created This property is required. String
deprecated This property is required. String
description This property is required. String
id This property is required. Integer
labels This property is required. Map<String,String>
name This property is required. String
osFlavor This property is required. String
osVersion This property is required. String
rapidDeploy This property is required. Boolean
type This property is required. String
selector String

Deprecated: Please use the with_selector property instead.

architecture This property is required. string
created This property is required. string
deprecated This property is required. string
description This property is required. string
id This property is required. number
labels This property is required. {[key: string]: string}
name This property is required. string
osFlavor This property is required. string
osVersion This property is required. string
rapidDeploy This property is required. boolean
type This property is required. string
selector string

Deprecated: Please use the with_selector property instead.

architecture This property is required. str
created This property is required. str
deprecated This property is required. str
description This property is required. str
id This property is required. int
labels This property is required. Mapping[str, str]
name This property is required. str
os_flavor This property is required. str
os_version This property is required. str
rapid_deploy This property is required. bool
type This property is required. str
selector str

Deprecated: Please use the with_selector property instead.

architecture This property is required. String
created This property is required. String
deprecated This property is required. String
description This property is required. String
id This property is required. Number
labels This property is required. Map<String>
name This property is required. String
osFlavor This property is required. String
osVersion This property is required. String
rapidDeploy This property is required. Boolean
type This property is required. String
selector String

Deprecated: Please use the with_selector property instead.

Package Details

Repository
Hetzner Cloud pulumi/pulumi-hcloud
License
Apache-2.0
Notes
This Pulumi package is based on the hcloud Terraform Provider.
Hetzner Cloud v1.22.0 published on Wednesday, Feb 26, 2025 by Pulumi