DigitalOcean

Pulumi Official
Package maintained by Pulumi
v4.14.0 published on Friday, Jun 17, 2022 by Pulumi

getImage

Get information on an image for use in other resources (e.g. creating a Droplet based on snapshot). This data source provides all of the image properties as configured on your DigitalOcean account. This is useful if the image in question is not managed by the provider or you need to utilize any of the image’s data.

An error is triggered if zero or more than one result is returned by the query.

Example Usage

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
    public MyStack()
    {
        var example1 = Output.Create(DigitalOcean.GetImage.InvokeAsync(new DigitalOcean.GetImageArgs
        {
            Name = "example-1.0.0",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := digitalocean.GetImage(ctx, &GetImageArgs{
			Name: pulumi.StringRef("example-1.0.0"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example1 = Output.of(DigitaloceanFunctions.getImage(GetImageArgs.builder()
            .name("example-1.0.0")
            .build()));

    }
}
import pulumi
import pulumi_digitalocean as digitalocean

example1 = digitalocean.get_image(name="example-1.0.0")
import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const example1 = pulumi.output(digitalocean.getImage({
    name: "example-1.0.0",
}));
variables:
  example1:
    Fn::Invoke:
      Function: digitalocean:getImage
      Arguments:
        name: example-1.0.0

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,
              name: Optional[str] = None,
              slug: Optional[str] = None,
              source: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(id: Optional[pulumi.Input[int]] = None,
              name: Optional[pulumi.Input[str]] = None,
              slug: Optional[pulumi.Input[str]] = None,
              source: 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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: digitalocean:index/getImage:getImage
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Id int

The id of the image

Name string

The name of the image.

Slug string

The slug of the official image.

Source string

Restrict the search to one of the following categories of images:

Id int

The id of the image

Name string

The name of the image.

Slug string

The slug of the official image.

Source string

Restrict the search to one of the following categories of images:

id Integer

The id of the image

name String

The name of the image.

slug String

The slug of the official image.

source String

Restrict the search to one of the following categories of images:

id number

The id of the image

name string

The name of the image.

slug string

The slug of the official image.

source string

Restrict the search to one of the following categories of images:

id int

The id of the image

name str

The name of the image.

slug str

The slug of the official image.

source str

Restrict the search to one of the following categories of images:

id Number

The id of the image

name String

The name of the image.

slug String

The slug of the official image.

source String

Restrict the search to one of the following categories of images:

getImage Result

The following output properties are available:

Created string
Description string
Distribution string

The name of the distribution of the OS of the image.

  • min_disk_size: The minimum 'disk' required for the image.
  • size_gigabytes: The size of the image in GB.
ErrorMessage string
Id int
Image string

The id of the image (legacy parameter).

MinDiskSize int
Name string
Private bool

Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account.

  • regions: A set of the regions that the image is available in.
  • tags: A set of tags applied to the image
  • created: When the image was created
  • status: Current status of the image
  • error_message: Any applicable error message pertaining to the image
Regions List<string>
SizeGigabytes double
Slug string
Status string
Tags List<string>
Type string
Source string
Created string
Description string
Distribution string

The name of the distribution of the OS of the image.

  • min_disk_size: The minimum 'disk' required for the image.
  • size_gigabytes: The size of the image in GB.
ErrorMessage string
Id int
Image string

The id of the image (legacy parameter).

MinDiskSize int
Name string
Private bool

Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account.

  • regions: A set of the regions that the image is available in.
  • tags: A set of tags applied to the image
  • created: When the image was created
  • status: Current status of the image
  • error_message: Any applicable error message pertaining to the image
Regions []string
SizeGigabytes float64
Slug string
Status string
Tags []string
Type string
Source string
created String
description String
distribution String

The name of the distribution of the OS of the image.

  • min_disk_size: The minimum 'disk' required for the image.
  • size_gigabytes: The size of the image in GB.
errorMessage String
id Integer
image String

The id of the image (legacy parameter).

minDiskSize Integer
name String
private_ Boolean

Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account.

  • regions: A set of the regions that the image is available in.
  • tags: A set of tags applied to the image
  • created: When the image was created
  • status: Current status of the image
  • error_message: Any applicable error message pertaining to the image
regions List<String>
sizeGigabytes Double
slug String
status String
tags List<String>
type String
source String
created string
description string
distribution string

The name of the distribution of the OS of the image.

  • min_disk_size: The minimum 'disk' required for the image.
  • size_gigabytes: The size of the image in GB.
errorMessage string
id number
image string

The id of the image (legacy parameter).

minDiskSize number
name string
private boolean

Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account.

  • regions: A set of the regions that the image is available in.
  • tags: A set of tags applied to the image
  • created: When the image was created
  • status: Current status of the image
  • error_message: Any applicable error message pertaining to the image
regions string[]
sizeGigabytes number
slug string
status string
tags string[]
type string
source string
created str
description str
distribution str

The name of the distribution of the OS of the image.

  • min_disk_size: The minimum 'disk' required for the image.
  • size_gigabytes: The size of the image in GB.
error_message str
id int
image str

The id of the image (legacy parameter).

min_disk_size int
name str
private bool

Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account.

  • regions: A set of the regions that the image is available in.
  • tags: A set of tags applied to the image
  • created: When the image was created
  • status: Current status of the image
  • error_message: Any applicable error message pertaining to the image
regions Sequence[str]
size_gigabytes float
slug str
status str
tags Sequence[str]
type str
source str
created String
description String
distribution String

The name of the distribution of the OS of the image.

  • min_disk_size: The minimum 'disk' required for the image.
  • size_gigabytes: The size of the image in GB.
errorMessage String
id Number
image String

The id of the image (legacy parameter).

minDiskSize Number
name String
private Boolean

Is image a public image or not. Public images represent Linux distributions or One-Click Applications, while non-public images represent snapshots and backups and are only available within your account.

  • regions: A set of the regions that the image is available in.
  • tags: A set of tags applied to the image
  • created: When the image was created
  • status: Current status of the image
  • error_message: Any applicable error message pertaining to the image
regions List<String>
sizeGigabytes Number
slug String
status String
tags List<String>
type String
source String

Package Details

Repository
https://github.com/pulumi/pulumi-digitalocean
License
Apache-2.0
Notes

This Pulumi package is based on the digitalocean Terraform Provider.