ionoscloud.getImage
Explore with Pulumi AI
The Image data source can be used to search for and return an existing image which can then be used to provision a server.
If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned.
When this happens, please refine your search string so that it is specific enough to return only one result. In case multiple matches are found, enable debug(TF_LOG=debug
) to show the name and location of the images.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const cdrom = ionoscloud.getImage({
cloudInit: "NONE",
imageAlias: "ubuntu:latest_iso",
location: "de/txl",
type: "CDROM",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
cdrom = ionoscloud.get_image(cloud_init="NONE",
image_alias="ubuntu:latest_iso",
location="de/txl",
type="CDROM")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.GetImage(ctx, &ionoscloud.GetImageArgs{
CloudInit: pulumi.StringRef("NONE"),
ImageAlias: pulumi.StringRef("ubuntu:latest_iso"),
Location: pulumi.StringRef("de/txl"),
Type: pulumi.StringRef("CDROM"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var cdrom = Ionoscloud.GetImage.Invoke(new()
{
CloudInit = "NONE",
ImageAlias = "ubuntu:latest_iso",
Location = "de/txl",
Type = "CDROM",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetImageArgs;
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 cdrom = IonoscloudFunctions.getImage(GetImageArgs.builder()
.cloudInit("NONE")
.imageAlias("ubuntu:latest_iso")
.location("de/txl")
.type("CDROM")
.build());
}
}
variables:
cdrom:
fn::invoke:
function: ionoscloud:getImage
arguments:
cloudInit: NONE
imageAlias: ubuntu:latest_iso
location: de/txl
type: CDROM
Finds an image with alias ubuntu:latest_iso
, in location de/txl
, that does not support cloud_init
and is of type CDROM
.
Additional Examples
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getImage({
imageAlias: "ubuntu:latest",
location: "de/txl",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_image(image_alias="ubuntu:latest",
location="de/txl")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.GetImage(ctx, &ionoscloud.GetImageArgs{
ImageAlias: pulumi.StringRef("ubuntu:latest"),
Location: pulumi.StringRef("de/txl"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetImage.Invoke(new()
{
ImageAlias = "ubuntu:latest",
Location = "de/txl",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetImageArgs;
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 example = IonoscloudFunctions.getImage(GetImageArgs.builder()
.imageAlias("ubuntu:latest")
.location("de/txl")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getImage
arguments:
imageAlias: ubuntu:latest
location: de/txl
Finds an image with alias ubuntu:latest
in location de/txl
. Uses exact matching on both fields.
Additional Examples
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getImage({
cloudInit: "V1",
imageAlias: "ubuntu:latest",
location: "us/ewr",
type: "HDD",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_image(cloud_init="V1",
image_alias="ubuntu:latest",
location="us/ewr",
type="HDD")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.GetImage(ctx, &ionoscloud.GetImageArgs{
CloudInit: pulumi.StringRef("V1"),
ImageAlias: pulumi.StringRef("ubuntu:latest"),
Location: pulumi.StringRef("us/ewr"),
Type: pulumi.StringRef("HDD"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetImage.Invoke(new()
{
CloudInit = "V1",
ImageAlias = "ubuntu:latest",
Location = "us/ewr",
Type = "HDD",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetImageArgs;
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 example = IonoscloudFunctions.getImage(GetImageArgs.builder()
.cloudInit("V1")
.imageAlias("ubuntu:latest")
.location("us/ewr")
.type("HDD")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getImage
arguments:
cloudInit: V1
imageAlias: ubuntu:latest
location: us/ewr
type: HDD
Finds an image named ubuntu-20.04.6
in location de/txl
. Uses exact matching.
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(cloud_init: Optional[str] = None,
description: Optional[str] = None,
id: Optional[str] = None,
image_alias: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
timeouts: Optional[GetImageTimeouts] = None,
type: Optional[str] = None,
version: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(cloud_init: Optional[pulumi.Input[str]] = None,
description: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
image_alias: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
timeouts: Optional[pulumi.Input[GetImageTimeoutsArgs]] = None,
type: Optional[pulumi.Input[str]] = None,
version: Optional[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: ionoscloud:index/getImage:getImage
arguments:
# arguments dictionary
The following arguments are supported:
- Cloud
Init string - Cloud init compatibility ("NONE" or "V1"). Exact match.
- Description string
- description of the image
- Id string
- UUID of the image
- Image
Alias string - Image alias of the image you are searching for. Exact match. E.g. =
centos:latest
,ubuntu:latest
- Location string
- Id of the existing image's location. Exact match. Possible values:
de/fra
,de/txl
,gb/lhr
,es/vit
,us/ewr
,us/las
- Name string
- Name of an existing image that you want to search for. It will return an exact match if one exists, otherwise it will retrieve partial matches.
- Timeouts
Get
Image Timeouts - Type string
- The image type, HDD or CD-ROM. Exact match.
- Version string
The version of the image that you want to search for.
If both "name" and "version" are provided the plugin will concatenate the two strings in this format [name]-[version]. The resulting string will be used to search for an exact match. An error will be thrown if one is not found.
- Cloud
Init string - Cloud init compatibility ("NONE" or "V1"). Exact match.
- Description string
- description of the image
- Id string
- UUID of the image
- Image
Alias string - Image alias of the image you are searching for. Exact match. E.g. =
centos:latest
,ubuntu:latest
- Location string
- Id of the existing image's location. Exact match. Possible values:
de/fra
,de/txl
,gb/lhr
,es/vit
,us/ewr
,us/las
- Name string
- Name of an existing image that you want to search for. It will return an exact match if one exists, otherwise it will retrieve partial matches.
- Timeouts
Get
Image Timeouts - Type string
- The image type, HDD or CD-ROM. Exact match.
- Version string
The version of the image that you want to search for.
If both "name" and "version" are provided the plugin will concatenate the two strings in this format [name]-[version]. The resulting string will be used to search for an exact match. An error will be thrown if one is not found.
- cloud
Init String - Cloud init compatibility ("NONE" or "V1"). Exact match.
- description String
- description of the image
- id String
- UUID of the image
- image
Alias String - Image alias of the image you are searching for. Exact match. E.g. =
centos:latest
,ubuntu:latest
- location String
- Id of the existing image's location. Exact match. Possible values:
de/fra
,de/txl
,gb/lhr
,es/vit
,us/ewr
,us/las
- name String
- Name of an existing image that you want to search for. It will return an exact match if one exists, otherwise it will retrieve partial matches.
- timeouts
Get
Image Timeouts - type String
- The image type, HDD or CD-ROM. Exact match.
- version String
The version of the image that you want to search for.
If both "name" and "version" are provided the plugin will concatenate the two strings in this format [name]-[version]. The resulting string will be used to search for an exact match. An error will be thrown if one is not found.
- cloud
Init string - Cloud init compatibility ("NONE" or "V1"). Exact match.
- description string
- description of the image
- id string
- UUID of the image
- image
Alias string - Image alias of the image you are searching for. Exact match. E.g. =
centos:latest
,ubuntu:latest
- location string
- Id of the existing image's location. Exact match. Possible values:
de/fra
,de/txl
,gb/lhr
,es/vit
,us/ewr
,us/las
- name string
- Name of an existing image that you want to search for. It will return an exact match if one exists, otherwise it will retrieve partial matches.
- timeouts
Get
Image Timeouts - type string
- The image type, HDD or CD-ROM. Exact match.
- version string
The version of the image that you want to search for.
If both "name" and "version" are provided the plugin will concatenate the two strings in this format [name]-[version]. The resulting string will be used to search for an exact match. An error will be thrown if one is not found.
- cloud_
init str - Cloud init compatibility ("NONE" or "V1"). Exact match.
- description str
- description of the image
- id str
- UUID of the image
- image_
alias str - Image alias of the image you are searching for. Exact match. E.g. =
centos:latest
,ubuntu:latest
- location str
- Id of the existing image's location. Exact match. Possible values:
de/fra
,de/txl
,gb/lhr
,es/vit
,us/ewr
,us/las
- name str
- Name of an existing image that you want to search for. It will return an exact match if one exists, otherwise it will retrieve partial matches.
- timeouts
Get
Image Timeouts - type str
- The image type, HDD or CD-ROM. Exact match.
- version str
The version of the image that you want to search for.
If both "name" and "version" are provided the plugin will concatenate the two strings in this format [name]-[version]. The resulting string will be used to search for an exact match. An error will be thrown if one is not found.
- cloud
Init String - Cloud init compatibility ("NONE" or "V1"). Exact match.
- description String
- description of the image
- id String
- UUID of the image
- image
Alias String - Image alias of the image you are searching for. Exact match. E.g. =
centos:latest
,ubuntu:latest
- location String
- Id of the existing image's location. Exact match. Possible values:
de/fra
,de/txl
,gb/lhr
,es/vit
,us/ewr
,us/las
- name String
- Name of an existing image that you want to search for. It will return an exact match if one exists, otherwise it will retrieve partial matches.
- timeouts Property Map
- type String
- The image type, HDD or CD-ROM. Exact match.
- version String
The version of the image that you want to search for.
If both "name" and "version" are provided the plugin will concatenate the two strings in this format [name]-[version]. The resulting string will be used to search for an exact match. An error will be thrown if one is not found.
getImage Result
The following output properties are available:
- Cloud
Init string - Cloud init compatibility
- Cpu
Hot boolPlug - Is capable of CPU hot plug (no reboot required)
- Cpu
Hot boolUnplug - Is capable of CPU hot unplug (no reboot required)
- Description string
- description of the image
- Disc
Scsi boolHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- Disc
Scsi boolHot Unplug - Is capable of SCSI drive hot unplug (no reboot required)
- Disc
Virtio boolHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- Disc
Virtio boolHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required)
- Expose
Serial bool - Indicates if the serial ID of the disk attached to the server will be exposed or not.
- Id string
- UUID of the image
- Image
Alias string - Image
Aliases List<string> - List of image aliases mapped for this Image
- Licence
Type string - OS type of this Image
- Location string
- Location of that image/snapshot.
- Name string
- name of the image
- Nic
Hot boolPlug - Is capable of nic hot plug (no reboot required)
- Nic
Hot boolUnplug - Is capable of nic hot unplug (no reboot required)
- Public bool
- Indicates if the image is part of the public repository or not
- Ram
Hot boolPlug - Is capable of memory hot plug (no reboot required)
- Ram
Hot boolUnplug - Is capable of memory hot unplug (no reboot required)
- Size double
- The size of the image in GB
- Type string
- This indicates the type of image
- Version string
- Timeouts
Get
Image Timeouts
- Cloud
Init string - Cloud init compatibility
- Cpu
Hot boolPlug - Is capable of CPU hot plug (no reboot required)
- Cpu
Hot boolUnplug - Is capable of CPU hot unplug (no reboot required)
- Description string
- description of the image
- Disc
Scsi boolHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- Disc
Scsi boolHot Unplug - Is capable of SCSI drive hot unplug (no reboot required)
- Disc
Virtio boolHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- Disc
Virtio boolHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required)
- Expose
Serial bool - Indicates if the serial ID of the disk attached to the server will be exposed or not.
- Id string
- UUID of the image
- Image
Alias string - Image
Aliases []string - List of image aliases mapped for this Image
- Licence
Type string - OS type of this Image
- Location string
- Location of that image/snapshot.
- Name string
- name of the image
- Nic
Hot boolPlug - Is capable of nic hot plug (no reboot required)
- Nic
Hot boolUnplug - Is capable of nic hot unplug (no reboot required)
- Public bool
- Indicates if the image is part of the public repository or not
- Ram
Hot boolPlug - Is capable of memory hot plug (no reboot required)
- Ram
Hot boolUnplug - Is capable of memory hot unplug (no reboot required)
- Size float64
- The size of the image in GB
- Type string
- This indicates the type of image
- Version string
- Timeouts
Get
Image Timeouts
- cloud
Init String - Cloud init compatibility
- cpu
Hot BooleanPlug - Is capable of CPU hot plug (no reboot required)
- cpu
Hot BooleanUnplug - Is capable of CPU hot unplug (no reboot required)
- description String
- description of the image
- disc
Scsi BooleanHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- disc
Scsi BooleanHot Unplug - Is capable of SCSI drive hot unplug (no reboot required)
- disc
Virtio BooleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio BooleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required)
- expose
Serial Boolean - Indicates if the serial ID of the disk attached to the server will be exposed or not.
- id String
- UUID of the image
- image
Alias String - image
Aliases List<String> - List of image aliases mapped for this Image
- licence
Type String - OS type of this Image
- location String
- Location of that image/snapshot.
- name String
- name of the image
- nic
Hot BooleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot BooleanUnplug - Is capable of nic hot unplug (no reboot required)
- public_ Boolean
- Indicates if the image is part of the public repository or not
- ram
Hot BooleanPlug - Is capable of memory hot plug (no reboot required)
- ram
Hot BooleanUnplug - Is capable of memory hot unplug (no reboot required)
- size Double
- The size of the image in GB
- type String
- This indicates the type of image
- version String
- timeouts
Get
Image Timeouts
- cloud
Init string - Cloud init compatibility
- cpu
Hot booleanPlug - Is capable of CPU hot plug (no reboot required)
- cpu
Hot booleanUnplug - Is capable of CPU hot unplug (no reboot required)
- description string
- description of the image
- disc
Scsi booleanHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- disc
Scsi booleanHot Unplug - Is capable of SCSI drive hot unplug (no reboot required)
- disc
Virtio booleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio booleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required)
- expose
Serial boolean - Indicates if the serial ID of the disk attached to the server will be exposed or not.
- id string
- UUID of the image
- image
Alias string - image
Aliases string[] - List of image aliases mapped for this Image
- licence
Type string - OS type of this Image
- location string
- Location of that image/snapshot.
- name string
- name of the image
- nic
Hot booleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot booleanUnplug - Is capable of nic hot unplug (no reboot required)
- public boolean
- Indicates if the image is part of the public repository or not
- ram
Hot booleanPlug - Is capable of memory hot plug (no reboot required)
- ram
Hot booleanUnplug - Is capable of memory hot unplug (no reboot required)
- size number
- The size of the image in GB
- type string
- This indicates the type of image
- version string
- timeouts
Get
Image Timeouts
- cloud_
init str - Cloud init compatibility
- cpu_
hot_ boolplug - Is capable of CPU hot plug (no reboot required)
- cpu_
hot_ boolunplug - Is capable of CPU hot unplug (no reboot required)
- description str
- description of the image
- disc_
scsi_ boolhot_ plug - Is capable of SCSI drive hot plug (no reboot required)
- disc_
scsi_ boolhot_ unplug - Is capable of SCSI drive hot unplug (no reboot required)
- disc_
virtio_ boolhot_ plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc_
virtio_ boolhot_ unplug - Is capable of Virt-IO drive hot unplug (no reboot required)
- expose_
serial bool - Indicates if the serial ID of the disk attached to the server will be exposed or not.
- id str
- UUID of the image
- image_
alias str - image_
aliases Sequence[str] - List of image aliases mapped for this Image
- licence_
type str - OS type of this Image
- location str
- Location of that image/snapshot.
- name str
- name of the image
- nic_
hot_ boolplug - Is capable of nic hot plug (no reboot required)
- nic_
hot_ boolunplug - Is capable of nic hot unplug (no reboot required)
- public bool
- Indicates if the image is part of the public repository or not
- ram_
hot_ boolplug - Is capable of memory hot plug (no reboot required)
- ram_
hot_ boolunplug - Is capable of memory hot unplug (no reboot required)
- size float
- The size of the image in GB
- type str
- This indicates the type of image
- version str
- timeouts
Get
Image Timeouts
- cloud
Init String - Cloud init compatibility
- cpu
Hot BooleanPlug - Is capable of CPU hot plug (no reboot required)
- cpu
Hot BooleanUnplug - Is capable of CPU hot unplug (no reboot required)
- description String
- description of the image
- disc
Scsi BooleanHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- disc
Scsi BooleanHot Unplug - Is capable of SCSI drive hot unplug (no reboot required)
- disc
Virtio BooleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio BooleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required)
- expose
Serial Boolean - Indicates if the serial ID of the disk attached to the server will be exposed or not.
- id String
- UUID of the image
- image
Alias String - image
Aliases List<String> - List of image aliases mapped for this Image
- licence
Type String - OS type of this Image
- location String
- Location of that image/snapshot.
- name String
- name of the image
- nic
Hot BooleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot BooleanUnplug - Is capable of nic hot unplug (no reboot required)
- public Boolean
- Indicates if the image is part of the public repository or not
- ram
Hot BooleanPlug - Is capable of memory hot plug (no reboot required)
- ram
Hot BooleanUnplug - Is capable of memory hot unplug (no reboot required)
- size Number
- The size of the image in GB
- type String
- This indicates the type of image
- version String
- timeouts Property Map
Supporting Types
GetImageTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.