get Images
Get information on images for use in other resources (e.g. creating a Droplet based on a snapshot), with the ability to filter and sort the results. If no filters are specified, all images will be returned. This data source is useful if the image in question is not managed by the provider or you need to utilize any of the image's data. Note: You can use the digitalocean.getImage
data source to obtain metadata about a single image if you already know the slug
, unique name
, or id
to retrieve.
Example Usage
Use the filter
block with a key
string and values
list to filter images. For example to find all Ubuntu images:
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.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 ubuntu = DigitaloceanFunctions.getImages(GetImagesArgs.builder()
.filters(GetImagesFilterArgs.builder()
.key("distribution")
.values("Ubuntu")
.build())
.build());
}
}
Return
A collection of values returned by getImages.
Parameters
A collection of arguments for invoking getImages.
Return
A collection of values returned by getImages.
See also
Parameters
Filter the results. The filter
block is documented below.
Sort the results. The sort
block is documented below.
Return
A collection of values returned by getImages.
See also
Parameters
Builder for com.pulumi.digitalocean.kotlin.inputs.GetImagesPlainArgs.