getImage

suspend fun getImage(argument: GetImagePlainArgs): GetImageResult

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

Get the data about a snapshot:

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DigitaloceanFunctions;
import com.pulumi.digitalocean.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 example1 = DigitaloceanFunctions.getImage(GetImageArgs.builder()
.name("example-1.0.0")
.build());
}
}

Return

A collection of values returned by getImage.

Parameters

argument

A collection of arguments for invoking getImage.


suspend fun getImage(id: Int? = null, name: String? = null, slug: String? = null, source: String? = null): GetImageResult

Return

A collection of values returned by getImage.

See also

Parameters

id

The id of the image

name

The name of the image.

slug

The slug of the official image. If name is specified, you may also specify:

source

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


suspend fun getImage(argument: suspend GetImagePlainArgsBuilder.() -> Unit): GetImageResult

Return

A collection of values returned by getImage.

See also

Parameters

argument

Builder for com.pulumi.digitalocean.kotlin.inputs.GetImagePlainArgs.